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

Commit 8181201c authored by Gilles Debunne's avatar Gilles Debunne Committed by Android (Google) Code Review
Browse files

Merge "Invalidate display list on alpha change"

parents d6049d48 5e78d9be
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -4637,6 +4637,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        // Alpha is supported if and only if the drawing can be done in one pass.
        // TODO text with spans with a background color currently do not respect this alpha.
        if (getBackground() == null) {
            if (mCurrentAlpha != alpha) {
                mCurrentAlpha = alpha;
                final Drawables dr = mDrawables;
                if (dr != null) {
@@ -4647,9 +4648,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    if (dr.mDrawableStart != null) dr.mDrawableStart.mutate().setAlpha(alpha);
                    if (dr.mDrawableEnd != null) dr.mDrawableEnd.mutate().setAlpha(alpha);
                }
                mTextDisplayListIsValid = false;
            }
            return true;
        }

        if (mCurrentAlpha != 255) {
            mTextDisplayListIsValid = false;
        }
        mCurrentAlpha = 255;
        return false;
    }