[UI][Modifier key remapping] Use new color token.

Chnage materialColorPrimaryContainer to materialColorPrimary
Change materialColorSurfaceContainerHigh to
materialColorSurfaceContainerHighest

Bug: 277712746
Test: manual
Change-Id: I7b23850a24718d28020f6a7b13119c69f50861b1
This commit is contained in:
danielwbhuang
2023-04-25 16:58:40 +08:00
committed by Daniel Huang
parent 5ae083b952
commit 077293b72d
8 changed files with 15 additions and 15 deletions

View File

@@ -21,7 +21,7 @@
android:height="24.0dp" android:height="24.0dp"
android:viewportWidth="24.0" android:viewportWidth="24.0"
android:viewportHeight="24.0" android:viewportHeight="24.0"
android:tint="?androidprv:attr/materialColorPrimaryContainer"> android:tint="?androidprv:attr/materialColorPrimary">
<path <path
android:fillColor="@android:color/white" android:fillColor="@android:color/white"
android:pathData="M18,4C13.58,0.69 7.31,1.58 4,6V4H2v6h6V8H5.09c1.44,-2.47 4.09,-3.98 6.94,-3.97c4.42,0.02 7.99,3.61 7.97,8.03s-3.61,7.99 -8.03,7.97C7.55,20.01 3.98,16.42 4,12H2c0,3.15 1.48,6.11 4,8c4.42,3.31 10.69,2.42 14,-2C23.31,13.58 22.42,7.31 18,4z"/> android:pathData="M18,4C13.58,0.69 7.31,1.58 4,6V4H2v6h6V8H5.09c1.44,-2.47 4.09,-3.98 6.94,-3.97c4.42,0.02 7.99,3.61 7.97,8.03s-3.61,7.99 -8.03,7.97C7.55,20.01 3.98,16.42 4,12H2c0,3.15 1.48,6.11 4,8c4.42,3.31 10.69,2.42 14,-2C23.31,13.58 22.42,7.31 18,4z"/>

View File

@@ -25,7 +25,7 @@
<solid android:color="@android:color/transparent"/> <solid android:color="@android:color/transparent"/>
<stroke <stroke
android:width="1dp" android:width="1dp"
android:color="?androidprv:attr/materialColorPrimaryContainer"/> android:color="?androidprv:attr/materialColorPrimary"/>
</shape> </shape>
</item> </item>
</ripple> </ripple>

View File

@@ -22,7 +22,7 @@
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="24dp"/> <corners android:radius="24dp"/>
<solid android:color="?androidprv:attr/colorAccentPrimary"/> <solid android:color="?androidprv:attr/materialColorPrimary"/>
</shape> </shape>
</item> </item>
</ripple> </ripple>

View File

@@ -22,7 +22,7 @@
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="24dp"/> <corners android:radius="24dp"/>
<solid android:color="?androidprv:attr/materialColorSurfaceContainerHigh"/> <solid android:color="?androidprv:attr/materialColorSurfaceContainerHighest"/>
</shape> </shape>
</item> </item>
</ripple> </ripple>

View File

@@ -32,7 +32,7 @@
android:ellipsize="marquee" android:ellipsize="marquee"
android:fadingEdge="horizontal" android:fadingEdge="horizontal"
android:src="@drawable/ic_check_24dp" android:src="@drawable/ic_check_24dp"
android:tint="?androidprv:attr/materialColorPrimaryContainer"/> android:tint="?androidprv:attr/materialColorPrimary"/>
<TextView <TextView
android:id="@+id/modifier_key_text" android:id="@+id/modifier_key_text"

View File

@@ -139,7 +139,7 @@ public class ModifierKeysPickerDialogFragment extends DialogFragment {
} else { } else {
itemSummary = new SpannableString(selectedItem); itemSummary = new SpannableString(selectedItem);
itemSummary.setSpan( itemSummary.setSpan(
new ForegroundColorSpan(getColorOfColorAccentPrimaryVariant()), new ForegroundColorSpan(getColorOfMaterialColorPrimary()),
0, itemSummary.length(), 0); 0, itemSummary.length(), 0);
int[] fromKeys = mRemappableKeyMap.get(mKeyDefaultName); int[] fromKeys = mRemappableKeyMap.get(mKeyDefaultName);
int[] toKeys = mRemappableKeyMap.get(selectedItem); int[] toKeys = mRemappableKeyMap.get(selectedItem);
@@ -222,7 +222,7 @@ public class ModifierKeysPickerDialogFragment extends DialogFragment {
textView.setText(mList.get(i)); textView.setText(mList.get(i));
if (mCurrentItem == i) { if (mCurrentItem == i) {
mKeyFocus = mList.get(i); mKeyFocus = mList.get(i);
textView.setTextColor(getColorOfColorAccentPrimaryVariant()); textView.setTextColor(getColorOfMaterialColorPrimary());
checkIcon.setImageAlpha(255); checkIcon.setImageAlpha(255);
view.setBackground( view.setBackground(
mActivity.getDrawable(R.drawable.modifier_key_lisetview_background)); mActivity.getDrawable(R.drawable.modifier_key_lisetview_background));
@@ -251,8 +251,8 @@ public class ModifierKeysPickerDialogFragment extends DialogFragment {
return Utils.getColorAttrDefaultColor(mActivity, android.R.attr.textColorSecondary); return Utils.getColorAttrDefaultColor(mActivity, android.R.attr.textColorSecondary);
} }
private int getColorOfColorAccentPrimaryVariant() { private int getColorOfMaterialColorPrimary() {
return Utils.getColorAttrDefaultColor( return Utils.getColorAttrDefaultColor(
mActivity, com.android.internal.R.attr.materialColorPrimaryContainer); mActivity, com.android.internal.R.attr.materialColorPrimary);
} }
} }

View File

@@ -150,14 +150,14 @@ public class ModifierKeysPreferenceController extends BasePreferenceController {
private Spannable changeSummaryColor(String summary) { private Spannable changeSummaryColor(String summary) {
Spannable spannableSummary = new SpannableString(summary); Spannable spannableSummary = new SpannableString(summary);
spannableSummary.setSpan( spannableSummary.setSpan(
new ForegroundColorSpan(getColorOfColorAccentPrimaryVariant()), new ForegroundColorSpan(getColorOfMaterialColorPrimary()),
0, spannableSummary.length(), 0); 0, spannableSummary.length(), 0);
return spannableSummary; return spannableSummary;
} }
private int getColorOfColorAccentPrimaryVariant() { private int getColorOfMaterialColorPrimary() {
return Utils.getColorAttrDefaultColor( return Utils.getColorAttrDefaultColor(
mContext, com.android.internal.R.attr.materialColorPrimaryContainer); mContext, com.android.internal.R.attr.materialColorPrimary);
} }
private static boolean isCtrl(int keyCode) { private static boolean isCtrl(int keyCode) {

View File

@@ -82,13 +82,13 @@ public class ModifierKeysRestorePreferenceController extends BasePreferenceContr
Spannable title = new SpannableString( Spannable title = new SpannableString(
mParent.getActivity().getString(R.string.modifier_keys_reset_title)); mParent.getActivity().getString(R.string.modifier_keys_reset_title));
title.setSpan( title.setSpan(
new ForegroundColorSpan(getColorOfColorAccentPrimaryVariant()), new ForegroundColorSpan(getColorOfMaterialColorPrimary()),
0, title.length(), 0); 0, title.length(), 0);
preference.setTitle(title); preference.setTitle(title);
} }
private int getColorOfColorAccentPrimaryVariant() { private int getColorOfMaterialColorPrimary() {
return Utils.getColorAttrDefaultColor( return Utils.getColorAttrDefaultColor(
mParent.getActivity(), com.android.internal.R.attr.materialColorPrimaryContainer); mParent.getActivity(), com.android.internal.R.attr.materialColorPrimary);
} }
} }