Merge "Fix GlowPadView accessibility behavior." into jb-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
dce5af632c
@@ -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) {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user