From 6f4fcdc4e6a138ec0733e0d37c05afeb2e96dcbc Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Thu, 11 Feb 2016 18:07:43 -0800 Subject: [PATCH] Fixed a transformation error when fading in views Views could still be stuck in a old translation and therefore the whole view looked weird. Change-Id: I48a8f8824d8e5bdb0913a24783967a36c34797a8 --- .../statusbar/notification/TransformState.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java index 5832d86628afb..67d31be7f5115 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java @@ -293,14 +293,19 @@ public class TransformState { mTransformedView.setVisibility(visible ? View.VISIBLE : View.INVISIBLE); mTransformedView.setAlpha(visible ? 1.0f : 0.0f); if (visible) { - mTransformedView.setTranslationX(0); - mTransformedView.setTranslationY(0); - mTransformedView.setScaleX(1.0f); - mTransformedView.setScaleY(1.0f); + resetTransformedView(); } } public void prepareFadeIn() { + resetTransformedView(); + } + + private void resetTransformedView() { + mTransformedView.setTranslationX(0); + mTransformedView.setTranslationY(0); + mTransformedView.setScaleX(1.0f); + mTransformedView.setScaleY(1.0f); } public static TransformState obtain() {