diff --git a/packages/SystemUI/res/drawable/wallet_action_button_bg.xml b/packages/SystemUI/res/drawable/wallet_action_button_bg.xml index bf7625fa956fd..925ab67d5ec6f 100644 --- a/packages/SystemUI/res/drawable/wallet_action_button_bg.xml +++ b/packages/SystemUI/res/drawable/wallet_action_button_bg.xml @@ -14,13 +14,14 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> - + - + android:color="?androidprv:attr/colorAccentPrimary"/> + diff --git a/packages/SystemUI/res/drawable/wallet_empty_state_bg.xml b/packages/SystemUI/res/drawable/wallet_empty_state_bg.xml index f52889adaa536..b203228c816f7 100644 --- a/packages/SystemUI/res/drawable/wallet_empty_state_bg.xml +++ b/packages/SystemUI/res/drawable/wallet_empty_state_bg.xml @@ -15,7 +15,7 @@ ~ limitations under the License. --> + xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"> @@ -26,7 +26,7 @@ + android:color="?androidprv:attr/colorAccentPrimary" /> diff --git a/packages/SystemUI/res/layout/wallet_empty_state.xml b/packages/SystemUI/res/layout/wallet_empty_state.xml index 3ca0f73c81c8d..cc2e781a8f13b 100644 --- a/packages/SystemUI/res/layout/wallet_empty_state.xml +++ b/packages/SystemUI/res/layout/wallet_empty_state.xml @@ -16,7 +16,8 @@ ** limitations under the License. */ --> - + @@ -65,7 +67,7 @@ android:paddingVertical="@dimen/wallet_button_vertical_padding" android:paddingHorizontal="@dimen/wallet_button_horizontal_padding" android:background="@drawable/wallet_action_button_bg" - android:textColor="@color/wallet_white" + android:textColor="?androidprv:attr/textColorPrimaryInverse" android:textAlignment="center" android:visibility="gone"/> @@ -83,7 +85,7 @@ android:paddingHorizontal="@dimen/wallet_button_horizontal_padding" android:background="@drawable/wallet_app_button_bg" android:text="@string/wallet_app_button_label" - android:textColor="@color/GM2_blue_600" + android:textColor="?androidprv:attr/colorAccentPrimary" android:textAlignment="center" android:layout_marginVertical="24dp"/> diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 08a2e196214c2..8d2a82cb1da1a 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -286,7 +286,5 @@ #26FFFFFF - #FFFFFF #33FFFFFF - @color/GM2_grey_900 diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index c82f2279c3d68..9fa63dd1613db 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -878,12 +878,12 @@ - diff --git a/packages/SystemUI/src/com/android/systemui/wallet/ui/DotIndicatorDecoration.java b/packages/SystemUI/src/com/android/systemui/wallet/ui/DotIndicatorDecoration.java index 644addfef1d1d..5e9bae98a17e7 100644 --- a/packages/SystemUI/src/com/android/systemui/wallet/ui/DotIndicatorDecoration.java +++ b/packages/SystemUI/src/com/android/systemui/wallet/ui/DotIndicatorDecoration.java @@ -20,13 +20,10 @@ import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; -import android.text.TextPaint; import android.util.MathUtils; import android.view.View; -import android.widget.TextView; import androidx.annotation.ColorInt; -import androidx.core.content.ContextCompat; import androidx.core.graphics.ColorUtils; import androidx.recyclerview.widget.RecyclerView; @@ -39,12 +36,10 @@ final class DotIndicatorDecoration extends RecyclerView.ItemDecoration { @ColorInt private final int mUnselectedColor; @ColorInt private final int mSelectedColor; private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); - private final TextPaint mTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); private WalletCardCarousel mCardCarousel; DotIndicatorDecoration(Context context) { super(); - mUnselectedRadius = context.getResources().getDimensionPixelSize( R.dimen.card_carousel_dot_unselected_radius); @@ -53,13 +48,8 @@ final class DotIndicatorDecoration extends RecyclerView.ItemDecoration { R.dimen.card_carousel_dot_selected_radius); mDotMargin = context.getResources().getDimensionPixelSize(R.dimen.card_carousel_dot_margin); - TextView textView = new TextView(context); - mTextPaint.set(textView.getPaint()); - // Text color is not copied from text appearance. - mTextPaint.setColor(ContextCompat.getColor(context, R.color.GM2_blue_600)); - - mUnselectedColor = ContextCompat.getColor(context, R.color.GM2_grey_300); - mSelectedColor = ContextCompat.getColor(context, R.color.GM2_blue_600); + mUnselectedColor = context.getColor(com.android.internal.R.color.system_neutral1_300); + mSelectedColor = context.getColor(com.android.internal.R.color.system_neutral1_0); } @Override @@ -107,9 +97,9 @@ final class DotIndicatorDecoration extends RecyclerView.ItemDecoration { int i = isLayoutLtr() ? itemsDrawn : itemCount - itemsDrawn - 1; if (isSelectedItem(i)) { - drawSelectedDot(canvas, interpolatedProgress, i); + drawSelectedDot(canvas, interpolatedProgress); } else if (isNextItemInScrollingDirection(i)) { - drawFadingUnselectedDot(canvas, interpolatedProgress, i); + drawFadingUnselectedDot(canvas, interpolatedProgress); } else { drawUnselectedDot(canvas); } @@ -121,7 +111,7 @@ final class DotIndicatorDecoration extends RecyclerView.ItemDecoration { this.mCardCarousel = null; // No need to hold a reference. } - private void drawSelectedDot(Canvas canvas, float progress, int position) { + private void drawSelectedDot(Canvas canvas, float progress) { // Divide progress by 2 because the other half of the animation is done by // drawFadingUnselectedDot. mPaint.setColor( @@ -132,13 +122,13 @@ final class DotIndicatorDecoration extends RecyclerView.ItemDecoration { canvas.translate(radius * 2, 0); } - private void drawFadingUnselectedDot(Canvas canvas, float progress, int position) { + private void drawFadingUnselectedDot(Canvas canvas, float progress) { // Divide progress by 2 because the first half of the animation is done by drawSelectedDot. int blendedColor = ColorUtils.blendARGB( mUnselectedColor, mSelectedColor, progress / 2); mPaint.setColor(getTransitionAdjustedColor(blendedColor)); - float radius = MathUtils.lerp(mSelectedRadius, mUnselectedRadius, progress / 2); + float radius = MathUtils.lerp(mUnselectedRadius, mSelectedColor, progress / 2); canvas.drawCircle(radius, 0, radius, mPaint); canvas.translate(radius * 2, 0); } diff --git a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java index ac8b16a2206d5..66bd48b9d188c 100644 --- a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java +++ b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java @@ -17,6 +17,7 @@ package com.android.systemui.wallet.ui; import android.graphics.Color; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Handler; import android.service.quickaccesswallet.QuickAccessWalletClient; @@ -95,7 +96,7 @@ public class WalletActivity extends LifecycleActivity { } setTitle(""); getActionBar().setDisplayHomeAsUpEnabled(true); - getActionBar().setHomeAsUpIndicator(R.drawable.ic_close); + getActionBar().setHomeAsUpIndicator(getHomeIndicatorDrawable()); getActionBar().setHomeActionContentDescription(R.string.accessibility_desc_close); WalletView walletView = requireViewById(R.id.wallet_view); mWalletScreenController = new WalletScreenController( @@ -175,4 +176,10 @@ public class WalletActivity extends LifecycleActivity { mWalletScreenController.onDismissed(); super.onDestroy(); } + + private Drawable getHomeIndicatorDrawable() { + Drawable drawable = getDrawable(R.drawable.ic_close); + drawable.setTint(getColor(com.android.internal.R.color.system_neutral1_300)); + return drawable; + } } diff --git a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java index c547bb3466173..dbb99d37980db 100644 --- a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java +++ b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletView.java @@ -37,6 +37,7 @@ import android.widget.ImageView; import android.widget.TextView; import com.android.internal.annotations.VisibleForTesting; +import com.android.settingslib.Utils; import com.android.systemui.R; import java.util.List; @@ -100,7 +101,7 @@ public class WalletView extends FrameLayout implements WalletCardCarousel.OnCard public void onCardScroll(WalletCardViewInfo centerCard, WalletCardViewInfo nextCard, float percentDistanceFromCenter) { CharSequence centerCardText = getLabelText(centerCard); - Drawable centerCardIcon = centerCard.getIcon(); + Drawable centerCardIcon = getHeaderIcon(mContext, centerCard); if (!TextUtils.equals(mCenterCardText, centerCardText)) { mCenterCardText = centerCardText; mCardLabel.setText(centerCardText); @@ -221,11 +222,27 @@ public class WalletView extends FrameLayout implements WalletCardCarousel.OnCard } private void renderHeaderIconAndActionButton(WalletCardViewInfo walletCard, boolean isLocked) { - mIcon.setImageDrawable(walletCard.getIcon()); - mIcon.setVisibility(VISIBLE); + Drawable icon = getHeaderIcon(mContext, walletCard); + if (icon != null) { + mIcon.setImageDrawable(walletCard.getIcon()); + mIcon.setVisibility(VISIBLE); + } else { + mIcon.setVisibility(INVISIBLE); + } renderActionButton(walletCard, isLocked); } + @Nullable + private static Drawable getHeaderIcon(Context context, WalletCardViewInfo walletCard) { + Drawable icon = walletCard.getIcon(); + if (icon != null) { + icon.setTint( + Utils.getColorAttrDefaultColor( + context, com.android.internal.R.attr.colorAccentPrimary)); + } + return icon; + } + private void renderActionButton(WalletCardViewInfo walletCard, boolean isDeviceLocked) { CharSequence actionButtonText = getActionButtonText(walletCard); if (isDeviceLocked) {