diff options
| author | Jorim Jaggi <jjaggi@google.com> | 2014-05-28 15:37:14 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2014-05-28 15:37:14 +0000 |
| commit | 703e66895e33e22dd6103b05093b6535f9a5269c (patch) | |
| tree | 89b14d18207b7d6aa520cbd25c027c921b21116b /packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java | |
| parent | dedb76b76d390a63af6f3fe079d387fcd41bb4e2 (diff) | |
| parent | d5b71cbd7bedc73c7f19dfb44feea6b9a359c238 (diff) | |
| download | frameworks_base-703e66895e33e22dd6103b05093b6535f9a5269c.zip frameworks_base-703e66895e33e22dd6103b05093b6535f9a5269c.tar.gz frameworks_base-703e66895e33e22dd6103b05093b6535f9a5269c.tar.bz2 | |
am 5a467b12: Merge "Appear animation for PIN view." into lmp-preview-dev
* commit '5a467b12d19af0538eb7762138bb06c9d5a73727':
Appear animation for PIN view.
Diffstat (limited to 'packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java')
| -rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java index 4dfda91..1f3c176 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java @@ -22,6 +22,7 @@ import android.text.TextWatcher; import android.text.method.DigitsKeyListener; import android.util.AttributeSet; import android.view.View; +import android.view.ViewGroup; import android.widget.TextView.OnEditorActionListener; /** @@ -30,12 +31,21 @@ import android.widget.TextView.OnEditorActionListener; public class KeyguardPINView extends KeyguardAbsKeyInputView implements KeyguardSecurityView, OnEditorActionListener, TextWatcher { + private final AppearAnimationUtils mAppearAnimationUtils; + private ViewGroup mKeyguardBouncerFrame; + private ViewGroup mRow0; + private ViewGroup mRow1; + private ViewGroup mRow2; + private ViewGroup mRow3; + private View mDivider; + public KeyguardPINView(Context context) { this(context, null); } public KeyguardPINView(Context context, AttributeSet attrs) { super(context, attrs); + mAppearAnimationUtils = new AppearAnimationUtils(context); } protected void resetState() { @@ -56,6 +66,12 @@ public class KeyguardPINView extends KeyguardAbsKeyInputView protected void onFinishInflate() { 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); final View ok = findViewById(R.id.key_enter); if (ok != null) { ok.setOnClickListener(new View.OnClickListener() { @@ -117,8 +133,45 @@ public class KeyguardPINView extends KeyguardAbsKeyInputView @Override public void startAppearAnimation() { - // TODO: Fancy animation. - setAlpha(0); - animate().alpha(1).withLayer().setDuration(200); + enableClipping(false); + setTranslationY(mAppearAnimationUtils.getStartTranslation()); + animate() + .setDuration(500) + .setInterpolator(mAppearAnimationUtils.getInterpolator()) + .translationY(0); + mAppearAnimationUtils.startAppearAnimation(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 + }}, + new Runnable() { + @Override + public void run() { + enableClipping(true); + } + }); + } + + private void enableClipping(boolean enable) { + mKeyguardBouncerFrame.setClipToPadding(enable); + mKeyguardBouncerFrame.setClipChildren(enable); + mRow1.setClipToPadding(enable); + mRow2.setClipToPadding(enable); + mRow3.setClipToPadding(enable); + setClipChildren(enable); } } |
