From 20f7111c73692e397d2aae746c9bdf9aec8711da Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 6 Apr 2011 14:22:04 -0700 Subject: Making mini workspaces disappear if drag from AllApps fails. Change-Id: Ia02e441d48a041e336b64190d7813f6b35d6dd94 --- src/com/android/launcher2/AllAppsPagedView.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/com/android/launcher2/AllAppsPagedView.java') 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() { -- cgit v1.2.3