summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Workspace.java
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-12-12 21:03:24 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-12-12 21:03:24 +0000
commitcf160d392af743482e6b87342d80dfddc1d69c3d (patch)
treea1eff8067fcf13070024cbaf90265e3dcc29cbbd /src/com/android/launcher3/Workspace.java
parent776ca257cefcf2a94e06bf89df6267c945708afe (diff)
parent0c7852f822497a2189bb6fb778cc14ea776f6fe6 (diff)
downloadandroid_packages_apps_Trebuchet-cf160d392af743482e6b87342d80dfddc1d69c3d.tar.gz
android_packages_apps_Trebuchet-cf160d392af743482e6b87342d80dfddc1d69c3d.tar.bz2
android_packages_apps_Trebuchet-cf160d392af743482e6b87342d80dfddc1d69c3d.zip
Merge "Allow long-press on workspace immediately after dropping." into ub-launcher3-master
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r--src/com/android/launcher3/Workspace.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 10680b4e0..00e458f6a 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1160,7 +1160,7 @@ public class Workspace extends PagedView
}
private boolean shouldConsumeTouch(View v) {
- return (workspaceInModalState() || !isFinishedSwitchingState())
+ return !workspaceIconsCanBeDragged()
|| (!workspaceInModalState() && indexOfChild(v) != mCurrentPage);
}
@@ -1826,6 +1826,11 @@ public class Workspace extends PagedView
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();