Make grid size migration less confusing for users.

Grid size migration is a confusing experience for users because the
content of the grid is not predicatable to the user. Part of the reason
was the dedupe logic which merges items from new grid into old grid,
this mean if user removes an item, change to another grid and go back,
user will see that same item re-appears.

This CL keeps the content of target grid the same as source gird, i.e
user will will get the exact same set of app icons/shortcuts/folders and
widgets (if size permits) across grid sizes. The only difference being
their placement in the grid.

Bug: 256859723
Test: atest GridSizeMigrationUtilTest
Change-Id: I1732c91e441ad44bc43e0a943566a83563d12b07
This commit is contained in:
Pinyao Ting
2022-11-21 15:50:30 -08:00
parent 691c6e511f
commit cc90d1b767
3 changed files with 290 additions and 44 deletions

View File

@@ -362,6 +362,12 @@ public class LauncherModelHelper {
sandboxContext.getContentResolver().insert(contentUri, values);
}
public void deleteItem(int itemId, @NonNull final String tableName) {
final Uri uri = Uri.parse("content://"
+ LauncherProvider.AUTHORITY + "/" + tableName + "/" + itemId);
sandboxContext.getContentResolver().delete(uri, null, null);
}
public int[][][] createGrid(int[][][] typeArray) {
return createGrid(typeArray, 1);
}