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

Commit ca602c6d authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Changing BaseIconFactory to kotlin

Making various options immutable

Bug: 427523903
Test: Launcher screenshot tests
Flag: EXEMPT refactor
Change-Id: Ib293b0debe72f7ab49d481c6825bea497691ccda
parent 06ddd4db
Loading
Loading
Loading
Loading
+0 −760

File deleted.

Preview size limit exceeded, changes collapsed.

+521 −0

File added.

Preview size limit exceeded, changes collapsed.

+0 −3
Original line number Diff line number Diff line
@@ -71,9 +71,6 @@ data class BitmapInfo(
    fun withFlags(op: FlagOp): BitmapInfo =
        if (op === FlagOp.NO_OP) this else copy(flags = op.apply(this.flags))

    /** Helper class to allow copy from java code */
    fun withThemedBitmap(themedBitmap: ThemedBitmap?) = copy(themedBitmap = themedBitmap)

    val isLowRes: Boolean
        get() = matchingLookupFlag.useLowRes()

+7 −5
Original line number Diff line number Diff line
@@ -74,11 +74,13 @@ public class BubbleIconFactory extends BaseIconFactory {
     * drawing the actual drawable. This is used for the larger icon shown for the bubble.
     */
    public Bitmap getBubbleBitmap(@NonNull Drawable icon, float[] outScale) {
        if (outScale == null) {
            outScale = new float[1];
        if (outScale != null) {
            outScale[0] = IconNormalizer.ICON_VISIBLE_AREA_FACTOR;
        }
        icon = normalizeAndWrapToAdaptiveIcon(icon, outScale);
        return createIconBitmap(icon, outScale[0], MODE_WITH_SHADOW, mDrawFullBleedIcons);
        return createIconBitmap(
                wrapToAdaptiveIcon(icon),
                IconNormalizer.ICON_VISIBLE_AREA_FACTOR,
                MODE_WITH_SHADOW);
    }

    /**
@@ -95,7 +97,7 @@ public class BubbleIconFactory extends BaseIconFactory {
            userBadgedAppIcon = new CircularRingDrawable(userBadgedAppIcon);
        }
        Bitmap userBadgedBitmap = mBadgeFactory.createIconBitmap(
                userBadgedAppIcon, 1, MODE_WITH_SHADOW, mDrawFullBleedIcons);
                userBadgedAppIcon, 1, MODE_WITH_SHADOW);
        return mBadgeFactory.createIconBitmap(userBadgedBitmap);
    }

+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ import android.graphics.drawable.LayerDrawable
import android.os.Build
import com.android.launcher3.Flags
import com.android.launcher3.icons.BaseIconFactory
import com.android.launcher3.icons.BaseIconFactory.MODE_ALPHA
import com.android.launcher3.icons.BaseIconFactory.Companion.MODE_ALPHA
import com.android.launcher3.icons.BitmapInfo
import com.android.launcher3.icons.ClockDrawableWrapper.ClockAnimationInfo
import com.android.launcher3.icons.IconThemeController