Update bouncer colors for U.
Fixes: 279031011 Test: open up simpin/simpuk/pin in light and dark theme Change-Id: I84a3db273d1e7b5b804cbae367a9d4563df2458d
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
|
||||
<item android:color="?androidprv:attr/colorAccentSecondaryVariant"/>
|
||||
<item android:color="?androidprv:attr/materialColorSecondaryFixedDim"/>
|
||||
</selector>
|
||||
@@ -19,7 +19,7 @@
|
||||
android:color="?attr/wallpaperTextColorSecondary">
|
||||
<item android:id="@android:id/background">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?androidprv:attr/colorAccentTertiary"/>
|
||||
<solid android:color="?androidprv:attr/materialColorTertiaryFixed"/>
|
||||
<corners android:radius="24dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
<!-- This contains disable eSim buttons shared by sim_pin/sim_puk screens -->
|
||||
<com.android.keyguard.KeyguardEsimArea xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||
android:id="@+id/keyguard_disable_esim"
|
||||
style="@style/Keyguard.TextView"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -26,8 +27,8 @@
|
||||
android:background="@drawable/kg_bouncer_secondary_button"
|
||||
android:drawablePadding="10dp"
|
||||
android:drawableStart="@drawable/ic_no_sim"
|
||||
android:drawableTint="?android:attr/textColorPrimary"
|
||||
android:drawableTint="?androidprv:attr/materialColorOnSurface"
|
||||
android:text="@string/disable_carrier_button_text"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textColor="?androidprv:attr/materialColorOnSurface"
|
||||
android:textSize="@dimen/kg_status_line_font_size"
|
||||
android:visibility="gone" />
|
||||
|
||||
@@ -19,13 +19,14 @@
|
||||
|
||||
<com.android.keyguard.KeyguardSecurityContainer
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||
android:id="@+id/keyguard_security_container"
|
||||
android:background="?androidprv:attr/materialColorSurfaceContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:paddingTop="@dimen/keyguard_lock_padding"
|
||||
android:paddingTop="@dimen/status_bar_height"
|
||||
android:importantForAccessibility="yes"> <!-- Needed because TYPE_WINDOW_STATE_CHANGED is sent
|
||||
from this view when bouncer is shown -->
|
||||
<com.android.keyguard.KeyguardSecurityViewFlipper
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<item name="android:textSize">@dimen/kg_status_line_font_size</item>
|
||||
</style>
|
||||
<style name="Keyguard.TextView.EmergencyButton" parent="Theme.SystemUI">
|
||||
<item name="android:textColor">?androidprv:attr/textColorOnAccent</item>
|
||||
<item name="android:textColor">?androidprv:attr/materialColorOnTertiaryFixed</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:background">@drawable/kg_emergency_button_background</item>
|
||||
<item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
|
||||
|
||||
@@ -101,7 +101,6 @@
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout android:id="@+id/keyguard_bouncer_container"
|
||||
android:paddingTop="@dimen/status_bar_height"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_weight="1"
|
||||
|
||||
@@ -808,6 +808,8 @@
|
||||
<dimen name="keyguard_lock_height">42dp</dimen>
|
||||
<dimen name="keyguard_lock_padding">20dp</dimen>
|
||||
|
||||
<dimen name="keyguard_security_container_padding_top">20dp</dimen>
|
||||
|
||||
<dimen name="keyguard_indication_margin_bottom">32dp</dimen>
|
||||
<dimen name="lock_icon_margin_bottom">74dp</dimen>
|
||||
<dimen name="ambient_indication_margin_bottom">71dp</dimen>
|
||||
|
||||
@@ -28,6 +28,7 @@ import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import com.android.settingslib.Utils
|
||||
import com.android.systemui.animation.Interpolators
|
||||
import com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.TITLE
|
||||
|
||||
/** Displays security messages for the keyguard bouncer. */
|
||||
open class BouncerKeyguardMessageArea(context: Context?, attrs: AttributeSet?) :
|
||||
@@ -56,8 +57,7 @@ open class BouncerKeyguardMessageArea(context: Context?, attrs: AttributeSet?) :
|
||||
}
|
||||
|
||||
override fun onThemeChanged() {
|
||||
val array: TypedArray =
|
||||
mContext.obtainStyledAttributes(intArrayOf(android.R.attr.textColorPrimary))
|
||||
val array: TypedArray = mContext.obtainStyledAttributes(intArrayOf(TITLE))
|
||||
val newTextColors: ColorStateList = ColorStateList.valueOf(array.getColor(0, Color.RED))
|
||||
array.recycle()
|
||||
mDefaultColorState = newTextColors
|
||||
@@ -65,7 +65,7 @@ open class BouncerKeyguardMessageArea(context: Context?, attrs: AttributeSet?) :
|
||||
}
|
||||
|
||||
override fun reloadColor() {
|
||||
mDefaultColorState = Utils.getColorAttr(context, android.R.attr.textColorPrimary)
|
||||
mDefaultColorState = Utils.getColorAttr(context, TITLE)
|
||||
super.reloadColor()
|
||||
}
|
||||
|
||||
|
||||
@@ -333,6 +333,11 @@ public class KeyguardSecurityContainer extends ConstraintLayout {
|
||||
mSpringAnimation = new SpringAnimation(this, DynamicAnimation.TRANSLATION_Y);
|
||||
mViewConfiguration = ViewConfiguration.get(context);
|
||||
mDoubleTapDetector = new GestureDetector(context, new DoubleTapListener());
|
||||
|
||||
// Add additional top padding.
|
||||
setPadding(getPaddingLeft(), getPaddingTop() + getResources().getDimensionPixelSize(
|
||||
R.dimen.keyguard_security_container_padding_top), getPaddingRight(),
|
||||
getPaddingBottom());
|
||||
}
|
||||
|
||||
void onResume(SecurityMode securityMode, boolean faceAuthEnabled) {
|
||||
@@ -780,6 +785,8 @@ public class KeyguardSecurityContainer extends ConstraintLayout {
|
||||
|
||||
void reloadColors() {
|
||||
mViewMode.reloadColors();
|
||||
setBackgroundColor(Utils.getColorAttrDefaultColor(getContext(),
|
||||
com.android.internal.R.attr.materialColorSurface));
|
||||
}
|
||||
|
||||
/** Handles density or font scale changes. */
|
||||
|
||||
@@ -20,7 +20,9 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.widget.ImageView
|
||||
import androidx.core.graphics.drawable.DrawableCompat
|
||||
import com.android.settingslib.Utils
|
||||
import com.android.systemui.R
|
||||
import com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.EMERGENCY_BUTTON
|
||||
|
||||
abstract class KeyguardSimInputView(context: Context, attrs: AttributeSet) :
|
||||
KeyguardPinBasedInputView(context, attrs) {
|
||||
@@ -42,10 +44,7 @@ abstract class KeyguardSimInputView(context: Context, attrs: AttributeSet) :
|
||||
|
||||
override fun reloadColors() {
|
||||
super.reloadColors()
|
||||
val customAttrs = intArrayOf(android.R.attr.textColorSecondary)
|
||||
val a = context.obtainStyledAttributes(customAttrs)
|
||||
val imageColor = a.getColor(0, 0)
|
||||
a.recycle()
|
||||
val imageColor = Utils.getColorAttrDefaultColor(context, EMERGENCY_BUTTON)
|
||||
simImageView?.let {
|
||||
val wrappedDrawable = DrawableCompat.wrap(it.drawable)
|
||||
DrawableCompat.setTint(wrappedDrawable, imageColor)
|
||||
|
||||
@@ -15,12 +15,19 @@
|
||||
*/
|
||||
package com.android.keyguard;
|
||||
|
||||
import static com.android.settingslib.Utils.getColorAttrDefaultColor;
|
||||
import static com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_BACKGROUND;
|
||||
import static com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_BACKGROUND_PRESSED;
|
||||
import static com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_BUTTON;
|
||||
import static com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_KEY;
|
||||
import static com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_PRESSED;
|
||||
import static com.android.systemui.util.ColorUtilKt.getPrivateAttrColorIfUnset;
|
||||
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ArgbEvaluator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -112,20 +119,18 @@ class NumPadAnimator {
|
||||
|
||||
int[] customAttrs = {android.R.attr.colorControlNormal};
|
||||
ContextThemeWrapper ctw = new ContextThemeWrapper(context, mStyle);
|
||||
TypedArray a = ctw.obtainStyledAttributes(customAttrs);
|
||||
@SuppressLint("ResourceType") TypedArray a = ctw.obtainStyledAttributes(customAttrs);
|
||||
mNormalBackgroundColor = getPrivateAttrColorIfUnset(ctw, a, 0, 0,
|
||||
com.android.internal.R.attr.colorSurface);
|
||||
NUM_PAD_BACKGROUND);
|
||||
a.recycle();
|
||||
mBackground.setColor(mNormalBackgroundColor);
|
||||
|
||||
mPressedBackgroundColor = context.getColor(android.R.color.system_accent1_200);
|
||||
mPressedBackgroundColor = getColorAttrDefaultColor(context, NUM_PAD_BACKGROUND_PRESSED);
|
||||
mTextColorPressed = getColorAttrDefaultColor(context, NUM_PAD_PRESSED);
|
||||
|
||||
mBackground.setColor(mNormalBackgroundColor);
|
||||
mTextColorPrimary = isNumPadKey
|
||||
? com.android.settingslib.Utils
|
||||
.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary)
|
||||
: com.android.settingslib.Utils
|
||||
.getColorAttrDefaultColor(context, android.R.attr.textColorPrimaryInverse);
|
||||
mTextColorPressed = com.android.settingslib.Utils
|
||||
.getColorAttrDefaultColor(context, com.android.internal.R.attr.textColorOnAccent);
|
||||
? getColorAttrDefaultColor(context, NUM_PAD_KEY)
|
||||
: getColorAttrDefaultColor(context, NUM_PAD_BUTTON);
|
||||
createAnimators();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,10 +15,12 @@
|
||||
*/
|
||||
package com.android.keyguard;
|
||||
|
||||
import static com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_BUTTON;
|
||||
import static com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_KEY;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.graphics.drawable.VectorDrawable;
|
||||
@@ -27,6 +29,7 @@ import android.view.MotionEvent;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.settingslib.Utils;
|
||||
import com.android.systemui.R;
|
||||
|
||||
/**
|
||||
@@ -95,12 +98,8 @@ public class NumPadButton extends AlphaOptimizedImageButton implements NumPadAni
|
||||
public void reloadColors() {
|
||||
if (mAnimator != null) mAnimator.reloadColors(getContext());
|
||||
|
||||
int textColorResId = mIsTransparentMode ? android.R.attr.textColorPrimary
|
||||
: android.R.attr.textColorPrimaryInverse;
|
||||
int[] customAttrs = {textColorResId};
|
||||
TypedArray a = getContext().obtainStyledAttributes(customAttrs);
|
||||
int imageColor = a.getColor(0, 0);
|
||||
a.recycle();
|
||||
int textColorResId = mIsTransparentMode ? NUM_PAD_KEY : NUM_PAD_BUTTON;
|
||||
int imageColor = Utils.getColorAttrDefaultColor(getContext(), textColorResId);
|
||||
((VectorDrawable) getDrawable()).setTintList(ColorStateList.valueOf(imageColor));
|
||||
}
|
||||
|
||||
@@ -119,7 +118,7 @@ public class NumPadButton extends AlphaOptimizedImageButton implements NumPadAni
|
||||
public void setTransparentMode(boolean isTransparentMode) {
|
||||
mIsTransparentMode = isTransparentMode;
|
||||
if (isTransparentMode) {
|
||||
setBackgroundColor(android.R.color.transparent);
|
||||
setBackgroundColor(getResources().getColor(android.R.color.transparent));
|
||||
} else {
|
||||
setBackground(getContext().getDrawable(R.drawable.num_pad_key_background));
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.android.keyguard;
|
||||
|
||||
import static com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.NUM_PAD_KEY;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.TypedArray;
|
||||
@@ -150,7 +152,7 @@ public class NumPadKey extends ViewGroup implements NumPadAnimationListener {
|
||||
* Reload colors from resources.
|
||||
**/
|
||||
public void reloadColors() {
|
||||
int textColor = Utils.getColorAttr(getContext(), android.R.attr.textColorPrimary)
|
||||
int textColor = Utils.getColorAttr(getContext(), NUM_PAD_KEY)
|
||||
.getDefaultColor();
|
||||
int klondikeColor = Utils.getColorAttr(getContext(), android.R.attr.textColorSecondary)
|
||||
.getDefaultColor();
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.keyguard;
|
||||
|
||||
import static com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.PIN_SHAPES;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.AnimatedVectorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -37,7 +39,7 @@ public class PinShapeHintingView extends LinearLayout implements PinShapeInput {
|
||||
|
||||
private int mPinLength;
|
||||
private int mDotDiameter;
|
||||
private int mColor = Utils.getColorAttr(getContext(), android.R.attr.textColorPrimary)
|
||||
private int mColor = Utils.getColorAttr(getContext(), PIN_SHAPES)
|
||||
.getDefaultColor();
|
||||
private int mPosition = 0;
|
||||
private static final int DEFAULT_PIN_LENGTH = 6;
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.keyguard;
|
||||
|
||||
import static com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.ColorId.PIN_SHAPES;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ValueAnimator;
|
||||
@@ -45,8 +47,7 @@ import com.android.systemui.animation.Interpolators;
|
||||
*/
|
||||
public class PinShapeNonHintingView extends LinearLayout implements PinShapeInput {
|
||||
|
||||
private int mColor = Utils.getColorAttr(getContext(),
|
||||
android.R.attr.textColorPrimary).getDefaultColor();
|
||||
private int mColor = Utils.getColorAttr(getContext(), PIN_SHAPES).getDefaultColor();
|
||||
private int mPosition = 0;
|
||||
private final PinShapeAdapter mPinShapeAdapter;
|
||||
private ValueAnimator mValueAnimator = ValueAnimator.ofFloat(1f, 0f);
|
||||
|
||||
@@ -32,4 +32,15 @@ object KeyguardBouncerConstants {
|
||||
* PIN hinting is enabled
|
||||
*/
|
||||
const val DEFAULT_PIN_LENGTH = 6
|
||||
|
||||
object ColorId {
|
||||
const val TITLE = com.android.internal.R.attr.materialColorOnSurface
|
||||
const val PIN_SHAPES = com.android.internal.R.attr.materialColorOnSurfaceVariant
|
||||
const val NUM_PAD_BACKGROUND = com.android.internal.R.attr.materialColorSurfaceContainerHigh
|
||||
const val NUM_PAD_BACKGROUND_PRESSED = com.android.internal.R.attr.materialColorPrimaryFixed
|
||||
const val NUM_PAD_PRESSED = com.android.internal.R.attr.materialColorOnPrimaryFixed
|
||||
const val NUM_PAD_KEY = com.android.internal.R.attr.materialColorOnSurface
|
||||
const val NUM_PAD_BUTTON = com.android.internal.R.attr.materialColorOnSecondaryFixed
|
||||
const val EMERGENCY_BUTTON = com.android.internal.R.attr.materialColorTertiaryFixed
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user