FileDocCategorySizeDatePackage
KeyguardPINView.javaAPI DocAndroid 5.1 API5627Thu Mar 12 22:22:42 GMT 2015com.android.keyguard

KeyguardPINView

public class KeyguardPINView extends KeyguardPinBasedInputView
Displays a PIN pad for unlocking.

Fields Summary
private final AppearAnimationUtils
mAppearAnimationUtils
private final DisappearAnimationUtils
mDisappearAnimationUtils
private android.view.ViewGroup
mKeyguardBouncerFrame
private android.view.ViewGroup
mRow0
private android.view.ViewGroup
mRow1
private android.view.ViewGroup
mRow2
private android.view.ViewGroup
mRow3
private android.view.View
mDivider
private int
mDisappearYTranslation
private android.view.View[]
mViews
Constructors Summary
public KeyguardPINView(android.content.Context context)

        this(context, null);
    
public KeyguardPINView(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
        mAppearAnimationUtils = new AppearAnimationUtils(context);
        mDisappearAnimationUtils = new DisappearAnimationUtils(context,
                125, 0.6f /* translationScale */,
                0.6f /* delayScale */, AnimationUtils.loadInterpolator(
                        mContext, android.R.interpolator.fast_out_linear_in));
        mDisappearYTranslation = getResources().getDimensionPixelSize(
                R.dimen.disappear_y_translation);
    
Methods Summary
private voidenableClipping(boolean enable)

        mKeyguardBouncerFrame.setClipToPadding(enable);
        mKeyguardBouncerFrame.setClipChildren(enable);
        mRow1.setClipToPadding(enable);
        mRow2.setClipToPadding(enable);
        mRow3.setClipToPadding(enable);
        setClipChildren(enable);
    
protected intgetPasswordTextViewId()

        return R.id.pinEntry;
    
public intgetWrongPasswordStringId()

        return R.string.kg_wrong_pin;
    
public booleanhasOverlappingRendering()

        return false;
    
protected voidonFinishInflate()

        super.onFinishInflate();

        mKeyguardBouncerFrame = (ViewGroup) findViewById(R.id.keyguard_bouncer_frame);
        mRow0 = (ViewGroup) findViewById(R.id.row0);
        mRow1 = (ViewGroup) findViewById(R.id.row1);
        mRow2 = (ViewGroup) findViewById(R.id.row2);
        mRow3 = (ViewGroup) findViewById(R.id.row3);
        mDivider = findViewById(R.id.divider);
        mViews = new View[][]{
                new View[]{
                        mRow0, null, null
                },
                new View[]{
                        findViewById(R.id.key1), findViewById(R.id.key2),
                        findViewById(R.id.key3)
                },
                new View[]{
                        findViewById(R.id.key4), findViewById(R.id.key5),
                        findViewById(R.id.key6)
                },
                new View[]{
                        findViewById(R.id.key7), findViewById(R.id.key8),
                        findViewById(R.id.key9)
                },
                new View[]{
                        null, findViewById(R.id.key0), findViewById(R.id.key_enter)
                },
                new View[]{
                        null, mEcaView, null
                }};
    
protected voidresetState()

        super.resetState();
        if (KeyguardUpdateMonitor.getInstance(mContext).getMaxBiometricUnlockAttemptsReached()) {
            mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures, true);
        } else {
            mSecurityMessageDisplay.setMessage(R.string.kg_pin_instructions, false);
        }
    
public voidshowUsabilityHint()

    
public voidstartAppearAnimation()

        enableClipping(false);
        setAlpha(1f);
        setTranslationY(mAppearAnimationUtils.getStartTranslation());
        animate()
                .setDuration(500)
                .setInterpolator(mAppearAnimationUtils.getInterpolator())
                .translationY(0);
        mAppearAnimationUtils.startAnimation(mViews,
                new Runnable() {
                    @Override
                    public void run() {
                        enableClipping(true);
                    }
                });
    
public booleanstartDisappearAnimation(java.lang.Runnable finishRunnable)

        enableClipping(false);
        setTranslationY(0);
        animate()
                .setDuration(280)
                .setInterpolator(mDisappearAnimationUtils.getInterpolator())
                .translationY(mDisappearYTranslation);
        mDisappearAnimationUtils.startAnimation(mViews,
                new Runnable() {
                    @Override
                    public void run() {
                        enableClipping(true);
                        if (finishRunnable != null) {
                            finishRunnable.run();
                        }
                    }
                });
        return true;