Dominant color is part of icon cache

> Calculating extracted color during icon generation and storing it in model and DB
> Removing unused logic avoid various types of badge rendering
> Icons are badged with extracted colors, while folder is badged with theme color

Bug: 35428783
Change-Id: I93e30c52fbded7515c3ae1778422e84672eafb56
This commit is contained in:
Sunny Goyal
2017-12-19 16:49:24 -08:00
parent 8c3c9d2634
commit 179249d804
37 changed files with 392 additions and 533 deletions

View File

@@ -29,6 +29,7 @@ import com.android.launcher3.shortcuts.ShortcutInfoCompat;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.MultiHashMap;
import com.android.launcher3.util.Provider;
import java.util.ArrayList;
import java.util.HashSet;
@@ -92,8 +93,10 @@ public class ShortcutsChangedTask extends BaseModelUpdateTask {
}
for (final ShortcutInfo shortcutInfo : shortcutInfos) {
shortcutInfo.updateFromDeepShortcutInfo(fullDetails, context);
shortcutInfo.iconBitmap = LauncherIcons.createShortcutIcon(fullDetails, context,
shortcutInfo.iconBitmap);
// If the shortcut is pinned but no longer has an icon in the system,
// keep the current icon instead of reverting to the default icon.
LauncherIcons.createShortcutIcon(fullDetails, context, true,
Provider.of(shortcutInfo.iconBitmap)).applyTo(shortcutInfo);
updatedShortcutInfos.add(shortcutInfo);
}
}