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

Commit ae0161e7 authored by Jim Miller's avatar Jim Miller Committed by Android (Google) Code Review
Browse files

Merge "Don't handle click events on the emergency button in bouncer mode" into...

Merge "Don't handle click events on the emergency button in bouncer mode" into jb-mr1-lockscreen-dev
parents 71b7d891 8bbafed4
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.policy.impl.keyguard;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.graphics.drawable.Drawable;
import android.view.View;
@@ -27,7 +28,7 @@ import android.view.View;
public class KeyguardSecurityViewHelper {

    public static void showBouncer(SecurityMessageDisplay securityMessageDisplay,
            View ecaView, Drawable bouncerFrame, int duration) {
            final View ecaView, Drawable bouncerFrame, int duration) {
        if (securityMessageDisplay != null) {
            securityMessageDisplay.showBouncer(duration);
        }
@@ -35,9 +36,23 @@ public class KeyguardSecurityViewHelper {
            if (duration > 0) {
                Animator anim = ObjectAnimator.ofFloat(ecaView, "alpha", 0f);
                anim.setDuration(duration);
                anim.addListener(new AnimatorListenerAdapter() {
                    private boolean mCanceled;
                    @Override
                    public void onAnimationCancel(Animator animation) {
                        // Fail safe and show the emergency button in onAnimationEnd()
                        mCanceled = true;
                        ecaView.setAlpha(1f);
                    }
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        ecaView.setVisibility(mCanceled ? View.VISIBLE : View.INVISIBLE);
                    }
                });
                anim.start();
            } else {
                ecaView.setAlpha(0f);
                ecaView.setVisibility(View.INVISIBLE);
            }
        }
        if (bouncerFrame != null) {
@@ -57,6 +72,7 @@ public class KeyguardSecurityViewHelper {
            securityMessageDisplay.hideBouncer(duration);
        }
        if (ecaView != null) {
            ecaView.setVisibility(View.VISIBLE);
            if (duration > 0) {
                Animator anim = ObjectAnimator.ofFloat(ecaView, "alpha", 1f);
                anim.setDuration(duration);