From 87f98d75fa021f00911fad13773d8972e7ebeb55 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 13 Jan 2015 13:19:50 -0800 Subject: Improve call button accessibility. + Convert Audio Button into a ToggleButton, and update its content description depending on whether its acting as a toggle for speakerphone, or if it's acting as a menu button to select from more than two audio output modes. + Set custom style on ToggleButtons with null background, to override the default ToggleButton styling which was causing shadows. - Delete CallToggleButton, which did some hacky things with the content description and accessibility. - Delete helper method which abused TYPE_ANNOUNCEMENTS. Rely on default TalkBack behavior for ToggleButtons to read on click. - Delete unused accessibility strings. The states these were formerly read out for will now be handled by a combination of button labels and default TalkBack behavior. The UI (without TalkBack) behaves the same after these changes. The behavior with TalkBack after these changes is that the audio (when toggling for speakerphone), mute, and hold buttons will generally read "speaker/mute/hold button (not) checked" when explored by touch depending on their state. They will read "speaker/mute/hold" when clicked. If more than two audio modes are supported, the audio button will read " button checked", where can be speaker, bluetooth, handset, or earpiece. When clicked, it will open the audio pop up menu and read that there are # options displayed on the screen. This is combines the ToggleButton and PopupMenu Talkback behavior, since this is a custom widget. Bug: 18783204 Change-Id: I27363c697bb018b5f87ad2e27678f8db6d93b2e7 --- InCallUI/res/drawable/btn_compound_audio.xml | 9 --------- InCallUI/res/drawable/btn_compound_background.xml | 2 +- InCallUI/res/layout/call_button_fragment.xml | 14 ++++++------- InCallUI/res/values/strings.xml | 24 ----------------------- InCallUI/res/values/styles.xml | 9 +++++---- 5 files changed, 13 insertions(+), 45 deletions(-) (limited to 'InCallUI/res') diff --git a/InCallUI/res/drawable/btn_compound_audio.xml b/InCallUI/res/drawable/btn_compound_audio.xml index 222ff1b41..25a64a6ab 100644 --- a/InCallUI/res/drawable/btn_compound_audio.xml +++ b/InCallUI/res/drawable/btn_compound_audio.xml @@ -90,13 +90,4 @@ android:tint="@color/selectable_icon_tint" /> - - - - diff --git a/InCallUI/res/drawable/btn_compound_background.xml b/InCallUI/res/drawable/btn_compound_background.xml index 36aab0df7..20e2a3056 100644 --- a/InCallUI/res/drawable/btn_compound_background.xml +++ b/InCallUI/res/drawable/btn_compound_background.xml @@ -32,4 +32,4 @@ - \ No newline at end of file + diff --git a/InCallUI/res/layout/call_button_fragment.xml b/InCallUI/res/layout/call_button_fragment.xml index 2ca640368..24101feac 100644 --- a/InCallUI/res/layout/call_button_fragment.xml +++ b/InCallUI/res/layout/call_button_fragment.xml @@ -67,10 +67,10 @@ - + android:contentDescription="@string/audio_mode_speaker" /> - @@ -90,7 +90,7 @@ - @@ -101,7 +101,7 @@ other of these must always be set to GONE. --> - @@ -121,7 +121,7 @@ android:visibility="gone" /> - - Send - - Speakerphone selected - - - Earpiece selected - - - Wired headset selected - - - Bluetooth headset selected - - - Call muted. - - - Call unmuted. - - - Call put on hold. - - - Call no longer on hold. - Answer diff --git a/InCallUI/res/values/styles.xml b/InCallUI/res/values/styles.xml index 9471c183e..e16d72cb4 100644 --- a/InCallUI/res/values/styles.xml +++ b/InCallUI/res/values/styles.xml @@ -61,11 +61,11 @@ + These buttons have the concept of two states: checked and unchecked. This style is just + like "InCallButton" except that we also clear out android:background, android:textOn, + android:textOff, to avoid the default behavior of the ToggleButton class. --> @@ -115,6 +115,7 @@ @color/dialer_theme_color_dark @style/InCallPopupMenuStyle @style/InCallActionBarStyle + @style/InCallCompoundButton