Merge "Set visibility when alpha == viewAlpha." into tm-qpr-dev am: b3e15776d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18768181 Change-Id: Iee9f08a92518acf939e80014e3dbb42499aff566 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -43,9 +43,17 @@ public class AnimatedPropertySetter extends PropertySetter {
|
||||
|
||||
@Override
|
||||
public Animator setViewAlpha(View view, float alpha, TimeInterpolator interpolator) {
|
||||
if (view == null || view.getAlpha() == alpha) {
|
||||
if (view == null) {
|
||||
return NO_OP;
|
||||
}
|
||||
|
||||
// Short-circuit if the view already has this alpha value, but make sure the visibility is
|
||||
// set correctly for the requested alpha.
|
||||
if (Float.compare(view.getAlpha(), alpha) == 0) {
|
||||
AlphaUpdateListener.updateVisibility(view);
|
||||
return NO_OP;
|
||||
}
|
||||
|
||||
ObjectAnimator anim = ObjectAnimator.ofFloat(view, View.ALPHA, alpha);
|
||||
anim.addListener(new AlphaUpdateListener(view));
|
||||
anim.setInterpolator(interpolator);
|
||||
|
||||
Reference in New Issue
Block a user