From 7299e0f6bd312f01920e8d38004876ff184f9780 Mon Sep 17 00:00:00 2001 From: chelseahao Date: Mon, 22 Jul 2024 15:53:51 +0800 Subject: [PATCH] Add accessibility label for "QR code" image. Also added landscape mode. Test: atest Bug: 354116021 Flag: com.android.settingslib.flags.enable_le_audio_sharing Change-Id: Ide20e07f38660ef7f444fbe3b20d3364b9951e02 --- .../bluetooth_audio_streams_qr_code.xml | 62 +++++++++++++++++++ .../bluetooth_audio_streams_qr_code.xml | 4 +- res/values/strings.xml | 2 + .../AudioStreamsQrCodeFragment.java | 2 +- 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 res/layout-land/bluetooth_audio_streams_qr_code.xml rename res/{xml => layout}/bluetooth_audio_streams_qr_code.xml (91%) diff --git a/res/layout-land/bluetooth_audio_streams_qr_code.xml b/res/layout-land/bluetooth_audio_streams_qr_code.xml new file mode 100644 index 00000000000..b35bc65f84f --- /dev/null +++ b/res/layout-land/bluetooth_audio_streams_qr_code.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + diff --git a/res/xml/bluetooth_audio_streams_qr_code.xml b/res/layout/bluetooth_audio_streams_qr_code.xml similarity index 91% rename from res/xml/bluetooth_audio_streams_qr_code.xml rename to res/layout/bluetooth_audio_streams_qr_code.xml index 5ec5505c4bb..fd521febc4a 100644 --- a/res/xml/bluetooth_audio_streams_qr_code.xml +++ b/res/layout/bluetooth_audio_streams_qr_code.xml @@ -47,7 +47,9 @@ + android:layout_height="@dimen/qrcode_size" + android:contentDescription="@string/audio_streams_qr_code_page_image_label" + android:focusable="true"/> Scan an audio stream QR code to listen with %1$s Can\u0027t edit password while sharing. To change the password, first turn off audio sharing. + + QR code diff --git a/src/com/android/settings/connecteddevice/audiosharing/audiostreams/AudioStreamsQrCodeFragment.java b/src/com/android/settings/connecteddevice/audiosharing/audiostreams/AudioStreamsQrCodeFragment.java index e4c07949b41..47f9c75514e 100644 --- a/src/com/android/settings/connecteddevice/audiosharing/audiostreams/AudioStreamsQrCodeFragment.java +++ b/src/com/android/settings/connecteddevice/audiosharing/audiostreams/AudioStreamsQrCodeFragment.java @@ -55,7 +55,7 @@ public class AudioStreamsQrCodeFragment extends InstrumentedFragment { @Override public final View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - return inflater.inflate(R.xml.bluetooth_audio_streams_qr_code, container, false); + return inflater.inflate(R.layout.bluetooth_audio_streams_qr_code, container, false); } @Override