From 78bfb9829561876137c62ca1fff13760bfc77472 Mon Sep 17 00:00:00 2001 From: alanv Date: Wed, 20 Jun 2012 12:10:48 -0700 Subject: Fix GlowPadView accessibility behavior. Bug: 6702412 Change-Id: If5ab75e77b0090a405004c66da0083e81d59deb4 --- .../android/internal/widget/multiwaveview/GlowPadView.java | 14 ++++---------- core/res/res/layout-sw600dp/keyguard_screen_tab_unlock.xml | 1 + .../res/layout-sw600dp/keyguard_screen_tab_unlock_land.xml | 1 + core/res/res/layout/keyguard_screen_tab_unlock.xml | 1 + core/res/res/layout/keyguard_screen_tab_unlock_land.xml | 1 + 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core/java/com/android/internal/widget/multiwaveview/GlowPadView.java b/core/java/com/android/internal/widget/multiwaveview/GlowPadView.java index 62410ed..4e60b75 100644 --- a/core/java/com/android/internal/widget/multiwaveview/GlowPadView.java +++ b/core/java/com/android/internal/widget/multiwaveview/GlowPadView.java @@ -881,7 +881,7 @@ public class GlowPadView extends View { } if (AccessibilityManager.getInstance(mContext).isEnabled()) { String targetContentDescription = getTargetDescription(activeTarget); - announceText(targetContentDescription); + announceForAccessibility(targetContentDescription); } } } @@ -1089,16 +1089,10 @@ public class GlowPadView extends View { String text = String.format(directionDescription, targetDescription); utterance.append(text); } - if (utterance.length() > 0) { - announceText(utterance.toString()); - } } - } - - private void announceText(String text) { - setContentDescription(text); - sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED); - setContentDescription(null); + if (utterance.length() > 0) { + announceForAccessibility(utterance.toString()); + } } private String getTargetDescription(int index) { diff --git a/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock.xml b/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock.xml index 356e7cf..af7d011 100644 --- a/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock.xml +++ b/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock.xml @@ -89,6 +89,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:gravity="center" + android:focusable="true" android:targetDrawables="@array/lockscreen_targets_with_camera" android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera" diff --git a/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock_land.xml b/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock_land.xml index cb1cb21..9c18b7e 100644 --- a/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock_land.xml +++ b/core/res/res/layout-sw600dp/keyguard_screen_tab_unlock_land.xml @@ -89,6 +89,7 @@ android:layout_rowSpan="7" android:layout_gravity="center_vertical|right" android:gravity="center" + android:focusable="true" android:targetDrawables="@array/lockscreen_targets_with_camera" android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera" diff --git a/core/res/res/layout/keyguard_screen_tab_unlock.xml b/core/res/res/layout/keyguard_screen_tab_unlock.xml index 91f65e9..81166222 100644 --- a/core/res/res/layout/keyguard_screen_tab_unlock.xml +++ b/core/res/res/layout/keyguard_screen_tab_unlock.xml @@ -130,6 +130,7 @@ android:layout_height="match_parent" android:layout_alignParentBottom="true" android:gravity="top" + android:focusable="true" android:targetDrawables="@array/lockscreen_targets_with_camera" android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera" diff --git a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml index 8b9d8e4..35e4d11 100644 --- a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml +++ b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml @@ -135,6 +135,7 @@ android:layout_height="match_parent" android:layout_rowSpan="7" android:gravity="left|center_vertical" + android:focusable="true" android:targetDrawables="@array/lockscreen_targets_with_camera" android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera" -- cgit v1.1