diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-10-11 10:54:39 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-10-11 10:55:14 -0700 |
commit | 3f8864069be20d14debacddee610062f3feae5a1 (patch) | |
tree | 63d3dc56d644e12242c0f045e7ea7aa71b068980 /src/com/android/launcher3/accessibility | |
parent | 327f7b712538f5a4c8488cefb1a2e764674495eb (diff) | |
download | android_packages_apps_Trebuchet-3f8864069be20d14debacddee610062f3feae5a1.tar.gz android_packages_apps_Trebuchet-3f8864069be20d14debacddee610062f3feae5a1.tar.bz2 android_packages_apps_Trebuchet-3f8864069be20d14debacddee610062f3feae5a1.zip |
Announcing the final action when the drag-drop completes
Bug:31926812
Change-Id: Id0566cc7dc15732981320807a02fb9cae8a885e6
Diffstat (limited to 'src/com/android/launcher3/accessibility')
-rw-r--r-- | src/com/android/launcher3/accessibility/DragViewStateAnnouncer.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/launcher3/accessibility/DragViewStateAnnouncer.java b/src/com/android/launcher3/accessibility/DragViewStateAnnouncer.java index 8ff82dd4f..99deb7b1c 100644 --- a/src/com/android/launcher3/accessibility/DragViewStateAnnouncer.java +++ b/src/com/android/launcher3/accessibility/DragViewStateAnnouncer.java @@ -21,6 +21,8 @@ import android.view.View; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; +import com.android.launcher3.Launcher; + /** * Periodically sends accessibility events to announce ongoing state changed. Based on the * implementation in ProgressBar. @@ -50,6 +52,12 @@ public class DragViewStateAnnouncer implements Runnable { mTargetView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); } + public void completeAction(int announceResId) { + cancel(); + Launcher launcher = Launcher.getLauncher(mTargetView.getContext()); + launcher.getDragLayer().announceForAccessibility(launcher.getText(announceResId)); + } + public static DragViewStateAnnouncer createFor(View v) { if (((AccessibilityManager) v.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE)) .isEnabled()) { |