diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java index 975c372..cc07240 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java @@ -55,6 +55,7 @@ public class KeyButtonView extends ImageView { float mGlowAlpha = 0f, mGlowScale = 1f, mDrawingAlpha = 1f; boolean mSupportsLongpress = true; RectF mRect = new RectF(0f,0f,0f,0f); + AnimatorSet mPressedAnim; Runnable mCheckLongPress = new Runnable() { public void run() { @@ -173,7 +174,10 @@ public class KeyButtonView extends ImageView { public void setPressed(boolean pressed) { if (mGlowBG != null) { if (pressed != isPressed()) { - AnimatorSet as = new AnimatorSet(); + if (mPressedAnim != null && mPressedAnim.isRunning()) { + mPressedAnim.cancel(); + } + final AnimatorSet as = mPressedAnim = new AnimatorSet(); if (pressed) { if (mGlowScale < GLOW_MAX_SCALE_FACTOR) mGlowScale = GLOW_MAX_SCALE_FACTOR; |