Loading packages/SystemUI/src/com/android/keyguard/PinShapeHintingView.java +28 −6 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import android.widget.LinearLayout; import androidx.core.graphics.drawable.DrawableCompat; import com.android.systemui.Flags; import com.android.systemui.bouncer.shared.constants.PinBouncerConstants.Color; import com.android.systemui.res.R; /** Loading @@ -38,6 +40,7 @@ public class PinShapeHintingView extends LinearLayout implements PinShapeInput { private int mPinLength; private int mDotDiameter; @Deprecated private int mColor = getContext().getColor(PIN_SHAPES); private int mPosition = 0; private static final int DEFAULT_PIN_LENGTH = 6; Loading @@ -56,7 +59,7 @@ public class PinShapeHintingView extends LinearLayout implements PinShapeInput { pinDot.setImageResource(R.drawable.pin_dot_avd); if (pinDot.getDrawable() != null) { Drawable drawable = DrawableCompat.wrap(pinDot.getDrawable()); DrawableCompat.setTint(drawable, mColor); DrawableCompat.setTint(drawable, getPinHintDotColor()); } addView(pinDot); } Loading @@ -67,7 +70,8 @@ public class PinShapeHintingView extends LinearLayout implements PinShapeInput { if (mPosition == DEFAULT_PIN_LENGTH) { return; } setAnimatedDrawable(mPosition, mPinShapeAdapter.getShape(mPosition)); setAnimatedDrawable((ImageView) getChildAt(mPosition), mPinShapeAdapter.getShape(mPosition), getPinShapeColor()); mPosition++; } Loading @@ -77,7 +81,8 @@ public class PinShapeHintingView extends LinearLayout implements PinShapeInput { return; } mPosition--; setAnimatedDrawable(mPosition, R.drawable.pin_dot_delete_avd); setAnimatedDrawable((ImageView) getChildAt(mPosition), R.drawable.pin_dot_delete_avd, getPinHintDotColor()); } @Override Loading @@ -99,15 +104,32 @@ public class PinShapeHintingView extends LinearLayout implements PinShapeInput { return this; } private void setAnimatedDrawable(int position, int drawableResId) { ImageView pinDot = (ImageView) getChildAt(position); private static void setAnimatedDrawable(ImageView pinDot, int drawableResId, int drawableColor) { pinDot.setImageResource(drawableResId); if (pinDot.getDrawable() != null) { Drawable drawable = DrawableCompat.wrap(pinDot.getDrawable()); DrawableCompat.setTint(drawable, mColor); DrawableCompat.setTint(drawable, drawableColor); } if (pinDot.getDrawable() instanceof AnimatedVectorDrawable) { ((AnimatedVectorDrawable) pinDot.getDrawable()).start(); } } private int getPinHintDotColor() { if (Flags.bouncerUiRevamp2()) { return mContext.getColor(Color.hintDot); } else { return mColor; } } private int getPinShapeColor() { if (Flags.bouncerUiRevamp2()) { return mContext.getColor(Color.shape); } else { return mColor; } } } packages/SystemUI/src/com/android/keyguard/PinShapeNonHintingView.java +12 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,8 @@ import android.widget.LinearLayout; import androidx.core.graphics.drawable.DrawableCompat; import com.android.app.animation.Interpolators; import com.android.systemui.Flags; import com.android.systemui.bouncer.shared.constants.PinBouncerConstants.Color; import com.android.systemui.res.R; /** Loading @@ -48,6 +50,7 @@ import com.android.systemui.res.R; public class PinShapeNonHintingView extends LinearLayout implements PinShapeInput { private static final int RESET_STAGGER_DELAY = 40; private static final int RESET_MAX_DELAY = 200; @Deprecated private int mColor = getContext().getColor(PIN_SHAPES); private int mPosition = 0; private boolean mIsAnimatingReset = false; Loading Loading @@ -88,7 +91,7 @@ public class PinShapeNonHintingView extends LinearLayout implements PinShapeInpu pinDot.setImageResource(mPinShapeAdapter.getShape(mPosition)); if (pinDot.getDrawable() != null) { Drawable wrappedDrawable = DrawableCompat.wrap(pinDot.getDrawable()); DrawableCompat.setTint(wrappedDrawable, mColor); DrawableCompat.setTint(wrappedDrawable, getPinShapeColor()); } if (pinDot.getDrawable() instanceof AnimatedVectorDrawable) { ((AnimatedVectorDrawable) pinDot.getDrawable()).start(); Loading Loading @@ -216,4 +219,12 @@ public class PinShapeNonHintingView extends LinearLayout implements PinShapeInpu return animator; } } private int getPinShapeColor() { if (Flags.bouncerUiRevamp2()) { return mContext.getColor(Color.shape); } else { return mColor; } } } packages/SystemUI/src/com/android/systemui/bouncer/shared/constants/KeyguardBouncerConstants.kt +27 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.bouncer.shared.constants import com.android.internal.R.color as colors object KeyguardBouncerConstants { /** * Values for the bouncer expansion represented as the panel expansion. Panel expansion 1f = Loading @@ -33,15 +35,40 @@ object KeyguardBouncerConstants { const val DEFAULT_PIN_LENGTH = 6 object ColorId { private const val DEPRECATION_MSG = "Colors will not be used after bouncerUiRevamp2 flag is launched" @Deprecated(DEPRECATION_MSG) const val TITLE = com.android.internal.R.color.materialColorOnSurface @Deprecated(DEPRECATION_MSG) const val PIN_SHAPES = com.android.internal.R.color.materialColorOnSurfaceVariant @Deprecated(DEPRECATION_MSG) const val NUM_PAD_BACKGROUND = com.android.internal.R.color.materialColorSurfaceContainerHigh @Deprecated(DEPRECATION_MSG) const val NUM_PAD_BACKGROUND_PRESSED = com.android.internal.R.color.materialColorPrimaryFixed @Deprecated(DEPRECATION_MSG) const val NUM_PAD_PRESSED = com.android.internal.R.color.materialColorOnPrimaryFixed @Deprecated(DEPRECATION_MSG) const val NUM_PAD_KEY = com.android.internal.R.color.materialColorOnSurface @Deprecated(DEPRECATION_MSG) const val NUM_PAD_BUTTON = com.android.internal.R.color.materialColorOnSecondaryFixed @Deprecated(DEPRECATION_MSG) const val EMERGENCY_BUTTON = com.android.internal.R.color.materialColorTertiaryFixed } } object PinBouncerConstants { object Color { @JvmField val hintDot = colors.materialColorOnSurfaceVariant @JvmField val shape = colors.materialColorPrimary } } Loading
packages/SystemUI/src/com/android/keyguard/PinShapeHintingView.java +28 −6 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import android.widget.LinearLayout; import androidx.core.graphics.drawable.DrawableCompat; import com.android.systemui.Flags; import com.android.systemui.bouncer.shared.constants.PinBouncerConstants.Color; import com.android.systemui.res.R; /** Loading @@ -38,6 +40,7 @@ public class PinShapeHintingView extends LinearLayout implements PinShapeInput { private int mPinLength; private int mDotDiameter; @Deprecated private int mColor = getContext().getColor(PIN_SHAPES); private int mPosition = 0; private static final int DEFAULT_PIN_LENGTH = 6; Loading @@ -56,7 +59,7 @@ public class PinShapeHintingView extends LinearLayout implements PinShapeInput { pinDot.setImageResource(R.drawable.pin_dot_avd); if (pinDot.getDrawable() != null) { Drawable drawable = DrawableCompat.wrap(pinDot.getDrawable()); DrawableCompat.setTint(drawable, mColor); DrawableCompat.setTint(drawable, getPinHintDotColor()); } addView(pinDot); } Loading @@ -67,7 +70,8 @@ public class PinShapeHintingView extends LinearLayout implements PinShapeInput { if (mPosition == DEFAULT_PIN_LENGTH) { return; } setAnimatedDrawable(mPosition, mPinShapeAdapter.getShape(mPosition)); setAnimatedDrawable((ImageView) getChildAt(mPosition), mPinShapeAdapter.getShape(mPosition), getPinShapeColor()); mPosition++; } Loading @@ -77,7 +81,8 @@ public class PinShapeHintingView extends LinearLayout implements PinShapeInput { return; } mPosition--; setAnimatedDrawable(mPosition, R.drawable.pin_dot_delete_avd); setAnimatedDrawable((ImageView) getChildAt(mPosition), R.drawable.pin_dot_delete_avd, getPinHintDotColor()); } @Override Loading @@ -99,15 +104,32 @@ public class PinShapeHintingView extends LinearLayout implements PinShapeInput { return this; } private void setAnimatedDrawable(int position, int drawableResId) { ImageView pinDot = (ImageView) getChildAt(position); private static void setAnimatedDrawable(ImageView pinDot, int drawableResId, int drawableColor) { pinDot.setImageResource(drawableResId); if (pinDot.getDrawable() != null) { Drawable drawable = DrawableCompat.wrap(pinDot.getDrawable()); DrawableCompat.setTint(drawable, mColor); DrawableCompat.setTint(drawable, drawableColor); } if (pinDot.getDrawable() instanceof AnimatedVectorDrawable) { ((AnimatedVectorDrawable) pinDot.getDrawable()).start(); } } private int getPinHintDotColor() { if (Flags.bouncerUiRevamp2()) { return mContext.getColor(Color.hintDot); } else { return mColor; } } private int getPinShapeColor() { if (Flags.bouncerUiRevamp2()) { return mContext.getColor(Color.shape); } else { return mColor; } } }
packages/SystemUI/src/com/android/keyguard/PinShapeNonHintingView.java +12 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,8 @@ import android.widget.LinearLayout; import androidx.core.graphics.drawable.DrawableCompat; import com.android.app.animation.Interpolators; import com.android.systemui.Flags; import com.android.systemui.bouncer.shared.constants.PinBouncerConstants.Color; import com.android.systemui.res.R; /** Loading @@ -48,6 +50,7 @@ import com.android.systemui.res.R; public class PinShapeNonHintingView extends LinearLayout implements PinShapeInput { private static final int RESET_STAGGER_DELAY = 40; private static final int RESET_MAX_DELAY = 200; @Deprecated private int mColor = getContext().getColor(PIN_SHAPES); private int mPosition = 0; private boolean mIsAnimatingReset = false; Loading Loading @@ -88,7 +91,7 @@ public class PinShapeNonHintingView extends LinearLayout implements PinShapeInpu pinDot.setImageResource(mPinShapeAdapter.getShape(mPosition)); if (pinDot.getDrawable() != null) { Drawable wrappedDrawable = DrawableCompat.wrap(pinDot.getDrawable()); DrawableCompat.setTint(wrappedDrawable, mColor); DrawableCompat.setTint(wrappedDrawable, getPinShapeColor()); } if (pinDot.getDrawable() instanceof AnimatedVectorDrawable) { ((AnimatedVectorDrawable) pinDot.getDrawable()).start(); Loading Loading @@ -216,4 +219,12 @@ public class PinShapeNonHintingView extends LinearLayout implements PinShapeInpu return animator; } } private int getPinShapeColor() { if (Flags.bouncerUiRevamp2()) { return mContext.getColor(Color.shape); } else { return mColor; } } }
packages/SystemUI/src/com/android/systemui/bouncer/shared/constants/KeyguardBouncerConstants.kt +27 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.bouncer.shared.constants import com.android.internal.R.color as colors object KeyguardBouncerConstants { /** * Values for the bouncer expansion represented as the panel expansion. Panel expansion 1f = Loading @@ -33,15 +35,40 @@ object KeyguardBouncerConstants { const val DEFAULT_PIN_LENGTH = 6 object ColorId { private const val DEPRECATION_MSG = "Colors will not be used after bouncerUiRevamp2 flag is launched" @Deprecated(DEPRECATION_MSG) const val TITLE = com.android.internal.R.color.materialColorOnSurface @Deprecated(DEPRECATION_MSG) const val PIN_SHAPES = com.android.internal.R.color.materialColorOnSurfaceVariant @Deprecated(DEPRECATION_MSG) const val NUM_PAD_BACKGROUND = com.android.internal.R.color.materialColorSurfaceContainerHigh @Deprecated(DEPRECATION_MSG) const val NUM_PAD_BACKGROUND_PRESSED = com.android.internal.R.color.materialColorPrimaryFixed @Deprecated(DEPRECATION_MSG) const val NUM_PAD_PRESSED = com.android.internal.R.color.materialColorOnPrimaryFixed @Deprecated(DEPRECATION_MSG) const val NUM_PAD_KEY = com.android.internal.R.color.materialColorOnSurface @Deprecated(DEPRECATION_MSG) const val NUM_PAD_BUTTON = com.android.internal.R.color.materialColorOnSecondaryFixed @Deprecated(DEPRECATION_MSG) const val EMERGENCY_BUTTON = com.android.internal.R.color.materialColorTertiaryFixed } } object PinBouncerConstants { object Color { @JvmField val hintDot = colors.materialColorOnSurfaceVariant @JvmField val shape = colors.materialColorPrimary } }