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

Commit 527b0d11 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Disable surface effects when a theme controller doesn't support...

Merge "Disable surface effects when a theme controller doesn't support adaptive themed icons" into main
parents 9d933254 dfd6422d
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) :