diff --git a/src/com/android/launcher3/views/AbstractSlideInView.java b/src/com/android/launcher3/views/AbstractSlideInView.java index 5ce455a115..85aad8982c 100644 --- a/src/com/android/launcher3/views/AbstractSlideInView.java +++ b/src/com/android/launcher3/views/AbstractSlideInView.java @@ -92,7 +92,7 @@ public abstract class AbstractSlideInView protected @NonNull AnimatorPlaybackController mOpenCloseAnimation; protected ViewGroup mContent; - protected final View mColorScrim; + protected final @Nullable View mColorScrim; /** * Interpolator for {@link #mOpenCloseAnimation} when we are closing due to dragging downwards. @@ -216,6 +216,9 @@ public abstract class AbstractSlideInView animation.addFloat( this, TRANSLATION_SHIFT, fromTranslationShift, toTranslationShift, LINEAR); + if (mColorScrim != null) { + animation.setViewAlpha(mColorScrim, 1 - toTranslationShift, getScrimInterpolator()); + } onOpenCloseAnimationPending(animation); mOpenCloseAnimation = animation.createPlaybackController(); @@ -254,9 +257,6 @@ public abstract class AbstractSlideInView protected void setTranslationShift(float translationShift) { mTranslationShift = translationShift; mContent.setTranslationY(mTranslationShift * getShiftRange()); - if (mColorScrim != null) { - mColorScrim.setAlpha(1 - mTranslationShift); - } invalidate(); } @@ -500,6 +500,10 @@ public abstract class AbstractSlideInView return Interpolators.ACCELERATE; } + protected Interpolator getScrimInterpolator() { + return LINEAR; + } + protected void onCloseComplete() { mIsOpen = false; getPopupContainer().removeView(this);