mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Separating methods for updating the model to a sepatate class.
Removing static access to model update methods, to allow for better access control and testing Change-Id: I9afe004dbf1b2fe50df422fd28bceea9230a4704
This commit is contained in:
@@ -2652,8 +2652,8 @@ public class Workspace extends PagedView
|
||||
}
|
||||
}
|
||||
|
||||
LauncherModel.modifyItemInDatabase(mLauncher, info, container, screenId, lp.cellX,
|
||||
lp.cellY, item.spanX, item.spanY);
|
||||
mLauncher.getModelWriter().modifyItemInDatabase(info, container, screenId,
|
||||
lp.cellX, lp.cellY, item.spanX, item.spanY);
|
||||
} else {
|
||||
if (!returnToOriginalCellToPreventShuffling) {
|
||||
onNoCellFound(dropTargetLayout);
|
||||
@@ -3385,7 +3385,7 @@ public class Workspace extends PagedView
|
||||
}
|
||||
// Add the item to DB before adding to screen ensures that the container and other
|
||||
// values of the info is properly updated.
|
||||
LauncherModel.addOrMoveItemInDatabase(mLauncher, info, container, screenId,
|
||||
mLauncher.getModelWriter().addOrMoveItemInDatabase(info, container, screenId,
|
||||
mTargetCell[0], mTargetCell[1]);
|
||||
|
||||
addInScreen(view, container, screenId, mTargetCell[0], mTargetCell[1],
|
||||
@@ -4003,7 +4003,7 @@ public class Workspace extends PagedView
|
||||
HashSet<String> packages = new HashSet<>(1);
|
||||
packages.add(packageName);
|
||||
ItemInfoMatcher matcher = ItemInfoMatcher.ofPackages(packages, user);
|
||||
LauncherModel.deleteItemsFromDatabase(mLauncher, matcher);
|
||||
mLauncher.getModelWriter().deleteItemsFromDatabase(matcher);
|
||||
removeItemsByMatcher(matcher);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user