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

Commit a7a7eede authored by Michael Jurka's avatar Michael Jurka
Browse files

Check if View's alpha must be updated in setter

Change-Id: I91094b43dbacbd637e04ce4074d8df6a27ddf6fb
parent 6a78cd85
Loading
Loading
Loading
Loading
+23 −17
Original line number Diff line number Diff line
@@ -7597,6 +7597,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
     */
    public void setAlpha(float alpha) {
        ensureTransformationInfo();
        if (mTransformationInfo.mAlpha != alpha) {
            mTransformationInfo.mAlpha = alpha;
            invalidateParentCaches();
            if (onSetAlpha((int) (alpha * 255))) {
@@ -7608,6 +7609,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
                invalidate(false);
            }
        }
    }
    /**
     * Faster version of setAlpha() which performs the same steps except there are
@@ -7616,18 +7618,22 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
     * alpha (the return value for onSetAlpha()).
     *
     * @param alpha The new value for the alpha property
     * @return true if the View subclass handles alpha (the return value for onSetAlpha())
     * @return true if the View subclass handles alpha (the return value for onSetAlpha()) and
     *         the new value for the alpha property is different from the old value
     */
    boolean setAlphaNoInvalidation(float alpha) {
        ensureTransformationInfo();
        if (mTransformationInfo.mAlpha != alpha) {
            mTransformationInfo.mAlpha = alpha;
            boolean subclassHandlesAlpha = onSetAlpha((int) (alpha * 255));
            if (subclassHandlesAlpha) {
                mPrivateFlags |= ALPHA_SET;
                return true;
            } else {
                mPrivateFlags &= ~ALPHA_SET;
            }
        return subclassHandlesAlpha;
        }
        return false;
    }
    /**