Loading packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java +4 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,10 @@ public abstract class KeyguardInputView extends LinearLayout { abstract CharSequence getTitle(); void animateForIme(float interpolatedFraction) { return; } boolean disallowInterceptTouch(MotionEvent event) { return false; } Loading packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java +3 −13 Original line number Diff line number Diff line Loading @@ -136,24 +136,14 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView { @Override public void startAppearAnimation() { // Reset state, and let IME animation reveal the view as it slides in setAlpha(0f); setTranslationY(0f); animate() .alpha(1) .withLayer() .setDuration(300) .setInterpolator(mLinearOutSlowInInterpolator); } @Override public boolean startDisappearAnimation(Runnable finishRunnable) { animate() .alpha(0f) .translationY(mDisappearYTranslation) .setInterpolator(mFastOutLinearInInterpolator) .setDuration(100) .withEndAction(finishRunnable); return true; public void animateForIme(float interpolatedFraction) { setAlpha(interpolatedFraction); } @Override Loading packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java +12 −8 Original line number Diff line number Diff line Loading @@ -194,15 +194,19 @@ public class KeyguardPasswordViewController @Override public void onResume(int reason) { super.onResume(reason); // Wait a bit to focus the field so the focusable flag on the window is already set then. mMainExecutor.execute(() -> { if (mView.isShown() && mPasswordEntry.isEnabled()) { mPasswordEntry.requestFocus(); if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) { showInput(); } } private void showInput() { mPasswordEntry.post(() -> { if (mPasswordEntry.isFocused() && mView.isShown()) { mInputMethodManager.showSoftInput( mPasswordEntry, InputMethodManager.SHOW_IMPLICIT); } } }); } Loading packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +7 −4 Original line number Diff line number Diff line Loading @@ -119,21 +119,24 @@ public class KeyguardSecurityContainer extends FrameLayout { @Override public WindowInsets onProgress(WindowInsets windowInsets, List<WindowInsetsAnimation> list) { int translationY = 0; if (mDisappearAnimRunning) { mSecurityViewFlipper.setTranslationY( mInitialBounds.bottom - mFinalBounds.bottom); } else { int translationY = 0; float interpolatedFraction = 1f; for (WindowInsetsAnimation animation : list) { if ((animation.getTypeMask() & WindowInsets.Type.ime()) == 0) { continue; } interpolatedFraction = animation.getInterpolatedFraction(); final int paddingBottom = (int) MathUtils.lerp( mInitialBounds.bottom - mFinalBounds.bottom, 0, animation.getInterpolatedFraction()); interpolatedFraction); translationY += paddingBottom; } mSecurityViewFlipper.setTranslationY(translationY); mSecurityViewFlipper.animateForIme(translationY, interpolatedFraction); } return windowInsets; } Loading @@ -141,7 +144,7 @@ public class KeyguardSecurityContainer extends FrameLayout { @Override public void onEnd(WindowInsetsAnimation animation) { if (!mDisappearAnimRunning) { mSecurityViewFlipper.setTranslationY(0); mSecurityViewFlipper.animateForIme(0, /* interpolatedFraction */ 1f); } } }; Loading packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipper.java +10 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,16 @@ public class KeyguardSecurityViewFlipper extends ViewFlipper { return ""; } /** * Translate the entire view, and optionally inform the wrapped view of the progress * so it can animate with the parent. */ public void animateForIme(int translationY, float interpolatedFraction) { super.setTranslationY(translationY); KeyguardInputView v = getSecurityView(); if (v != null) v.animateForIme(interpolatedFraction); } @Override protected boolean checkLayoutParams(ViewGroup.LayoutParams p) { return p instanceof LayoutParams; Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java +4 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,10 @@ public abstract class KeyguardInputView extends LinearLayout { abstract CharSequence getTitle(); void animateForIme(float interpolatedFraction) { return; } boolean disallowInterceptTouch(MotionEvent event) { return false; } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java +3 −13 Original line number Diff line number Diff line Loading @@ -136,24 +136,14 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView { @Override public void startAppearAnimation() { // Reset state, and let IME animation reveal the view as it slides in setAlpha(0f); setTranslationY(0f); animate() .alpha(1) .withLayer() .setDuration(300) .setInterpolator(mLinearOutSlowInInterpolator); } @Override public boolean startDisappearAnimation(Runnable finishRunnable) { animate() .alpha(0f) .translationY(mDisappearYTranslation) .setInterpolator(mFastOutLinearInInterpolator) .setDuration(100) .withEndAction(finishRunnable); return true; public void animateForIme(float interpolatedFraction) { setAlpha(interpolatedFraction); } @Override Loading
packages/SystemUI/src/com/android/keyguard/KeyguardPasswordViewController.java +12 −8 Original line number Diff line number Diff line Loading @@ -194,15 +194,19 @@ public class KeyguardPasswordViewController @Override public void onResume(int reason) { super.onResume(reason); // Wait a bit to focus the field so the focusable flag on the window is already set then. mMainExecutor.execute(() -> { if (mView.isShown() && mPasswordEntry.isEnabled()) { mPasswordEntry.requestFocus(); if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) { showInput(); } } private void showInput() { mPasswordEntry.post(() -> { if (mPasswordEntry.isFocused() && mView.isShown()) { mInputMethodManager.showSoftInput( mPasswordEntry, InputMethodManager.SHOW_IMPLICIT); } } }); } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +7 −4 Original line number Diff line number Diff line Loading @@ -119,21 +119,24 @@ public class KeyguardSecurityContainer extends FrameLayout { @Override public WindowInsets onProgress(WindowInsets windowInsets, List<WindowInsetsAnimation> list) { int translationY = 0; if (mDisappearAnimRunning) { mSecurityViewFlipper.setTranslationY( mInitialBounds.bottom - mFinalBounds.bottom); } else { int translationY = 0; float interpolatedFraction = 1f; for (WindowInsetsAnimation animation : list) { if ((animation.getTypeMask() & WindowInsets.Type.ime()) == 0) { continue; } interpolatedFraction = animation.getInterpolatedFraction(); final int paddingBottom = (int) MathUtils.lerp( mInitialBounds.bottom - mFinalBounds.bottom, 0, animation.getInterpolatedFraction()); interpolatedFraction); translationY += paddingBottom; } mSecurityViewFlipper.setTranslationY(translationY); mSecurityViewFlipper.animateForIme(translationY, interpolatedFraction); } return windowInsets; } Loading @@ -141,7 +144,7 @@ public class KeyguardSecurityContainer extends FrameLayout { @Override public void onEnd(WindowInsetsAnimation animation) { if (!mDisappearAnimRunning) { mSecurityViewFlipper.setTranslationY(0); mSecurityViewFlipper.animateForIme(0, /* interpolatedFraction */ 1f); } } }; Loading
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipper.java +10 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,16 @@ public class KeyguardSecurityViewFlipper extends ViewFlipper { return ""; } /** * Translate the entire view, and optionally inform the wrapped view of the progress * so it can animate with the parent. */ public void animateForIme(int translationY, float interpolatedFraction) { super.setTranslationY(translationY); KeyguardInputView v = getSecurityView(); if (v != null) v.animateForIme(interpolatedFraction); } @Override protected boolean checkLayoutParams(ViewGroup.LayoutParams p) { return p instanceof LayoutParams; Loading