FileDocCategorySizeDatePackage
KeyguardSecurityViewHelper.javaAPI DocAndroid 5.1 API3482Thu Mar 12 22:22:42 GMT 2015com.android.keyguard

KeyguardSecurityViewHelper

public class KeyguardSecurityViewHelper extends Object
Some common functions that are useful for KeyguardSecurityViews.

Fields Summary
Constructors Summary
Methods Summary
public static voidhideBouncer(SecurityMessageDisplay securityMessageDisplay, android.view.View ecaView, android.graphics.drawable.Drawable bouncerFrame, int duration)

        if (securityMessageDisplay != null) {
            securityMessageDisplay.hideBouncer(duration);
        }
        if (ecaView != null) {
            ecaView.setVisibility(View.VISIBLE);
            if (duration > 0) {
                Animator anim = ObjectAnimator.ofFloat(ecaView, "alpha", 1f);
                anim.setDuration(duration);
                anim.start();
            } else {
                ecaView.setAlpha(1f);
            }
        }
        if (bouncerFrame != null) {
            if (duration > 0) {
                Animator anim = ObjectAnimator.ofInt(bouncerFrame, "alpha", 255, 0);
                anim.setDuration(duration);
                anim.start();
            } else {
                bouncerFrame.setAlpha(0);
            }
        }
    
public static voidshowBouncer(SecurityMessageDisplay securityMessageDisplay, android.view.View ecaView, android.graphics.drawable.Drawable bouncerFrame, int duration)

        if (securityMessageDisplay != null) {
            securityMessageDisplay.showBouncer(duration);
        }
        if (ecaView != null) {
            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) {
            if (duration > 0) {
                Animator anim = ObjectAnimator.ofInt(bouncerFrame, "alpha", 0, 255);
                anim.setDuration(duration);
                anim.start();
            } else {
                bouncerFrame.setAlpha(255);
            }
        }