From 2792a33ecc9b2def0cdd31756c45f5fe73cf13ac Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Mon, 26 Sep 2011 21:09:47 -0700 Subject: Addressing slow rotation due to folders (issue 5297213) Change-Id: I41e9594d547695bd6b37254396874fe1a9e7cf68 --- src/com/android/launcher2/Folder.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java index f44d3ed60..71b708128 100644 --- a/src/com/android/launcher2/Folder.java +++ b/src/com/android/launcher2/Folder.java @@ -817,12 +817,14 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList lp.cellX = vacant[0]; lp.cellY = vacant[1]; ItemInfo info = (ItemInfo) v.getTag(); - info.cellX = vacant[0]; - info.cellY = vacant[1]; + if (info.cellX != vacant[0] || info.cellY != vacant[1]) { + info.cellX = vacant[0]; + info.cellY = vacant[1]; + LauncherModel.addOrMoveItemInDatabase(mLauncher, info, mInfo.id, 0, + info.cellX, info.cellY); + } boolean insert = false; mContent.addViewToCellLayout(v, insert ? 0 : -1, (int)info.id, lp, true); - LauncherModel.addOrMoveItemInDatabase(mLauncher, info, mInfo.id, 0, - info.cellX, info.cellY); } mItemsInvalidated = true; } -- cgit v1.2.3