Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7070317 authored by Selim Cinek's avatar Selim Cinek Committed by Android (Google) Code Review
Browse files

Merge "Fixed a crash in SystemUI"

parents 761a89df a6bb54f1
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -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);