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

Commit 49df5e5a authored by Luca Zuccarini's avatar Luca Zuccarini Committed by Android (Google) Code Review
Browse files

Merge "Update the gradient search to go deeper down the tree of drawables." into main

parents 7a92cfa3 23e5b918
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -353,7 +353,7 @@ constructor(

        /**
         * Return the first [GradientDrawable] found in [drawable], or null if none is found. If
         * [drawable] is a [LayerDrawable], this will return the first layer that is a
         * [drawable] is a [LayerDrawable], this will return the first layer that has a
         * [GradientDrawable].
         */
        fun findGradientDrawable(drawable: Drawable): GradientDrawable? {
@@ -367,8 +367,8 @@ constructor(

            if (drawable is LayerDrawable) {
                for (i in 0 until drawable.numberOfLayers) {
                    val maybeGradient = drawable.getDrawable(i)
                    if (maybeGradient is GradientDrawable) {
                    val maybeGradient = findGradientDrawable(drawable.getDrawable(i))
                    if (maybeGradient != null) {
                        return maybeGradient
                    }
                }