Renew the highlight state color
Fix: 230283855
Test: visual
Change-Id: I725422518d07a0b0676731bd9da8384ab149ab1b
diff --git a/res/color-night/accent_select_primary_text.xml b/res/color-night/accent_select_primary_text.xml
new file mode 100644
index 0000000..049ddf6
--- /dev/null
+++ b/res/color-night/accent_select_primary_text.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2022 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="?android:attr/textColorPrimaryInverse" />
+</selector>
\ No newline at end of file
diff --git a/res/color-night/accent_select_secondary_text.xml b/res/color-night/accent_select_secondary_text.xml
new file mode 100644
index 0000000..6b7b4f2
--- /dev/null
+++ b/res/color-night/accent_select_secondary_text.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2022 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="?android:attr/textColorSecondaryInverse" />
+</selector>
\ No newline at end of file
diff --git a/res/color/accent_select_background.xml b/res/color/accent_select_background.xml
new file mode 100644
index 0000000..5dab723
--- /dev/null
+++ b/res/color/accent_select_background.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2022 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="@android:color/system_accent2_500" android:lStar="80" />
+</selector>
\ No newline at end of file
diff --git a/res/color/accent_select_primary_text.xml b/res/color/accent_select_primary_text.xml
new file mode 100644
index 0000000..f790d42
--- /dev/null
+++ b/res/color/accent_select_primary_text.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2022 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="?android:attr/textColorPrimary" />
+</selector>
\ No newline at end of file
diff --git a/res/color/accent_select_secondary_text.xml b/res/color/accent_select_secondary_text.xml
new file mode 100644
index 0000000..25d24a8
--- /dev/null
+++ b/res/color/accent_select_secondary_text.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2022 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="?android:attr/textColorSecondary" />
+</selector>
\ No newline at end of file
diff --git a/res/drawable/homepage_highlighted_item_background.xml b/res/drawable/homepage_highlighted_item_background.xml
index d54ff60..7e0dea5 100644
--- a/res/drawable/homepage_highlighted_item_background.xml
+++ b/res/drawable/homepage_highlighted_item_background.xml
@@ -17,7 +17,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
- android:color="?android:attr/textColorPrimary" />
+ android:color="@color/accent_select_background" />
<corners
android:radius="@dimen/homepage_preference_corner_radius" />
</shape>
\ No newline at end of file
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 2988ddc..f996444 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -85,7 +85,6 @@
import android.text.format.DateUtils;
import android.text.style.TtsSpan;
import android.util.ArraySet;
-import android.util.FeatureFlagUtils;
import android.util.IconDrawableFactory;
import android.util.Log;
import android.view.LayoutInflater;
@@ -1220,7 +1219,7 @@
*/
@ColorInt
public static int getHomepageIconColor(Context context) {
- return getColorAttrDefaultColor(context, android.R.attr.textColorSecondary);
+ return getColorAttrDefaultColor(context, android.R.attr.textColorPrimary);
}
/**
@@ -1228,6 +1227,6 @@
*/
@ColorInt
public static int getHomepageIconColorHighlight(Context context) {
- return getColorAttrDefaultColor(context, android.R.attr.textColorSecondaryInverse);
+ return context.getColor(R.color.accent_select_primary_text);
}
}
diff --git a/src/com/android/settings/widget/HighlightableTopLevelPreferenceAdapter.java b/src/com/android/settings/widget/HighlightableTopLevelPreferenceAdapter.java
index 338be48..3cc7ef2 100644
--- a/src/com/android/settings/widget/HighlightableTopLevelPreferenceAdapter.java
+++ b/src/com/android/settings/widget/HighlightableTopLevelPreferenceAdapter.java
@@ -78,12 +78,10 @@
Context context = preferenceGroup.getContext();
mTitleColorNormal = Utils.getColorAttrDefaultColor(context,
android.R.attr.textColorPrimary);
- mTitleColorHighlight = Utils.getColorAttrDefaultColor(context,
- android.R.attr.textColorPrimaryInverse);
+ mTitleColorHighlight = context.getColor(R.color.accent_select_primary_text);
mSummaryColorNormal = Utils.getColorAttrDefaultColor(context,
android.R.attr.textColorSecondary);
- mSummaryColorHighlight = Utils.getColorAttrDefaultColor(context,
- android.R.attr.textColorSecondaryInverse);
+ mSummaryColorHighlight = context.getColor(R.color.accent_select_secondary_text);
mIconColorNormal = Utils.getHomepageIconColor(context);
mIconColorHighlight = Utils.getHomepageIconColorHighlight(context);
}