mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 02:38:20 +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:
@@ -95,7 +95,9 @@ public class AddWorkspaceItemsTask extends ExtendedModelTask {
|
||||
}
|
||||
|
||||
// Add the shortcut to the db
|
||||
addItemToDatabase(context, itemInfo, screenId, cordinates);
|
||||
getModelWriter().addItemToDatabase(itemInfo,
|
||||
LauncherSettings.Favorites.CONTAINER_DESKTOP, screenId,
|
||||
cordinates[0], cordinates[1]);
|
||||
|
||||
// Save the ShortcutInfo for binding in the workspace
|
||||
addedItemsFinal.add(itemInfo);
|
||||
@@ -129,11 +131,6 @@ public class AddWorkspaceItemsTask extends ExtendedModelTask {
|
||||
}
|
||||
}
|
||||
|
||||
protected void addItemToDatabase(Context context, ItemInfo item, long screenId, int[] pos) {
|
||||
LauncherModel.addItemToDatabase(context, item,
|
||||
LauncherSettings.Favorites.CONTAINER_DESKTOP, screenId, pos[0], pos[1]);
|
||||
}
|
||||
|
||||
protected void updateScreens(Context context, ArrayList<Long> workspaceScreens) {
|
||||
LauncherModel.updateWorkspaceScreenOrder(context, workspaceScreens);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user