diff options
| -rw-r--r-- | core/java/android/view/View.java | 2 | ||||
| -rw-r--r-- | core/java/android/view/ViewPropertyAnimator.java | 21 |
2 files changed, 4 insertions, 19 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index cafd3242a9c4..04ffa33d0e22 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -16195,7 +16195,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @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 */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123768435) boolean setAlphaNoInvalidation(float alpha) { ensureTransformationInfo(); if (mTransformationInfo.mAlpha != alpha) { diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java index a0ab362f3985..68c0d9ec465b 100644 --- a/core/java/android/view/ViewPropertyAnimator.java +++ b/core/java/android/view/ViewPropertyAnimator.java @@ -1139,12 +1139,6 @@ public class ViewPropertyAnimator { boolean hardwareAccelerated = mView.isHardwareAccelerated(); - // alpha requires slightly different treatment than the other (transform) properties. - // The logic in setAlpha() is not simply setting mAlpha, plus the invalidation - // logic is dependent on how the view handles an internal call to onSetAlpha(). - // We track what kinds of properties are set, and how alpha is handled when it is - // set, and perform the invalidation steps appropriately. - boolean alphaHandled = false; if (!hardwareAccelerated) { mView.invalidateParentCaches(); } @@ -1159,11 +1153,7 @@ public class ViewPropertyAnimator { for (int i = 0; i < count; ++i) { NameValuesHolder values = valueList.get(i); float value = values.mFromValue + fraction * values.mDeltaValue; - if (values.mNameConstant == ALPHA) { - alphaHandled = mView.setAlphaNoInvalidation(value); - } else { - setValue(values.mNameConstant, value); - } + setValue(values.mNameConstant, value); } } if ((propertyMask & TRANSFORM_MASK) != 0) { @@ -1171,13 +1161,8 @@ public class ViewPropertyAnimator { mView.mPrivateFlags |= View.PFLAG_DRAWN; // force another invalidation } } - // invalidate(false) in all cases except if alphaHandled gets set to true - // via the call to setAlphaNoInvalidation(), above - if (alphaHandled) { - mView.invalidate(true); - } else { - mView.invalidateViewProperty(false, false); - } + + mView.invalidateViewProperty(false, false); if (mUpdateListener != null) { mUpdateListener.onAnimationUpdate(animation); } |