diff options
| author | 2023-04-25 16:41:16 +0000 | |
|---|---|---|
| committer | 2023-04-25 16:41:16 +0000 | |
| commit | 2873c0170fd5d5f21d4a1f3e70cba1e7cae40fbc (patch) | |
| tree | 8e9303bbc18a02b8977fa7d5c6bc1c881b4faff1 | |
| parent | 8e71260236a655399065b05eef16dcb3a6889bfc (diff) | |
| parent | 71365f0e0a15ed43a1b17ea700f1d4e41e366d4a (diff) | |
Merge changes I1f9a353c,I84a3db27 into udc-dev
* changes:
Release activity starter to team food.
Update bouncer colors for U.
17 files changed, 68 insertions, 38 deletions
diff --git a/packages/SystemUI/res-keyguard/color/numpad_key_color_secondary.xml b/packages/SystemUI/res-keyguard/color/numpad_key_color_secondary.xml index 08c66a24348c..47641ee64ee1 100644 --- a/packages/SystemUI/res-keyguard/color/numpad_key_color_secondary.xml +++ b/packages/SystemUI/res-keyguard/color/numpad_key_color_secondary.xml @@ -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>
\ No newline at end of file diff --git a/packages/SystemUI/res-keyguard/drawable/kg_emergency_button_background.xml b/packages/SystemUI/res-keyguard/drawable/kg_emergency_button_background.xml index 07642736869c..5e7cf3ee41fb 100644 --- a/packages/SystemUI/res-keyguard/drawable/kg_emergency_button_background.xml +++ b/packages/SystemUI/res-keyguard/drawable/kg_emergency_button_background.xml @@ -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> diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_esim_area.xml b/packages/SystemUI/res-keyguard/layout/keyguard_esim_area.xml index 67fd5b9a78bd..83736e9d9473 100644 --- a/packages/SystemUI/res-keyguard/layout/keyguard_esim_area.xml +++ b/packages/SystemUI/res-keyguard/layout/keyguard_esim_area.xml @@ -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" /> diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_security_container_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_security_container_view.xml index 426cfafb190e..751b07ae9a6e 100644 --- a/packages/SystemUI/res-keyguard/layout/keyguard_security_container_view.xml +++ b/packages/SystemUI/res-keyguard/layout/keyguard_security_container_view.xml @@ -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 diff --git a/packages/SystemUI/res-keyguard/values/styles.xml b/packages/SystemUI/res-keyguard/values/styles.xml index 04dffb6e8c52..4fc411eaea9d 100644 --- a/packages/SystemUI/res-keyguard/values/styles.xml +++ b/packages/SystemUI/res-keyguard/values/styles.xml @@ -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> diff --git a/packages/SystemUI/res/layout/super_notification_shade.xml b/packages/SystemUI/res/layout/super_notification_shade.xml index fe9542b7aed6..d9fe949bb327 100644 --- a/packages/SystemUI/res/layout/super_notification_shade.xml +++ b/packages/SystemUI/res/layout/super_notification_shade.xml @@ -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" diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index a2eba81155c7..0aa880fe6d88 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -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> diff --git a/packages/SystemUI/src/com/android/keyguard/BouncerKeyguardMessageArea.kt b/packages/SystemUI/src/com/android/keyguard/BouncerKeyguardMessageArea.kt index f59bf8e766fe..62f4f2282e66 100644 --- a/packages/SystemUI/src/com/android/keyguard/BouncerKeyguardMessageArea.kt +++ b/packages/SystemUI/src/com/android/keyguard/BouncerKeyguardMessageArea.kt @@ -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() } diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java index 4a37fb510cf9..b88d85c843e4 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java @@ -334,6 +334,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) { @@ -781,6 +786,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. */ diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimInputView.kt b/packages/SystemUI/src/com/android/keyguard/KeyguardSimInputView.kt index b4bfca1185f4..3fc39afe5d0f 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimInputView.kt +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimInputView.kt @@ -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) diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadAnimator.java b/packages/SystemUI/src/com/android/keyguard/NumPadAnimator.java index ad669099284f..c6c7113d7f9a 100644 --- a/packages/SystemUI/src/com/android/keyguard/NumPadAnimator.java +++ b/packages/SystemUI/src/com/android/keyguard/NumPadAnimator.java @@ -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(); } diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadButton.java b/packages/SystemUI/src/com/android/keyguard/NumPadButton.java index 11c329e9811d..6ae80a62891b 100644 --- a/packages/SystemUI/src/com/android/keyguard/NumPadButton.java +++ b/packages/SystemUI/src/com/android/keyguard/NumPadButton.java @@ -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)); } diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java index 7c7680afe368..e22fc300ede5 100644 --- a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java +++ b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java @@ -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(); diff --git a/packages/SystemUI/src/com/android/keyguard/PinShapeHintingView.java b/packages/SystemUI/src/com/android/keyguard/PinShapeHintingView.java index fc5c254fdf29..32f06dcdbf20 100644 --- a/packages/SystemUI/src/com/android/keyguard/PinShapeHintingView.java +++ b/packages/SystemUI/src/com/android/keyguard/PinShapeHintingView.java @@ -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; diff --git a/packages/SystemUI/src/com/android/keyguard/PinShapeNonHintingView.java b/packages/SystemUI/src/com/android/keyguard/PinShapeNonHintingView.java index 14810d9baf02..4aeab970e2f7 100644 --- a/packages/SystemUI/src/com/android/keyguard/PinShapeNonHintingView.java +++ b/packages/SystemUI/src/com/android/keyguard/PinShapeNonHintingView.java @@ -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); diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt index b29066f8e927..942730344f20 100644 --- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt +++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt @@ -684,5 +684,6 @@ object Flags { // TODO(b/278761837): Tracking Bug @JvmField - val USE_NEW_ACTIVITY_STARTER = unreleasedFlag(2801, name = "use_new_activity_starter") + val USE_NEW_ACTIVITY_STARTER = unreleasedFlag(2801, name = "use_new_activity_starter", + teamfood = true) } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/shared/constants/KeyguardBouncerConstants.kt b/packages/SystemUI/src/com/android/systemui/keyguard/shared/constants/KeyguardBouncerConstants.kt index 3b3ec39d0209..c45faf0ba961 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/shared/constants/KeyguardBouncerConstants.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/shared/constants/KeyguardBouncerConstants.kt @@ -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 + } } |