Skip to content

Commit

Permalink
PixelHome: Workaround the Icon pack issue on adaptive apps
Browse files Browse the repository at this point in the history
pixelhome: Fix that legacy mask :(

On the previous icon pack commit, there was an issue regarding icon packs and adaptive icons. When an app that got an icon targeted as SDK +26 (adaptive-ready) and got a custom icon from a icon pack, the icon would take the new icon as foreground and it'll take the generic white adaptive background. (see before photo to see it in action)
Now, with this commit, if the icon packs supports the respective icon, it'll apply just the icon image instead of doing that. It's not the best approach, but it's a quick workaround till there's a better method. (see after)

Also, disable the spring animation that would show the original icon

Change-Id: Ie639d056413a13897acd2dc1eeb6c5632a0aa645
Before: https://i.imgur.com/nlqBVlQ.png?1
After: https://i.imgur.com/HIkcg5D.png?1
  • Loading branch information
eldainosor authored and iamsj7 committed Feb 16, 2019
1 parent d19e74f commit 39cad64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/com/android/launcher3/IconCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,16 @@ private void updateDBIcons(UserHandle user, List<LauncherActivityInfo> apps,
LauncherIcons li = LauncherIcons.obtain(mContext);
Drawable iconDrawable = getFullResIcon(app);
IconPack iconPack = IconPackProvider.loadAndGetIconPack(mContext);
int iconAppSDK = app.getApplicationInfo().targetSdkVersion;
if (iconPack != null) {
Drawable iconPackDrawable = iconPack.getIcon(app, iconDrawable, app.getLabel());
if (iconPackDrawable != null) {
iconDrawable = iconPackDrawable;
iconAppSDK = 25;
}
}
li.createBadgedIconBitmap(iconDrawable, app.getUser(),
app.getApplicationInfo().targetSdkVersion).applyTo(entry);
iconAppSDK).applyTo(entry);
li.recycle();
}
entry.title = app.getLabel();
Expand Down Expand Up @@ -589,14 +591,16 @@ protected CacheEntry cacheLocked(
LauncherIcons li = LauncherIcons.obtain(mContext);
Drawable iconDrawable = getFullResIcon(info);
IconPack iconPack = IconPackProvider.loadAndGetIconPack(mContext);
int iconAppSDK = info.getApplicationInfo().targetSdkVersion;
if (iconPack != null) {
Drawable iconPackDrawable = iconPack.getIcon(info, iconDrawable, info.getLabel());
if (iconPackDrawable != null) {
iconDrawable = iconPackDrawable;
iconAppSDK = 25;
}
}
li.createBadgedIconBitmap(iconDrawable, info.getUser(),
info.getApplicationInfo().targetSdkVersion).applyTo(entry);
iconAppSDK).applyTo(entry);
li.recycle();
} else {
if (usePackageIcon) {
Expand Down
2 changes: 1 addition & 1 deletion src/com/android/launcher3/config/BaseFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ abstract class BaseFlags {
// When enabled the promise icon is visible in all apps while installation an app.
public static final boolean LAUNCHER3_PROMISE_APPS_IN_ALL_APPS = true;
// When enabled allows use of spring motions on the icons.
public static final boolean LAUNCHER3_SPRING_ICONS = true;
public static final boolean LAUNCHER3_SPRING_ICONS = false;

// Feature flag to enable moving the QSB on the 0th screen of the workspace.
public static final boolean QSB_ON_FIRST_SCREEN = true;
Expand Down

0 comments on commit 39cad64

Please sign in to comment.