summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/statusbar
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-10-30 19:11:56 +0000
committerandroid-build-merger <android-build-merger@google.com>2014-10-30 19:11:56 +0000
commit468e6b7e8b945385d229660a953b816355211d0c (patch)
treef68bd071a98b288d8544f4fdf8d4ea461d60d302 /packages/SystemUI/src/com/android/systemui/statusbar
parent298c170ae78d2c80f141e7cef15e42be3481549f (diff)
parent987c68090c8298f2d6a03ba01b703a5908ef16a2 (diff)
downloadframeworks_base-468e6b7e8b945385d229660a953b816355211d0c.zip
frameworks_base-468e6b7e8b945385d229660a953b816355211d0c.tar.gz
frameworks_base-468e6b7e8b945385d229660a953b816355211d0c.tar.bz2
am b9e290c7: Cancel ripple animations when window is hidden
automerge: 987c680 * commit '987c68090c8298f2d6a03ba01b703a5908ef16a2': Cancel ripple animations when window is hidden
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java19
2 files changed, 13 insertions, 12 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java
index a3765aa..6998791 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java
@@ -102,7 +102,6 @@ public class KeyButtonRipple extends Drawable {
}
}
-
@Override
public void draw(Canvas canvas) {
mSupportHardware = canvas.isHardwareAccelerated();
@@ -176,6 +175,11 @@ public class KeyButtonRipple extends Drawable {
}
@Override
+ public void jumpToCurrentState() {
+ cancelAnimations();
+ }
+
+ @Override
public boolean isStateful() {
return true;
}
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 7cc75da..b9cc0f9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
@@ -17,38 +17,27 @@
package com.android.systemui.statusbar.policy;
import android.animation.Animator;
-import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
-import android.animation.TimeInterpolator;
import android.app.ActivityManager;
import android.content.Context;
import android.content.res.TypedArray;
-import android.graphics.Canvas;
-import android.graphics.CanvasProperty;
-import android.graphics.Paint;
-import android.graphics.RectF;
import android.hardware.input.InputManager;
import android.media.AudioManager;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.util.Log;
-import android.util.MathUtils;
import android.view.HapticFeedbackConstants;
-import android.view.HardwareCanvas;
import android.view.InputDevice;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.MotionEvent;
-import android.view.RenderNodeAnimator;
import android.view.SoundEffectConstants;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.ImageView;
-import java.lang.Math;
-import java.util.ArrayList;
import com.android.systemui.R;
@@ -124,6 +113,14 @@ public class KeyButtonView extends ImageView {
}
@Override
+ protected void onWindowVisibilityChanged(int visibility) {
+ super.onWindowVisibilityChanged(visibility);
+ if (visibility != View.VISIBLE) {
+ jumpDrawablesToCurrentState();
+ }
+ }
+
+ @Override
public boolean performAccessibilityAction(int action, Bundle arguments) {
if (action == ACTION_CLICK && mCode != 0) {
sendEvent(KeyEvent.ACTION_DOWN, 0, SystemClock.uptimeMillis());