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

Commit 89008da4 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "End current key button animations when the button is hidden"

parents dc818acc df7e471a
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -170,6 +170,24 @@ public class KeyButtonDrawable extends Drawable {
        }
    }

    @Override
    public boolean setVisible(boolean visible, boolean restart) {
        boolean changed = super.setVisible(visible, restart);
        if (changed) {
            // End any existing animations when the visibility changes
            jumpToCurrentState();
        }
        return changed;
    }

    @Override
    public void jumpToCurrentState() {
        super.jumpToCurrentState();
        if (mAnimatedDrawable != null) {
            mAnimatedDrawable.jumpToCurrentState();
        }
    }

    @Override
    public void setAlpha(int alpha) {
        mState.mAlpha = alpha;
+10 −0
Original line number Diff line number Diff line
@@ -224,6 +224,16 @@ public class KeyButtonRipple extends Drawable {
        }
    }

    @Override
    public boolean setVisible(boolean visible, boolean restart) {
        boolean changed = super.setVisible(visible, restart);
        if (changed) {
            // End any existing animations when the visibility changes
            jumpToCurrentState();
        }
        return changed;
    }

    @Override
    public void jumpToCurrentState() {
        endAnimations("jumpToCurrentState", false /* cancel */);