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

Commit 31492bd5 authored by Nader Jawad's avatar Nader Jawad Committed by Android (Google) Code Review
Browse files

Merge "Updated GradientDrawable setColor(ColorStateList) implementation to...

Merge "Updated GradientDrawable setColor(ColorStateList) implementation to match corresponding documentation to fall back to setColor(Color.TRANSPARENT) in the event that null is passed as the ColorStateList parameter"
parents fdb7ef65 14516dba
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -930,17 +930,16 @@ public class GradientDrawable extends Drawable {
     * @see #getColor
     */
    public void setColor(@Nullable ColorStateList colorStateList) {
        mGradientState.setSolidColors(colorStateList);
        final int color;
        if (colorStateList == null) {
            color = Color.TRANSPARENT;
            setColor(Color.TRANSPARENT);
        } else {
            final int[] stateSet = getState();
            color = colorStateList.getColorForState(stateSet, 0);
        }
            final int color = colorStateList.getColorForState(stateSet, 0);
            mGradientState.setSolidColors(colorStateList);
            mFillPaint.setColor(color);
            invalidateSelf();
        }
    }

    /**
     * Returns the color state list used to fill the shape, or {@code null} if