Loading core/java/android/view/View.java +23 −17 Original line number Original line Diff line number Diff line Loading @@ -7597,6 +7597,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal */ */ public void setAlpha(float alpha) { public void setAlpha(float alpha) { ensureTransformationInfo(); ensureTransformationInfo(); if (mTransformationInfo.mAlpha != alpha) { mTransformationInfo.mAlpha = alpha; mTransformationInfo.mAlpha = alpha; invalidateParentCaches(); invalidateParentCaches(); if (onSetAlpha((int) (alpha * 255))) { if (onSetAlpha((int) (alpha * 255))) { Loading @@ -7608,6 +7609,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal invalidate(false); invalidate(false); } } } } } /** /** * Faster version of setAlpha() which performs the same steps except there are * Faster version of setAlpha() which performs the same steps except there are Loading @@ -7616,18 +7618,22 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * alpha (the return value for onSetAlpha()). * alpha (the return value for onSetAlpha()). * * * @param alpha The new value for the alpha property * @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) { boolean setAlphaNoInvalidation(float alpha) { ensureTransformationInfo(); ensureTransformationInfo(); if (mTransformationInfo.mAlpha != alpha) { mTransformationInfo.mAlpha = alpha; mTransformationInfo.mAlpha = alpha; boolean subclassHandlesAlpha = onSetAlpha((int) (alpha * 255)); boolean subclassHandlesAlpha = onSetAlpha((int) (alpha * 255)); if (subclassHandlesAlpha) { if (subclassHandlesAlpha) { mPrivateFlags |= ALPHA_SET; mPrivateFlags |= ALPHA_SET; return true; } else { } else { mPrivateFlags &= ~ALPHA_SET; mPrivateFlags &= ~ALPHA_SET; } } return subclassHandlesAlpha; } return false; } } /** /** Loading Loading
core/java/android/view/View.java +23 −17 Original line number Original line Diff line number Diff line Loading @@ -7597,6 +7597,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal */ */ public void setAlpha(float alpha) { public void setAlpha(float alpha) { ensureTransformationInfo(); ensureTransformationInfo(); if (mTransformationInfo.mAlpha != alpha) { mTransformationInfo.mAlpha = alpha; mTransformationInfo.mAlpha = alpha; invalidateParentCaches(); invalidateParentCaches(); if (onSetAlpha((int) (alpha * 255))) { if (onSetAlpha((int) (alpha * 255))) { Loading @@ -7608,6 +7609,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal invalidate(false); invalidate(false); } } } } } /** /** * Faster version of setAlpha() which performs the same steps except there are * Faster version of setAlpha() which performs the same steps except there are Loading @@ -7616,18 +7618,22 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * alpha (the return value for onSetAlpha()). * alpha (the return value for onSetAlpha()). * * * @param alpha The new value for the alpha property * @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) { boolean setAlphaNoInvalidation(float alpha) { ensureTransformationInfo(); ensureTransformationInfo(); if (mTransformationInfo.mAlpha != alpha) { mTransformationInfo.mAlpha = alpha; mTransformationInfo.mAlpha = alpha; boolean subclassHandlesAlpha = onSetAlpha((int) (alpha * 255)); boolean subclassHandlesAlpha = onSetAlpha((int) (alpha * 255)); if (subclassHandlesAlpha) { if (subclassHandlesAlpha) { mPrivateFlags |= ALPHA_SET; mPrivateFlags |= ALPHA_SET; return true; } else { } else { mPrivateFlags &= ~ALPHA_SET; mPrivateFlags &= ~ALPHA_SET; } } return subclassHandlesAlpha; } return false; } } /** /** Loading