Merge "Allow long-press on workspace immediately after dropping." into ub-launcher3-master
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index 2c9ebba..3648fb7 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -167,7 +167,7 @@
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 or an accessible drag is in progress.
- return mLauncher.getWorkspace().workspaceInModalState() &&
+ return !mLauncher.getWorkspace().workspaceIconsCanBeDragged() &&
!mLauncher.getAccessibilityDelegate().isInAccessibleDrag();
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 10680b4..00e458f 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1160,7 +1160,7 @@
}
private boolean shouldConsumeTouch(View v) {
- return (workspaceInModalState() || !isFinishedSwitchingState())
+ return !workspaceIconsCanBeDragged()
|| (!workspaceInModalState() && indexOfChild(v) != mCurrentPage);
}
@@ -1826,6 +1826,11 @@
return mState != State.NORMAL;
}
+ /** Returns whether a drag should be allowed to be started from the current workspace state. */
+ public boolean workspaceIconsCanBeDragged() {
+ return mState == State.NORMAL || mState == State.SPRING_LOADED;
+ }
+
@Thunk void updateChildrenLayersEnabled(boolean force) {
boolean small = mState == State.OVERVIEW || mIsSwitchingState;
boolean enableChildrenLayers = force || small || mAnimatingViewIntoPlace || isPageInTransition();