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

Commit d713ad87 authored by Tyler Freeman's avatar Tyler Freeman Committed by Android (Google) Code Review
Browse files

Merge "fix(window magnification): Do null check before animation" into main

parents c5a688f0 6e7d84b7
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1303,7 +1303,7 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
        } else if (id == R.id.close_button) {
            setEditMagnifierSizeMode(false);
        } else {
            animateBounceEffect();
            animateBounceEffectIfNeeded();
        }
    }

@@ -1465,7 +1465,12 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
        mBounceEffectDuration = duration;
    }

    private void animateBounceEffect() {
    private void animateBounceEffectIfNeeded() {
        if (mMirrorView == null) {
            // run the animation only if the mirror view is not null
            return;
        }

        final ObjectAnimator scaleAnimator = ObjectAnimator.ofPropertyValuesHolder(mMirrorView,
                PropertyValuesHolder.ofFloat(View.SCALE_X, 1, mBounceEffectAnimationScale, 1),
                PropertyValuesHolder.ofFloat(View.SCALE_Y, 1, mBounceEffectAnimationScale, 1));