Loading iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java +15 −1 Original line number Diff line number Diff line Loading @@ -212,7 +212,8 @@ public class BaseIconFactory implements AutoCloseable { boolean shrinkNonAdaptiveIcons = options == null || options.mShrinkNonAdaptiveIcons; float[] scale = new float[1]; icon = normalizeAndWrapToAdaptiveIcon(icon, shrinkNonAdaptiveIcons, null, scale); Bitmap bitmap = createIconBitmap(icon, scale[0], MODE_WITH_SHADOW); Bitmap bitmap = createIconBitmap(icon, scale[0], options == null ? MODE_WITH_SHADOW : options.mGenerationMode); int color = (options != null && options.mExtractedColor != null) ? options.mExtractedColor : mColorExtractor.findDominantColorByHue(bitmap); Loading Loading @@ -463,6 +464,9 @@ public class BaseIconFactory implements AutoCloseable { boolean mIsInstantApp; @BitmapGenerationMode int mGenerationMode = MODE_WITH_SHADOW; @Nullable UserHandle mUserHandle; @ColorInt Loading Loading @@ -503,6 +507,16 @@ public class BaseIconFactory implements AutoCloseable { mExtractedColor = color; return this; } /** * Sets the bitmap generation mode to use for the bitmap info. Note that some generation * modes do not support color extraction, so consider setting a extracted color manually * in those cases. */ public IconOptions setBitmapGenerationMode(@BitmapGenerationMode int generationMode) { mGenerationMode = generationMode; return this; } } /** Loading Loading
iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java +15 −1 Original line number Diff line number Diff line Loading @@ -212,7 +212,8 @@ public class BaseIconFactory implements AutoCloseable { boolean shrinkNonAdaptiveIcons = options == null || options.mShrinkNonAdaptiveIcons; float[] scale = new float[1]; icon = normalizeAndWrapToAdaptiveIcon(icon, shrinkNonAdaptiveIcons, null, scale); Bitmap bitmap = createIconBitmap(icon, scale[0], MODE_WITH_SHADOW); Bitmap bitmap = createIconBitmap(icon, scale[0], options == null ? MODE_WITH_SHADOW : options.mGenerationMode); int color = (options != null && options.mExtractedColor != null) ? options.mExtractedColor : mColorExtractor.findDominantColorByHue(bitmap); Loading Loading @@ -463,6 +464,9 @@ public class BaseIconFactory implements AutoCloseable { boolean mIsInstantApp; @BitmapGenerationMode int mGenerationMode = MODE_WITH_SHADOW; @Nullable UserHandle mUserHandle; @ColorInt Loading Loading @@ -503,6 +507,16 @@ public class BaseIconFactory implements AutoCloseable { mExtractedColor = color; return this; } /** * Sets the bitmap generation mode to use for the bitmap info. Note that some generation * modes do not support color extraction, so consider setting a extracted color manually * in those cases. */ public IconOptions setBitmapGenerationMode(@BitmapGenerationMode int generationMode) { mGenerationMode = generationMode; return this; } } /** Loading