Fix UI bugs when dragging items
- On large devices, snap to next screen when you drag an item to the next screen (matches behavior on phones)
- Do not fade out outlines of Workspace pages while using spring loaded mode
- Keep all icons on all pages opaque in spring loaded mode
- Optimize call to clear a CellLayout
Change-Id: Ia15e0e9da499d7835a77218985de47a1f195e4ef
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 9440b89..0a3c96d 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -661,8 +661,10 @@
@Override
public void removeAllViewsInLayout() {
- clearOccupiedCells();
- mChildren.removeAllViewsInLayout();
+ if (mChildren.getChildCount() > 0) {
+ clearOccupiedCells();
+ mChildren.removeAllViewsInLayout();
+ }
}
public void removeViewWithoutMarkingCells(View view) {