summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AllAppsPagedView.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-04-06 14:22:04 -0700
committerWinson Chung <winsonc@google.com>2011-04-07 11:21:02 -0700
commit20f7111c73692e397d2aae746c9bdf9aec8711da (patch)
treefe8d5001a46f11c7a9d5596a5bb9250458bac62e /src/com/android/launcher2/AllAppsPagedView.java
parentd92e741ca67c58c4be01a64940847feafe26a4b1 (diff)
downloadandroid_packages_apps_Trebuchet-20f7111c73692e397d2aae746c9bdf9aec8711da.tar.gz
android_packages_apps_Trebuchet-20f7111c73692e397d2aae746c9bdf9aec8711da.tar.bz2
android_packages_apps_Trebuchet-20f7111c73692e397d2aae746c9bdf9aec8711da.zip
Making mini workspaces disappear if drag from AllApps fails.
Change-Id: Ia02e441d48a041e336b64190d7813f6b35d6dd94
Diffstat (limited to 'src/com/android/launcher2/AllAppsPagedView.java')
-rw-r--r--src/com/android/launcher2/AllAppsPagedView.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java
index 3924c5752..c05fe75d5 100644
--- a/src/com/android/launcher2/AllAppsPagedView.java
+++ b/src/com/android/launcher2/AllAppsPagedView.java
@@ -66,6 +66,7 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
private boolean mAllowHardwareLayerCreation;
private int mPageContentWidth;
+ private boolean mHasMadeSuccessfulDrop;
public AllAppsPagedView(Context context) {
this(context, null);
@@ -138,6 +139,10 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
}
}
+ void resetSuccessfulDropFlag() {
+ mHasMadeSuccessfulDrop = false;
+ }
+
@Override
public void zoom(float zoom, boolean animate) {
mZoom = zoom;
@@ -322,6 +327,12 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
tearDownDragMode();
mLauncher.getWorkspace().onDragStopped(success);
mLauncher.unlockScreenOrientation();
+
+ if (!success && !mHasMadeSuccessfulDrop) {
+ mLauncher.getWorkspace().shrink(Workspace.ShrinkState.BOTTOM_HIDDEN);
+ } else {
+ mHasMadeSuccessfulDrop |= success;
+ }
}
int getPageContentWidth() {