OSDN Git Service

Fix issue where empty page doesn't get deleted when flinging to delete a widget in...
authorAdam Cohen <adamcohen@google.com>
Wed, 23 Oct 2013 23:11:50 +0000 (16:11 -0700)
committerAdam Cohen <adamcohen@google.com>
Wed, 23 Oct 2013 23:15:33 +0000 (16:15 -0700)
Change-Id: I59a78a4b9135b2c96f0adb4a2e63b19d504706b7

src/com/android/launcher3/AppsCustomizePagedView.java

index 0d806bc..175d5f8 100644 (file)
@@ -811,9 +811,16 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
                 !(target instanceof DeleteDropTarget))) {
             // Exit spring loaded mode if we have not successfully dropped or have not handled the
             // drop in Workspace
-            mLauncher.exitSpringLoadedDragMode();
+            mLauncher.getWorkspace().removeExtraEmptyScreen(true, new Runnable() {
+                @Override
+                public void run() {
+                    mLauncher.exitSpringLoadedDragMode();
+                    mLauncher.unlockScreenOrientation(false);
+                }
+            });
+        } else {
+            mLauncher.unlockScreenOrientation(false);
         }
-        mLauncher.unlockScreenOrientation(false);
     }
 
     @Override