summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java16
1 files changed, 10 insertions, 6 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 dec5303ff7bb..918b6edc0c30 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java
@@ -137,8 +137,12 @@ public class TransformState {
final View transformedView = mTransformedView;
boolean transformX = (transformationFlags & TRANSFORM_X) != 0;
boolean transformY = (transformationFlags & TRANSFORM_Y) != 0;
- boolean differentHeight = otherState.getViewHeight() != getViewHeight();
- boolean differentWidth = otherState.getViewWidth() != getViewWidth();
+ int viewHeight = getViewHeight();
+ int otherHeight = otherState.getViewHeight();
+ boolean differentHeight = otherHeight != viewHeight && otherHeight != 0 && viewHeight != 0;
+ int viewWidth = getViewWidth();
+ int otherWidth = otherState.getViewWidth();
+ boolean differentWidth = otherWidth != viewWidth && otherWidth != 0 && viewWidth != 0;
boolean transformScale = transformScale(otherState) && (differentHeight || differentWidth);
// lets animate the positions correctly
if (transformationAmount == 0.0f
@@ -165,15 +169,15 @@ public class TransformState {
// we also want to animate the scale if we're the same
View otherView = otherState.getTransformedView();
if (transformScale && differentWidth) {
- setTransformationStartScaleX(otherState.getViewWidth() * otherView.getScaleX()
- / (float) getViewWidth());
+ setTransformationStartScaleX(otherWidth * otherView.getScaleX()
+ / (float) viewWidth);
transformedView.setPivotX(0);
} else {
setTransformationStartScaleX(UNDEFINED);
}
if (transformScale && differentHeight) {
- setTransformationStartScaleY(otherState.getViewHeight() * otherView.getScaleY()
- / (float) getViewHeight());
+ setTransformationStartScaleY(otherHeight * otherView.getScaleY()
+ / (float) viewHeight);
transformedView.setPivotY(0);
} else {
setTransformationStartScaleY(UNDEFINED);