summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r--src/com/android/launcher3/PagedView.java20
-rw-r--r--src/com/android/launcher3/Workspace.java10
2 files changed, 19 insertions, 11 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 7ce33c6ac..7aed15599 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -1370,8 +1370,12 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
dampedOverScroll(amount);
}
- public void enableFreeScroll() {
+ /**
+ * return true if freescroll has been enabled, false otherwise
+ */
+ public boolean enableFreeScroll() {
setEnableFreeScroll(true);
+ return true;
}
public void disableFreeScroll() {
@@ -2072,20 +2076,14 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
if (!mReorderingStarted) return;
mReorderingStarted = false;
- // If we haven't flung-to-delete the current child, then we just animate the drag view
- // back into position
- final Runnable onCompleteRunnable = new Runnable() {
- @Override
+ mPostReorderingPreZoomInRunnable = new Runnable() {
public void run() {
+ // If we haven't flung-to-delete the current child,
+ // then we just animate the drag view back into position
onEndReordering();
- }
- };
- mPostReorderingPreZoomInRunnable = new Runnable() {
- public void run() {
- onCompleteRunnable.run();
enableFreeScroll();
- };
+ }
};
mPostReorderingPreZoomInRemainingAnimationCount =
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index bf774e617..fccff6cf4 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -4103,6 +4103,16 @@ public class Workspace extends PagedView
}
}
+ @Override
+ public boolean enableFreeScroll() {
+ if (getState() == State.OVERVIEW) {
+ return super.enableFreeScroll();
+ } else {
+ Log.w(TAG, "enableFreeScroll called but not in overview: state=" + getState());
+ return false;
+ }
+ }
+
/**
* Used as a workaround to ensure that the AppWidgetService receives the
* PACKAGE_ADDED broadcast before updating widgets.