Fixing issues with spring loaded adding.
- Delaying until items are added
- Showing bg when going into spring loaded mode
- Fixing regression where dropping widgets on full page would not trigger a notification
- Fixing regression on tablet where pages were no longer being rotated or shown
Change-Id: Iadc0c406f0c065c5029addea1abfee395eed81b9
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 33472ea..f5874bf 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -472,9 +472,13 @@
}
return true;
}
- private void endDragging(boolean success) {
+ private void endDragging(View target, boolean success) {
mLauncher.getWorkspace().onDragStopped(success);
- mLauncher.exitSpringLoadedDragMode();
+ if (!success || target != mLauncher.getWorkspace()) {
+ // Exit spring loaded mode if we have not successfully dropped or have not handled the
+ // drop in Workspace
+ mLauncher.exitSpringLoadedDragMode();
+ }
mLauncher.unlockScreenOrientation();
}
@@ -486,7 +490,7 @@
public void onDragViewVisible() {}
@Override
public void onDropCompleted(View target, DragObject d, boolean success) {
- endDragging(success);
+ endDragging(target, success);
// Display an error message if the drag failed due to there not being enough space on the
// target layout we were dropping on.