Loading iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java +11 −3 Original line number Diff line number Diff line Loading @@ -324,11 +324,19 @@ public class BaseIconFactory implements AutoCloseable { if (!outShape[0]) { FixedScaleDrawable fsd = ((FixedScaleDrawable) dr.getForeground()); fsd.setDrawable(icon); int color; if (icon.getIntrinsicHeight() > 0 && icon.getIntrinsicWidth() > 0) { Bitmap bitmap = AdaptiveIconGenerator.toBitmap(icon); fsd.setScale(AdaptiveIconGenerator.getScale(bitmap, scale)); color = ColorUtils.setAlphaComponent(new ColorExtractor().findDominantColorByHue(bitmap), 200); } else { fsd.setScale(scale); color = mWrapperBackgroundColor; } icon = dr; scale = getNormalizer().getScale(icon, outIconBounds, null, null); int color = ColorUtils.setAlphaComponent(new ColorExtractor().findDominantColorByHue(bitmap), 200); ((ColorDrawable) dr.getBackground()).setColor(color); } } else { Loading Loading
iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java +11 −3 Original line number Diff line number Diff line Loading @@ -324,11 +324,19 @@ public class BaseIconFactory implements AutoCloseable { if (!outShape[0]) { FixedScaleDrawable fsd = ((FixedScaleDrawable) dr.getForeground()); fsd.setDrawable(icon); int color; if (icon.getIntrinsicHeight() > 0 && icon.getIntrinsicWidth() > 0) { Bitmap bitmap = AdaptiveIconGenerator.toBitmap(icon); fsd.setScale(AdaptiveIconGenerator.getScale(bitmap, scale)); color = ColorUtils.setAlphaComponent(new ColorExtractor().findDominantColorByHue(bitmap), 200); } else { fsd.setScale(scale); color = mWrapperBackgroundColor; } icon = dr; scale = getNormalizer().getScale(icon, outIconBounds, null, null); int color = ColorUtils.setAlphaComponent(new ColorExtractor().findDominantColorByHue(bitmap), 200); ((ColorDrawable) dr.getBackground()).setColor(color); } } else { Loading