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

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

Disable surface effects when a theme controller doesn't support adaptive themed icons

Bug: 420985075
Bug: 415118235
Flag: com.android.launcher3.extendible_theme_manager
Test: Verified on device
Change-Id: Id8035e19f6e9a0a7d39e4296672993a5a0795c79
parent 4ebc0fd0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -60,6 +60,12 @@ interface IconThemeController {
        sourceHint: SourceHint,
    ): ThemedBitmap

    /**
     * Creates an adaptive icon representation of the themed bitmap for various surface effects. The
     * controller can return the [originalIcon] for using an un-themed icon for these effects or
     * null to disable any surface effects in which can the static themed icon will be used without
     * any additional effects.
     */
    fun createThemedAdaptiveIcon(
        context: Context,
        originalIcon: AdaptiveIconDrawable,
+2 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ class MonoIconThemeController(
        context: Context,
        originalIcon: AdaptiveIconDrawable,
        info: BitmapInfo?,
    ): AdaptiveIconDrawable? {
    ): AdaptiveIconDrawable {
        val colors = colorProvider(context)
        originalIcon.mutate()
        var monoDrawable = originalIcon.monochrome?.apply { setTint(colors[1]) }
@@ -146,6 +146,7 @@ class MonoIconThemeController(
        }

        return monoDrawable?.let { AdaptiveIconDrawable(ColorDrawable(colors[0]), it) }
            ?: originalIcon
    }

    class ClippedMonoDrawable(base: Drawable?, private val shapePath: Path) :