Skip to content

Commit

Permalink
Extract round icon for every app
Browse files Browse the repository at this point in the history
  • Loading branch information
amirzaidi committed Feb 26, 2018
1 parent 3a8b1d7 commit 00c35e9
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/com/google/android/apps/nexuslauncher/CustomIconProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,10 @@ public Drawable getIcon(LauncherActivityInfo launcherActivityInfo, int iconDpi,
}
}

if (drawable == null) {
drawable = super.getIcon(launcherActivityInfo, iconDpi, flattenDrawable);
if ((!Utilities.ATLEAST_OREO || !(drawable instanceof AdaptiveIconDrawable)) &&
!"com.google.android.calendar".equals(packageName)) {
Drawable roundIcon = getRoundIcon(packageName, iconDpi);
if (roundIcon != null) {
drawable = roundIcon;
}
}
if (drawable == null && !"com.google.android.calendar".equals(packageName)) {
drawable = getRoundIcon(packageName, iconDpi);
}
return drawable;
return drawable == null ? super.getIcon(launcherActivityInfo, iconDpi, flattenDrawable) : drawable;
}

private Drawable getRoundIcon(String packageName, int iconDpi) {
Expand Down

0 comments on commit 00c35e9

Please sign in to comment.