mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Fix bug where item was not moved in database when added to a Folder.
I thought calling arrangeChildren(saveChanges=true) would handle this case, but because we set the position and rank in addViewForRank, arrangeChildren does not see any changes to save. Change-Id: Iab0fefe6da7711857ea05955a3243459f4e8527b
This commit is contained in:
@@ -1437,6 +1437,9 @@ public class Folder extends AbstractFloatingView implements DragSource, View.OnC
|
||||
@Override
|
||||
public void onAdd(ShortcutInfo item, int rank) {
|
||||
View view = mContent.createAndAddViewForRank(item, rank);
|
||||
mLauncher.getModelWriter().addOrMoveItemInDatabase(item, mInfo.id, 0, item.cellX,
|
||||
item.cellY);
|
||||
|
||||
ArrayList<View> items = new ArrayList<>(getItemsInReadingOrder());
|
||||
items.add(rank, view);
|
||||
mContent.arrangeChildren(items, items.size());
|
||||
|
||||
Reference in New Issue
Block a user