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

Commit 5274d6f1 authored by Michael Jurka's avatar Michael Jurka Committed by Android (Google) Code Review
Browse files

Merge "Improve rapid-fire presses on system bar"

parents 02d37b97 60bc69ef
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -55,6 +55,7 @@ public class KeyButtonView extends ImageView {
    float mGlowAlpha = 0f, mGlowScale = 1f, mDrawingAlpha = 1f;
    float mGlowAlpha = 0f, mGlowScale = 1f, mDrawingAlpha = 1f;
    boolean mSupportsLongpress = true;
    boolean mSupportsLongpress = true;
    RectF mRect = new RectF(0f,0f,0f,0f);
    RectF mRect = new RectF(0f,0f,0f,0f);
    AnimatorSet mPressedAnim;


    Runnable mCheckLongPress = new Runnable() {
    Runnable mCheckLongPress = new Runnable() {
        public void run() {
        public void run() {
@@ -173,7 +174,10 @@ public class KeyButtonView extends ImageView {
    public void setPressed(boolean pressed) {
    public void setPressed(boolean pressed) {
        if (mGlowBG != null) {
        if (mGlowBG != null) {
            if (pressed != isPressed()) {
            if (pressed != isPressed()) {
                AnimatorSet as = new AnimatorSet();
                if (mPressedAnim != null && mPressedAnim.isRunning()) {
                    mPressedAnim.cancel();
                }
                final AnimatorSet as = mPressedAnim = new AnimatorSet();
                if (pressed) {
                if (pressed) {
                    if (mGlowScale < GLOW_MAX_SCALE_FACTOR) 
                    if (mGlowScale < GLOW_MAX_SCALE_FACTOR) 
                        mGlowScale = GLOW_MAX_SCALE_FACTOR;
                        mGlowScale = GLOW_MAX_SCALE_FACTOR;