Merge "End current key button animations when the button is hidden" into rvc-qpr-dev am: 1989311276
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12653817 Change-Id: Idbce346cc33731b1682bcdb511b1532a897c8e67
This commit is contained in:
@@ -171,6 +171,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
|
@Override
|
||||||
public void setAlpha(int alpha) {
|
public void setAlpha(int alpha) {
|
||||||
mState.mAlpha = alpha;
|
mState.mAlpha = alpha;
|
||||||
|
|||||||
@@ -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
|
@Override
|
||||||
public void jumpToCurrentState() {
|
public void jumpToCurrentState() {
|
||||||
endAnimations("jumpToCurrentState", false /* cancel */);
|
endAnimations("jumpToCurrentState", false /* cancel */);
|
||||||
|
|||||||
Reference in New Issue
Block a user