Add accessibility label for "QR code" scanner.

Also added landscape mode.

Test: atest
Bug: 354116021
Flag: com.android.settingslib.flags.enable_le_audio_sharing
Change-Id: Ibb68252c5de5b30bdcbb9e9f88127b26e767ef04
This commit is contained in:
chelseahao
2024-07-22 16:58:58 +08:00
committed by Chelsea Hao
parent 7299e0f6bd
commit 467bb26083
3 changed files with 79 additions and 1 deletions

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@android:id/summary"
style="@style/QrCodeScanner"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:gravity="center"
android:clipChildren="true"
android:contentDescription="@string/audio_streams_qr_code_scanner_label"
android:focusable="true">
<TextureView
android:id="@+id/preview_view"
android:layout_marginStart="@dimen/qrcode_preview_margin"
android:layout_marginEnd="@dimen/qrcode_preview_margin"
android:layout_width="match_parent"
android:layout_height="@dimen/qrcode_preview_size"/>
</FrameLayout>
<TextView
android:id="@+id/error_message"
style="@style/TextAppearance.ErrorText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center"
android:layout_gravity="center"
android:visibility="invisible"/>
</LinearLayout>
</LinearLayout>

View File

@@ -55,7 +55,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="top" android:layout_gravity="top"
android:gravity="center" android:gravity="center"
android:clipChildren="true"> android:clipChildren="true"
android:contentDescription="@string/audio_streams_qr_code_scanner_label"
android:focusable="true">
<TextureView <TextureView
android:id="@+id/preview_view" android:id="@+id/preview_view"
android:layout_marginStart="@dimen/qrcode_preview_margin" android:layout_marginStart="@dimen/qrcode_preview_margin"

View File

@@ -13744,6 +13744,8 @@
<string name="audio_streams_main_page_password_dialog_cannot_edit">Can\u0027t edit password while sharing. To change the password, first turn off audio sharing.</string> <string name="audio_streams_main_page_password_dialog_cannot_edit">Can\u0027t edit password while sharing. To change the password, first turn off audio sharing.</string>
<!-- Text for audio sharing qrcode image [CHAR LIMIT=none]--> <!-- Text for audio sharing qrcode image [CHAR LIMIT=none]-->
<string name="audio_streams_qr_code_page_image_label">QR code</string> <string name="audio_streams_qr_code_page_image_label">QR code</string>
<!-- Text for audio sharing qrcode scanner [CHAR LIMIT=none]-->
<string name="audio_streams_qr_code_scanner_label">QR code scanner</string>
<!-- url for learning more about bluetooth audio sharing --> <!-- url for learning more about bluetooth audio sharing -->