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

Commit 3c1bde99 authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Always have the current iconShape in BaseIconFactory irrespective of...

Merge "Always have the current iconShape in BaseIconFactory irrespective of full-bleed setting." into main
parents 7b0d72ca c8e8d45d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -174,7 +174,11 @@ public class BaseIconFactory implements AutoCloseable {
                new ColorDrawable(PLACEHOLDER_BACKGROUND_COLOR),
                new CenterTextDrawable(placeholder, color));
        Bitmap icon = createIconBitmap(drawable, ICON_VISIBLE_AREA_FACTOR);
        return BitmapInfo.of(icon, color, getDefaultIconShape());
        BitmapInfo info = BitmapInfo.of(icon, color, getDefaultIconShape());
        if (mDrawFullBleedIcons) {
            info = info.withFlags(FlagOp.NO_OP.addFlag(FLAG_FULL_BLEED));
        }
        return info;
    }

    public BitmapInfo createIconBitmap(Bitmap icon) {
@@ -262,7 +266,6 @@ public class BaseIconFactory implements AutoCloseable {
     * Generates an IconShape based on the current bitmap size and default icon mask.
     */
    public IconShape getDefaultIconShape() {
        if (!mDrawFullBleedIcons) return IconShape.EMPTY;
        if (mDefaultIconShape != null) return mDefaultIconShape;
        AdaptiveIconDrawable tempAdaptiveIcon =
                new AdaptiveIconDrawable(new ColorDrawable(BLACK), null);
+2 −7
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.graphics.drawable.Drawable
import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes
import androidx.annotation.IntDef
import com.android.launcher3.icons.BitmapInfo.Companion.FLAG_THEMED
import com.android.launcher3.icons.FastBitmapDrawableDelegate.DelegateFactory
import com.android.launcher3.icons.FastBitmapDrawableDelegate.SimpleDelegateFactory
import com.android.launcher3.icons.PlaceHolderDrawableDelegate.PlaceHolderDelegateFactory
@@ -246,13 +247,7 @@ data class BitmapInfo(

        @JvmStatic
        fun of(bitmap: Bitmap, color: Int, defaultShape: IconShape = IconShape.EMPTY): BitmapInfo {
            val flags = if (defaultShape == IconShape.EMPTY) 0 else FLAG_FULL_BLEED
            return BitmapInfo(
                icon = bitmap,
                color = color,
                defaultIconShape = defaultShape,
                flags = flags,
            )
            return BitmapInfo(icon = bitmap, color = color, defaultIconShape = defaultShape)
        }
    }
}