From 19328fab0e7d1509c4c2f9276900dbd87bce81ea Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Sun, 3 Aug 2014 11:47:35 -0400 Subject: QS: Fix detail clip reverse transition. Give it a layer during the transition to workaround a recent regression in the clip animation. Also: - Dial down the transition alpha a bit - Do a delayed reverse transition on exit Change-Id: I622d6eb863d6186293b0126dda8fca3a04a80a85 --- .../src/com/android/systemui/qs/QSDetailClipper.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'packages/SystemUI/src') diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java b/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java index c0daf72..9c1ff9d 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java @@ -51,16 +51,27 @@ public class QSDetailClipper { if (listener != null) { mAnimator.addListener(listener); } + mDetail.setLayerType(View.LAYER_TYPE_HARDWARE, null); if (in) { mBackground.startTransition((int)(mAnimator.getDuration() * 0.6)); mAnimator.addListener(mVisibleOnStart); mAnimator.start(); } else { + mDetail.postDelayed(mReverseBackground, (long)(mAnimator.getDuration() * 0.65)); mAnimator.addListener(mGoneOnEnd); mAnimator.reverse(); } } + private final Runnable mReverseBackground = new Runnable() { + @Override + public void run() { + if (mAnimator != null) { + mBackground.reverseTransition((int)(mAnimator.getDuration() * 0.35)); + } + } + }; + private final AnimatorListenerAdapter mVisibleOnStart = new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { @@ -68,6 +79,7 @@ public class QSDetailClipper { } public void onAnimationEnd(Animator animation) { + mDetail.setLayerType(View.LAYER_TYPE_NONE, null); mAnimator = null; } }; @@ -75,6 +87,7 @@ public class QSDetailClipper { private final AnimatorListenerAdapter mGoneOnEnd = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { + mDetail.setLayerType(View.LAYER_TYPE_NONE, null); mDetail.setVisibility(View.GONE); mBackground.resetTransition(); mAnimator = null; -- cgit v1.1