diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-08-17 11:11:48 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-09-02 18:26:33 +0000 |
commit | 9be993665398c604dcaed8e90f54893bd164b9df (patch) | |
tree | 9927e68273b28840b4fa88166a73babae3a07d52 /src/com/android | |
parent | def6e474dad311224b97ae66f62c3313c6542955 (diff) | |
download | android_packages_apps_Trebuchet-9be993665398c604dcaed8e90f54893bd164b9df.tar.gz android_packages_apps_Trebuchet-9be993665398c604dcaed8e90f54893bd164b9df.tar.bz2 android_packages_apps_Trebuchet-9be993665398c604dcaed8e90f54893bd164b9df.zip |
Fixing broken accessibility drag
> Allow touch events on hotseat while in accessible drag as drag now
happens in spring loaded state.
> Allow drop target buttons to ignore thershold check when in
accessibility drag
Bug: 30900444
Change-Id: I88274367983fc027b2ddde3a719ca943f4f48587
(cherry picked from commit 4583d09c0560a83bfd0320299482cc41ac460b0c)
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher3/ButtonDropTarget.java | 7 | ||||
-rw-r--r-- | src/com/android/launcher3/Hotseat.java | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/com/android/launcher3/ButtonDropTarget.java b/src/com/android/launcher3/ButtonDropTarget.java index 5a4ed2f54..0f6073eee 100644 --- a/src/com/android/launcher3/ButtonDropTarget.java +++ b/src/com/android/launcher3/ButtonDropTarget.java @@ -62,6 +62,8 @@ public abstract class ButtonDropTarget extends TextView /** Whether this drop target is active for the current drag */ protected boolean mActive; + /** Whether an accessible drag is in progress */ + private boolean mAccessibleDrag; /** An item must be dragged at least this many pixels before this drop target is enabled. */ private final int mDragDistanceThreshold; @@ -218,8 +220,8 @@ public abstract class ButtonDropTarget extends TextView @Override public boolean isDropEnabled() { - return mActive - && mLauncher.getDragController().getDistanceDragged() >= mDragDistanceThreshold; + return mActive && (mAccessibleDrag || + mLauncher.getDragController().getDistanceDragged() >= mDragDistanceThreshold); } @Override @@ -307,6 +309,7 @@ public abstract class ButtonDropTarget extends TextView } public void enableAccessibleDrag(boolean enable) { + mAccessibleDrag = enable; setOnClickListener(enable ? this : null); } diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index 7c0ed10d0..c738480fe 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -165,11 +165,9 @@ public class Hotseat extends FrameLayout @Override public boolean onInterceptTouchEvent(MotionEvent ev) { // We don't want any clicks to go through to the hotseat unless the workspace is in - // the normal state. - if (mLauncher.getWorkspace().workspaceInModalState()) { - return true; - } - return false; + // the normal state or an accessible drag is in progress. + return mLauncher.getWorkspace().workspaceInModalState() && + !mLauncher.getAccessibilityDelegate().isInAccessibleDrag(); } @Override |