From be86a05af3caf5ef4ffbdae2b5abe03c40f4bb5a Mon Sep 17 00:00:00 2001 From: Josh Tsuji Date: Mon, 6 Jun 2022 17:20:39 -0400 Subject: [PATCH] Set visibility when alpha == viewAlpha. Fixes: 232993553 Test: manually prevent all apps from going away on screen off, then unlock to it and swipe up Change-Id: If2f30de9940c158b74064b3b935e38abdb8aab5f --- .../android/launcher3/anim/AnimatedPropertySetter.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/anim/AnimatedPropertySetter.java b/src/com/android/launcher3/anim/AnimatedPropertySetter.java index e5f5e7c44b..01301f2b57 100644 --- a/src/com/android/launcher3/anim/AnimatedPropertySetter.java +++ b/src/com/android/launcher3/anim/AnimatedPropertySetter.java @@ -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);