Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 113d9fc3 authored by Charlie Anderson's avatar Charlie Anderson
Browse files

Adjusts installing app icon size to account for scaled shaped icons

Bug: 400774067
Bug: 398874274
Bug: 376904232
Flag: com.android.launcher3.enable_launcher_icon_shapes
Test: tested installing apps using different shapes
Change-Id: I6e21994bc9fd73522be058b0cf65439df5e8625e
parent 6195ebbb
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -193,10 +193,14 @@ public class BaseIconFactory implements AutoCloseable {
    @NonNull
    public AdaptiveIconDrawable createShapedAdaptiveIcon(Bitmap iconBitmap) {
        Drawable drawable = new FixedSizeBitmapDrawable(iconBitmap);
        float inset = getExtraInsetFraction();
        if (getIconScale() < 1f) {
            drawable = createScaledDrawable(drawable, 1 / getIconScale());
        }
        float inset = getExtraInsetFraction() * getIconScale();
        inset = inset / (1 + 2 * inset);
        return new AdaptiveIconDrawable(new ColorDrawable(Color.BLACK),
                new InsetDrawable(drawable, inset, inset, inset, inset));
        return new AdaptiveIconDrawable(new ColorDrawable(BLACK),
                new InsetDrawable(drawable, inset, inset, inset, inset)
        );
    }

    @NonNull