Fixed a crash when transforming
When transforming directly from a hybrid view into a bigtext,
the transformation could crash. This is now fixed.
Change-Id: Ie45c1feaf916c9aa584f1797b7fa0831fe757b9b
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationTemplateViewWrapper.java
index b060245..0c21f0b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationTemplateViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationTemplateViewWrapper.java
@@ -55,11 +55,12 @@
}
TransformState otherState = notification.getCurrentState(
TRANSFORMING_VIEW_TITLE);
- CrossFadeHelper.fadeOut(mText, endRunnable);
+ final View text = ownState.getTransformedView();
+ CrossFadeHelper.fadeOut(text, endRunnable);
if (otherState != null) {
int[] otherStablePosition = otherState.getLaidOutLocationOnScreen();
int[] ownPosition = ownState.getLaidOutLocationOnScreen();
- mText.animate()
+ text.animate()
.translationY((otherStablePosition[1]
+ otherState.getTransformedView().getHeight()
- ownPosition[1]) * 0.33f)
@@ -72,11 +73,11 @@
if (endRunnable != null) {
endRunnable.run();
}
- TransformState.setClippingDeactivated(mText,
+ TransformState.setClippingDeactivated(text,
false);
}
});
- TransformState.setClippingDeactivated(mText, true);
+ TransformState.setClippingDeactivated(text, true);
otherState.recycle();
}
return true;
@@ -90,17 +91,18 @@
}
TransformState otherState = notification.getCurrentState(
TRANSFORMING_VIEW_TITLE);
- boolean isVisible = mText.getVisibility() == View.VISIBLE;
- CrossFadeHelper.fadeIn(mText);
+ final View text = ownState.getTransformedView();
+ boolean isVisible = text.getVisibility() == View.VISIBLE;
+ CrossFadeHelper.fadeIn(text);
if (otherState != null) {
int[] otherStablePosition = otherState.getLaidOutLocationOnScreen();
int[] ownStablePosition = ownState.getLaidOutLocationOnScreen();
if (!isVisible) {
- mText.setTranslationY((otherStablePosition[1]
+ text.setTranslationY((otherStablePosition[1]
+ otherState.getTransformedView().getHeight()
- ownStablePosition[1]) * 0.33f);
}
- mText.animate()
+ text.animate()
.translationY(0)
.setDuration(
StackStateAnimator.ANIMATION_DURATION_STANDARD)
@@ -108,11 +110,11 @@
.withEndAction(new Runnable() {
@Override
public void run() {
- TransformState.setClippingDeactivated(mText,
+ TransformState.setClippingDeactivated(text,
false);
}
});
- TransformState.setClippingDeactivated(mText, true);
+ TransformState.setClippingDeactivated(text, true);
otherState.recycle();
}
return true;