diff options
| author | 2018-01-25 23:37:38 +0000 | |
|---|---|---|
| committer | 2018-01-25 23:37:38 +0000 | |
| commit | a70703175c1f5bcdfea44e5f665c51457a88b126 (patch) | |
| tree | 0604692fdc10dfdd2708c275e5126347b7170295 | |
| parent | 761a89dfa62e00d8dbdaf5c51386d9dbbced6505 (diff) | |
| parent | a6bb54f1b4ca6a7ad90bf14256140f9a66bd5670 (diff) | |
Merge "Fixed a crash in SystemUI"
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/notification/TransformState.java | 16 |
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); |