Loading packages/SystemUI/src/com/android/keyguard/NumPadAnimator.java +41 −4 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.keyguard; import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ArgbEvaluator; import android.animation.ValueAnimator; Loading @@ -33,6 +34,9 @@ import com.android.systemui.Flags; import com.android.systemui.bouncer.shared.constants.PinBouncerConstants.Animation; import com.android.systemui.bouncer.shared.constants.PinBouncerConstants.Color; import java.util.ArrayList; import java.util.List; /** * Provides background color and radius animations for key pad buttons. */ Loading Loading @@ -141,6 +145,7 @@ class NumPadAnimator { mExpandAnimator.addUpdateListener( anim -> mBackground.setCornerRadius((float) anim.getAnimatedValue())); List<Animator> expandAnimators = new ArrayList<>(); ValueAnimator expandBackgroundColorAnimator = ValueAnimator.ofObject(new ArgbEvaluator(), mNormalBackgroundColor, mPressedBackgroundColor); expandBackgroundColorAnimator.setDuration(Animation.expansionColorDuration); Loading @@ -162,10 +167,27 @@ class NumPadAnimator { } }); expandAnimators.add(mExpandAnimator); expandAnimators.add(expandBackgroundColorAnimator); expandAnimators.add(expandTextColorAnimator); if (Flags.bouncerUiRevamp2()) { ValueAnimator expandTextScaleAnimator = ValueAnimator.ofFloat( Animation.normalTextScaleX, Animation.pressedTextScaleX); expandTextScaleAnimator.setInterpolator(Animation.expansionInterpolator); expandTextScaleAnimator.setDuration(Animation.expansionDuration); expandTextScaleAnimator.addUpdateListener(valueAnimator -> { if (mDigitTextView != null) { mDigitTextView.setTextScaleX((Float) valueAnimator.getAnimatedValue()); } }); expandAnimators.add(expandTextScaleAnimator); } mExpandAnimatorSet = new AnimatorSet(); mExpandAnimatorSet.playTogether(mExpandAnimator, expandBackgroundColorAnimator, expandTextColorAnimator); mExpandAnimatorSet.playTogether(expandAnimators); List<Animator> contractAnimators = new ArrayList<>(); mContractAnimator = ValueAnimator.ofFloat(1f, 0f); mContractAnimator.setStartDelay(Animation.contractionStartDelay); mContractAnimator.setDuration(Animation.contractionDuration); Loading Loading @@ -195,9 +217,24 @@ class NumPadAnimator { } }); contractAnimators.add(mContractAnimator); contractAnimators.add(contractBackgroundColorAnimator); contractAnimators.add(contractTextColorAnimator); if (Flags.bouncerUiRevamp2()) { ValueAnimator contractTextScaleAnimator = ValueAnimator.ofFloat( Animation.pressedTextScaleX, Animation.normalTextScaleX); contractTextScaleAnimator.setInterpolator(Animation.contractionRadiusInterpolator); contractTextScaleAnimator.setDuration(Animation.contractionDuration); contractTextScaleAnimator.addUpdateListener(valueAnimator -> { if (mDigitTextView != null) { mDigitTextView.setTextScaleX((Float) valueAnimator.getAnimatedValue()); } }); contractAnimators.add(contractTextScaleAnimator); } mContractAnimatorSet = new AnimatorSet(); mContractAnimatorSet.playTogether(mContractAnimator, contractBackgroundColorAnimator, contractTextColorAnimator); mContractAnimatorSet.playTogether(contractAnimators); } } packages/SystemUI/src/com/android/keyguard/NumPadKey.java +1 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ public class NumPadKey extends ViewGroup implements NumPadAnimationListener { if (bouncerUiRevamp2()) { mDigitText.setTypeface( Typeface.create(FontStyles.GSF_LABEL_LARGE_EMPHASIZED, Typeface.NORMAL)); Typeface.create(FontStyles.GSF_LABEL_SMALL_EMPHASIZED, Typeface.NORMAL)); } } Loading packages/SystemUI/src/com/android/systemui/bouncer/shared/constants/KeyguardBouncerConstants.kt +3 −0 Original line number Diff line number Diff line Loading @@ -126,5 +126,8 @@ object PinBouncerConstants { @JvmField val contractionColorInterpolator = c(old = Interpolators.LINEAR, new = Interpolators.STANDARD)!! const val pressedTextScaleX = 1.35f const val normalTextScaleX = 1.0f } } Loading
packages/SystemUI/src/com/android/keyguard/NumPadAnimator.java +41 −4 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.keyguard; import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ArgbEvaluator; import android.animation.ValueAnimator; Loading @@ -33,6 +34,9 @@ import com.android.systemui.Flags; import com.android.systemui.bouncer.shared.constants.PinBouncerConstants.Animation; import com.android.systemui.bouncer.shared.constants.PinBouncerConstants.Color; import java.util.ArrayList; import java.util.List; /** * Provides background color and radius animations for key pad buttons. */ Loading Loading @@ -141,6 +145,7 @@ class NumPadAnimator { mExpandAnimator.addUpdateListener( anim -> mBackground.setCornerRadius((float) anim.getAnimatedValue())); List<Animator> expandAnimators = new ArrayList<>(); ValueAnimator expandBackgroundColorAnimator = ValueAnimator.ofObject(new ArgbEvaluator(), mNormalBackgroundColor, mPressedBackgroundColor); expandBackgroundColorAnimator.setDuration(Animation.expansionColorDuration); Loading @@ -162,10 +167,27 @@ class NumPadAnimator { } }); expandAnimators.add(mExpandAnimator); expandAnimators.add(expandBackgroundColorAnimator); expandAnimators.add(expandTextColorAnimator); if (Flags.bouncerUiRevamp2()) { ValueAnimator expandTextScaleAnimator = ValueAnimator.ofFloat( Animation.normalTextScaleX, Animation.pressedTextScaleX); expandTextScaleAnimator.setInterpolator(Animation.expansionInterpolator); expandTextScaleAnimator.setDuration(Animation.expansionDuration); expandTextScaleAnimator.addUpdateListener(valueAnimator -> { if (mDigitTextView != null) { mDigitTextView.setTextScaleX((Float) valueAnimator.getAnimatedValue()); } }); expandAnimators.add(expandTextScaleAnimator); } mExpandAnimatorSet = new AnimatorSet(); mExpandAnimatorSet.playTogether(mExpandAnimator, expandBackgroundColorAnimator, expandTextColorAnimator); mExpandAnimatorSet.playTogether(expandAnimators); List<Animator> contractAnimators = new ArrayList<>(); mContractAnimator = ValueAnimator.ofFloat(1f, 0f); mContractAnimator.setStartDelay(Animation.contractionStartDelay); mContractAnimator.setDuration(Animation.contractionDuration); Loading Loading @@ -195,9 +217,24 @@ class NumPadAnimator { } }); contractAnimators.add(mContractAnimator); contractAnimators.add(contractBackgroundColorAnimator); contractAnimators.add(contractTextColorAnimator); if (Flags.bouncerUiRevamp2()) { ValueAnimator contractTextScaleAnimator = ValueAnimator.ofFloat( Animation.pressedTextScaleX, Animation.normalTextScaleX); contractTextScaleAnimator.setInterpolator(Animation.contractionRadiusInterpolator); contractTextScaleAnimator.setDuration(Animation.contractionDuration); contractTextScaleAnimator.addUpdateListener(valueAnimator -> { if (mDigitTextView != null) { mDigitTextView.setTextScaleX((Float) valueAnimator.getAnimatedValue()); } }); contractAnimators.add(contractTextScaleAnimator); } mContractAnimatorSet = new AnimatorSet(); mContractAnimatorSet.playTogether(mContractAnimator, contractBackgroundColorAnimator, contractTextColorAnimator); mContractAnimatorSet.playTogether(contractAnimators); } }
packages/SystemUI/src/com/android/keyguard/NumPadKey.java +1 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ public class NumPadKey extends ViewGroup implements NumPadAnimationListener { if (bouncerUiRevamp2()) { mDigitText.setTypeface( Typeface.create(FontStyles.GSF_LABEL_LARGE_EMPHASIZED, Typeface.NORMAL)); Typeface.create(FontStyles.GSF_LABEL_SMALL_EMPHASIZED, Typeface.NORMAL)); } } Loading
packages/SystemUI/src/com/android/systemui/bouncer/shared/constants/KeyguardBouncerConstants.kt +3 −0 Original line number Diff line number Diff line Loading @@ -126,5 +126,8 @@ object PinBouncerConstants { @JvmField val contractionColorInterpolator = c(old = Interpolators.LINEAR, new = Interpolators.STANDARD)!! const val pressedTextScaleX = 1.35f const val normalTextScaleX = 1.0f } }