summaryrefslogtreecommitdiffstats
path: root/packages/Keyguard/src/com/android
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2013-09-25 17:08:48 -0700
committerJim Miller <jaggies@google.com>2013-09-25 19:29:02 -0700
commit1962e264660b37b7e386eb2ac84fc915dd7c75dd (patch)
tree90ce43e71527ded92b2650212fa66eb4b02ecf63 /packages/Keyguard/src/com/android
parent7e391cb8acc36eb7a9f489e60e127ca8dfab37ac (diff)
downloadframeworks_base-1962e264660b37b7e386eb2ac84fc915dd7c75dd.zip
frameworks_base-1962e264660b37b7e386eb2ac84fc915dd7c75dd.tar.gz
frameworks_base-1962e264660b37b7e386eb2ac84fc915dd7c75dd.tar.bz2
Fix keyguard widget pager accessibility
- announce when widget hovers over drop target - announce when widget leaves drop target Fixes bug 10151121 Change-Id: Ia36400f4e8651149590e004b82f66d43c9deaa08
Diffstat (limited to 'packages/Keyguard/src/com/android')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardWidgetFrame.java6
-rw-r--r--packages/Keyguard/src/com/android/keyguard/PagedView.java18
2 files changed, 21 insertions, 3 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetFrame.java b/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetFrame.java
index 81f6221..c0586d5 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetFrame.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardWidgetFrame.java
@@ -147,6 +147,10 @@ public class KeyguardWidgetFrame extends FrameLayout {
if (ENABLE_HOVER_OVER_DELETE_DROP_TARGET_OVERLAY) {
if (mIsHoveringOverDeleteDropTarget != isHovering) {
mIsHoveringOverDeleteDropTarget = isHovering;
+ int resId = isHovering ? R.string.keyguard_accessibility_delete_widget_start
+ : R.string.keyguard_accessibility_delete_widget_end;
+ String text = getContext().getResources().getString(resId, getContentDescription());
+ announceForAccessibility(text);
invalidate();
}
}
@@ -326,7 +330,7 @@ public class KeyguardWidgetFrame extends FrameLayout {
/**
* Depending on whether the security is up, the widget size needs to change
- *
+ *
* @param height The height of the widget, -1 for full height
*/
private void setWidgetHeight(int height) {
diff --git a/packages/Keyguard/src/com/android/keyguard/PagedView.java b/packages/Keyguard/src/com/android/keyguard/PagedView.java
index b6279d0..666227c 100644
--- a/packages/Keyguard/src/com/android/keyguard/PagedView.java
+++ b/packages/Keyguard/src/com/android/keyguard/PagedView.java
@@ -125,6 +125,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
private int[] mChildOffsets;
private int[] mChildRelativeOffsets;
private int[] mChildOffsetsWithLayoutScale;
+ private String mDeleteString; // Accessibility announcement when widget is deleted
protected final static int TOUCH_STATE_REST = 0;
protected final static int TOUCH_STATE_SCROLLING = 1;
@@ -1118,6 +1119,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// i.e. fall through to the next case (don't break)
// (We sometimes miss ACTION_DOWN events in Workspace because it ignores all events
// while it's small- this was causing a crash before we checked for INVALID_POINTER)
+
+ break;
}
case MotionEvent.ACTION_DOWN: {
@@ -2194,8 +2197,13 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected void onEndReordering() {
if (AccessibilityManager.getInstance(mContext).isEnabled()) {
- announceForAccessibility(mContext.getString(
- R.string.keyguard_accessibility_widget_reorder_end));
+ if (mDeleteString != null) {
+ announceForAccessibility(mDeleteString);
+ mDeleteString = null;
+ } else {
+ announceForAccessibility(mContext.getString(
+ R.string.keyguard_accessibility_widget_reorder_end));
+ }
}
mIsReordering = false;
@@ -2507,6 +2515,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
AnimatorUpdateListener updateCb = new FlingAlongVectorAnimatorUpdateListener(dragView, vel,
from, startTime, FLING_TO_DELETE_FRICTION);
+ mDeleteString = getContext().getResources()
+ .getString(R.string.keyguard_accessibility_widget_deleted,
+ mDragView.getContentDescription());
final Runnable onAnimationEndRunnable = createPostDeleteAnimationRunnable(dragView);
// Create and start the animation
@@ -2562,6 +2573,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
ObjectAnimator.ofFloat(dragView, "alpha", toAlpha));
animations.add(alphaAnim);
+ mDeleteString = getContext().getResources()
+ .getString(R.string.keyguard_accessibility_widget_deleted,
+ mDragView.getContentDescription());
final Runnable onAnimationEndRunnable = createPostDeleteAnimationRunnable(dragView);
AnimatorSet anim = new AnimatorSet();