Fixing a couple bugs, allapps clicks and weird crash
-> issue 5021897 (when this was fixed, exposed more bugginess that is now fixed)
-> issue 5038392
Change-Id: I49a4e9fca154f75ea22ad2c462641747536102ce
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 96cd22b..d3b5d41 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -214,15 +214,13 @@
mEmptyCell[0] = item.cellX;
mEmptyCell[1] = item.cellY;
mCurrentDragView = v;
+
+ mContent.removeView(mCurrentDragView);
+ mInfo.remove(mCurrentDragInfo);
}
return true;
}
- public void onDragViewVisible() {
- mContent.removeView(mCurrentDragView);
- mInfo.remove(mCurrentDragInfo);
- }
-
public boolean isEditingName() {
return mIsEditingName;
}
@@ -890,7 +888,11 @@
si.cellX = lp.cellX = mEmptyCell[0];
si.cellX = lp.cellY = mEmptyCell[1];
mContent.addViewToCellLayout(mCurrentDragView, -1, (int)item.id, lp, true);
- mLauncher.getDragLayer().animateViewIntoPosition(d.dragView, mCurrentDragView);
+ if (d.dragView.hasDrawn()) {
+ mLauncher.getDragLayer().animateViewIntoPosition(d.dragView, mCurrentDragView);
+ } else {
+ mCurrentDragView.setVisibility(VISIBLE);
+ }
mItemsInvalidated = true;
setupContentDimension(getItemCount());
mSuppressOnAdd = true;