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

Commit ca4060ec authored by Sunny Goyal's avatar Sunny Goyal Committed by Android Build Coastguard Worker
Browse files

Revert "Changing BaseIconFactory to kotlin"

Revert submission 34290070-icon-factory-in-kotlin

Reason for revert: b/427109551

Reverted changes: /q/submissionid:34290070-icon-factory-in-kotlin
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:45c651bd2c1416078e050d0e04776b67b976a498)
Merged-In: I2ebdb8230558f3c05d1c4ec09f204fc118c199eb
Change-Id: I2ebdb8230558f3c05d1c4ec09f204fc118c199eb
parent beb68008
Loading
Loading
Loading
Loading
+760 −0

File added.

Preview size limit exceeded, changes collapsed.

+0 −521

File deleted.

Preview size limit exceeded, changes collapsed.

+3 −0
Original line number Diff line number Diff line
@@ -71,6 +71,9 @@ 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()

+5 −7
Original line number Diff line number Diff line
@@ -74,13 +74,11 @@ 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[0] = IconNormalizer.ICON_VISIBLE_AREA_FACTOR;
        if (outScale == null) {
            outScale = new float[1];
        }
        return createIconBitmap(
                wrapToAdaptiveIcon(icon),
                IconNormalizer.ICON_VISIBLE_AREA_FACTOR,
                MODE_WITH_SHADOW);
        icon = normalizeAndWrapToAdaptiveIcon(icon, outScale);
        return createIconBitmap(icon, outScale[0], MODE_WITH_SHADOW, mDrawFullBleedIcons);
    }

    /**
@@ -97,7 +95,7 @@ public class BubbleIconFactory extends BaseIconFactory {
            userBadgedAppIcon = new CircularRingDrawable(userBadgedAppIcon);
        }
        Bitmap userBadgedBitmap = mBadgeFactory.createIconBitmap(
                userBadgedAppIcon, 1, MODE_WITH_SHADOW);
                userBadgedAppIcon, 1, MODE_WITH_SHADOW, mDrawFullBleedIcons);
        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.Companion.MODE_ALPHA
import com.android.launcher3.icons.BaseIconFactory.MODE_ALPHA
import com.android.launcher3.icons.BitmapInfo
import com.android.launcher3.icons.ClockDrawableWrapper.ClockAnimationInfo
import com.android.launcher3.icons.IconThemeController