mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Loading high resolution icons for first 3 items in a folder
> Sometimes a folder gets rearranged, without updating the model, like when an app in uninstalled. In that case, we need to update the icons for folder items, which were previously hidden Bug: 22813360 Change-Id: I99754911c969bf2153efb2948c226c1c69219b88
This commit is contained in:
@@ -2303,6 +2303,21 @@ public class LauncherModel extends BroadcastReceiver
|
||||
}
|
||||
}
|
||||
|
||||
// Sort all the folder items and make sure the first 3 items are high resolution.
|
||||
for (FolderInfo folder : sBgFolders) {
|
||||
Collections.sort(folder.contents, Folder.ITEM_POS_COMPARATOR);
|
||||
int pos = 0;
|
||||
for (ShortcutInfo info : folder.contents) {
|
||||
if (info.usingLowResIcon) {
|
||||
info.updateIcon(mIconCache, false);
|
||||
}
|
||||
pos ++;
|
||||
if (pos >= FolderIcon.NUM_ITEMS_IN_PREVIEW) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (restoredRows.size() > 0) {
|
||||
// Update restored items that no longer require special handling
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
Reference in New Issue
Block a user