mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:38:21 +00:00
Fixing shortcut icons are not getting correct color extraction.
> Avoiding color extraction for icons which have already be evaluated > Fixing color extraction from hardware bitmaps Bug: 111343544 Change-Id: I624866e892465684871fbc130003e32945d86460
This commit is contained in:
@@ -43,6 +43,7 @@ import android.util.MutableInt;
|
||||
import com.android.launcher3.AllAppsList;
|
||||
import com.android.launcher3.AppInfo;
|
||||
import com.android.launcher3.FolderInfo;
|
||||
import com.android.launcher3.ItemInfoWithIcon;
|
||||
import com.android.launcher3.icons.ComponentWithLabel;
|
||||
import com.android.launcher3.icons.ComponentWithLabel.ComponentCachingLogic;
|
||||
import com.android.launcher3.icons.cache.IconCacheUpdateHandler;
|
||||
@@ -493,12 +494,12 @@ public class LoaderTask implements Runnable {
|
||||
}
|
||||
info = new ShortcutInfo(pinnedShortcut, context);
|
||||
final ShortcutInfo finalInfo = info;
|
||||
// If the pinned deep shortcut is no longer published,
|
||||
// use the last saved icon instead of the default.
|
||||
Provider<Bitmap> fallbackIconProvider = () ->
|
||||
c.loadIcon(finalInfo) ? finalInfo.iconBitmap : null;
|
||||
|
||||
LauncherIcons li = LauncherIcons.obtain(context);
|
||||
// If the pinned deep shortcut is no longer published,
|
||||
// use the last saved icon instead of the default.
|
||||
Provider<ItemInfoWithIcon> fallbackIconProvider = () ->
|
||||
c.loadIcon(finalInfo, li) ? finalInfo : null;
|
||||
info.applyFrom(li.createShortcutIcon(pinnedShortcut,
|
||||
true /* badged */, fallbackIconProvider));
|
||||
li.recycle();
|
||||
|
||||
Reference in New Issue
Block a user