Add accessibility label for "QR code" button in Audio sharing page.
Test: atest Bug: 354112158 Flag: com.android.settingslib.flags.enable_le_audio_sharing Change-Id: I5d2e2c70ca76e3598ca3d9550ebcc140d3400e34
This commit is contained in:
@@ -92,6 +92,8 @@ public class AudioSharingNamePreference extends ValidatedEditTextPreference {
|
|||||||
shareButton.setVisibility(View.VISIBLE);
|
shareButton.setVisibility(View.VISIBLE);
|
||||||
shareButton.setImageDrawable(getContext().getDrawable(R.drawable.ic_qrcode_24dp));
|
shareButton.setImageDrawable(getContext().getDrawable(R.drawable.ic_qrcode_24dp));
|
||||||
shareButton.setOnClickListener(unused -> launchAudioSharingQrCodeFragment());
|
shareButton.setOnClickListener(unused -> launchAudioSharingQrCodeFragment());
|
||||||
|
shareButton.setContentDescription(
|
||||||
|
getContext().getString(R.string.audio_sharing_qrcode_button_label));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureInvisibleStateForQrCodeIcon(ImageButton shareButton, View divider) {
|
private void configureInvisibleStateForQrCodeIcon(ImageButton shareButton, View divider) {
|
||||||
|
@@ -117,6 +117,7 @@ public class AudioSharingNamePreferenceTest {
|
|||||||
assertThat(shareButton.getVisibility()).isEqualTo(View.VISIBLE);
|
assertThat(shareButton.getVisibility()).isEqualTo(View.VISIBLE);
|
||||||
assertThat(shareButton.getDrawable()).isNotNull();
|
assertThat(shareButton.getDrawable()).isNotNull();
|
||||||
assertThat(shareButton.hasOnClickListeners()).isTrue();
|
assertThat(shareButton.hasOnClickListeners()).isTrue();
|
||||||
|
assertThat(shareButton.getContentDescription()).isNotNull();
|
||||||
assertThat(divider).isNotNull();
|
assertThat(divider).isNotNull();
|
||||||
assertThat(divider.getVisibility()).isEqualTo(View.VISIBLE);
|
assertThat(divider.getVisibility()).isEqualTo(View.VISIBLE);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user