From e8f1d047b1b788bc9884be2417e7aa0cec7e8ae8 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 31 Jul 2015 12:39:57 -0700 Subject: [PATCH] Fixing issue with flash during overview transition. - This is due to the TransitionDrawable which does not actually start an animation until it is first drawn. This workaround will just immediately reset the transition if it is not currently visible instead of animating (which is actually deferred until the next animation into overview mode). Bug: 22414257 Change-Id: Id481303d0c99a20c1d16396c024ab50303f45576 --- src/com/android/launcher3/CellLayout.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 8096887128..b875d22e62 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -211,6 +211,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { mBackground = (TransitionDrawable) res.getDrawable(R.drawable.bg_screenpanel); mBackground.setCallback(this); + mBackground.setAlpha((int) (mBackgroundAlpha * 255)); mReorderPreviewAnimationMagnitude = (REORDER_PREVIEW_MAGNITUDE * grid.iconSizePx); @@ -414,7 +415,11 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { if (mIsDragOverlapping) { mBackground.startTransition(BACKGROUND_ACTIVATE_DURATION); } else { - mBackground.reverseTransition(BACKGROUND_ACTIVATE_DURATION); + if (mBackgroundAlpha > 0f) { + mBackground.reverseTransition(BACKGROUND_ACTIVATE_DURATION); + } else { + mBackground.resetTransition(); + } } invalidate(); }