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

Commit a2362c92 authored by Alan Viverette's avatar Alan Viverette
Browse files

Clear ripple animations on cancel/end

This prevents subsequent calls to end() from snapping the background
opacity (among others) back to 1.

BUG: 17357749
BUG: 17349157
Change-Id: I2a4870ed588ba98986428983bf29b556cdc9a701
parent 18aa9f65
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -419,18 +419,22 @@ class Ripple {
    private void endSoftwareAnimations() {
        if (mAnimRadius != null) {
            mAnimRadius.end();
            mAnimRadius = null;
        }

        if (mAnimOpacity != null) {
            mAnimOpacity.end();
            mAnimOpacity = null;
        }

        if (mAnimX != null) {
            mAnimX.end();
            mAnimX = null;
        }

        if (mAnimY != null) {
            mAnimY.end();
            mAnimY = null;
        }
    }

@@ -506,18 +510,22 @@ class Ripple {
    private void cancelSoftwareAnimations() {
        if (mAnimRadius != null) {
            mAnimRadius.cancel();
            mAnimRadius = null;
        }

        if (mAnimOpacity != null) {
            mAnimOpacity.cancel();
            mAnimOpacity = null;
        }

        if (mAnimX != null) {
            mAnimX.cancel();
            mAnimX = null;
        }

        if (mAnimY != null) {
            mAnimY.cancel();
            mAnimY = null;
        }
    }

+2 −0
Original line number Diff line number Diff line
@@ -326,6 +326,7 @@ class RippleBackground {
    private void endSoftwareAnimations() {
        if (mAnimOuterOpacity != null) {
            mAnimOuterOpacity.end();
            mAnimOuterOpacity = null;
        }
    }

@@ -413,6 +414,7 @@ class RippleBackground {
    private void cancelSoftwareAnimations() {
        if (mAnimOuterOpacity != null) {
            mAnimOuterOpacity.cancel();
            mAnimOuterOpacity = null;
        }
    }