summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/drawable/round_background_bottom_selected.xml37
-rw-r--r--res/drawable/round_background_center_selected.xml31
-rw-r--r--res/drawable/round_background_selected.xml34
-rw-r--r--res/drawable/round_background_top_selected.xml34
-rw-r--r--src/com/android/settings/core/RoundCornerPreferenceAdapter.java21
-rw-r--r--src/com/android/settings/widget/HighlightableTopLevelPreferenceAdapter.java17
6 files changed, 170 insertions, 4 deletions
diff --git a/res/drawable/round_background_bottom_selected.xml b/res/drawable/round_background_bottom_selected.xml
new file mode 100644
index 00000000000..4033b50de6d
--- /dev/null
+++ b/res/drawable/round_background_bottom_selected.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2025 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.
+ -->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?android:colorControlHighlight">
+ <item
+ android:start="?android:attr/listPreferredItemPaddingStart"
+ android:end="?android:attr/listPreferredItemPaddingEnd"
+ android:top="2dp"
+ android:bottom="16dp">
+ <shape android:shape="rectangle">
+ <solid
+ android:color="@color/settingslib_materialColorSurfaceContainer" />
+ <corners
+ android:topLeftRadius="4dp"
+ android:bottomLeftRadius="@dimen/settingslib_preference_corner_radius"
+ android:topRightRadius="4dp"
+ android:bottomRightRadius="@dimen/settingslib_preference_corner_radius" />
+ <padding
+ android:bottom="16dp"/>
+ </shape>
+ </item>
+</ripple>
diff --git a/res/drawable/round_background_center_selected.xml b/res/drawable/round_background_center_selected.xml
new file mode 100644
index 00000000000..1de6de2571f
--- /dev/null
+++ b/res/drawable/round_background_center_selected.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2025 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.
+ -->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?android:colorControlHighlight">
+ <item
+ android:start="?android:attr/listPreferredItemPaddingStart"
+ android:end="?android:attr/listPreferredItemPaddingEnd"
+ android:top="2dp">
+ <shape android:shape="rectangle">
+ <solid
+ android:color="@color/settingslib_materialColorSurfaceContainer" />
+ <corners
+ android:radius="4dp" />
+ </shape>
+ </item>
+</ripple>
diff --git a/res/drawable/round_background_selected.xml b/res/drawable/round_background_selected.xml
new file mode 100644
index 00000000000..382cfb46121
--- /dev/null
+++ b/res/drawable/round_background_selected.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2025 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.
+ -->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?android:colorControlHighlight">
+ <item
+ android:start="?android:attr/listPreferredItemPaddingStart"
+ android:end="?android:attr/listPreferredItemPaddingEnd"
+ android:top="2dp"
+ android:bottom="16dp">
+ <shape android:shape="rectangle">
+ <solid
+ android:color="@color/settingslib_materialColorSurfaceContainer" />
+ <corners
+ android:radius="@dimen/settingslib_preference_corner_radius" />
+ <padding
+ android:bottom="16dp"/>
+ </shape>
+ </item>
+</ripple>
diff --git a/res/drawable/round_background_top_selected.xml b/res/drawable/round_background_top_selected.xml
new file mode 100644
index 00000000000..ffb312f1618
--- /dev/null
+++ b/res/drawable/round_background_top_selected.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2025 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.
+ -->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?android:colorControlHighlight">
+ <item
+ android:start="?android:attr/listPreferredItemPaddingStart"
+ android:end="?android:attr/listPreferredItemPaddingEnd"
+ android:top="2dp">
+ <shape android:shape="rectangle">
+ <solid
+ android:color="@color/settingslib_materialColorSurfaceContainer" />
+ <corners
+ android:topLeftRadius="@dimen/settingslib_preference_corner_radius"
+ android:bottomLeftRadius="4dp"
+ android:topRightRadius="@dimen/settingslib_preference_corner_radius"
+ android:bottomRightRadius="4dp" />
+ </shape>
+ </item>
+</ripple>
diff --git a/src/com/android/settings/core/RoundCornerPreferenceAdapter.java b/src/com/android/settings/core/RoundCornerPreferenceAdapter.java
index dcafad6cf6f..56feda3afe9 100644
--- a/src/com/android/settings/core/RoundCornerPreferenceAdapter.java
+++ b/src/com/android/settings/core/RoundCornerPreferenceAdapter.java
@@ -29,6 +29,7 @@ import androidx.preference.PreferenceGroupAdapter;
import androidx.preference.PreferenceViewHolder;
import com.android.settings.flags.Flags;
+import com.android.settingslib.widget.SettingsThemeHelper;
import com.android.settingslib.widget.theme.R;
import java.util.ArrayList;
@@ -84,21 +85,33 @@ public class RoundCornerPreferenceAdapter extends PreferenceGroupAdapter {
if (((CornerType & ROUND_CORNER_TOP) != 0) && ((CornerType & ROUND_CORNER_BOTTOM) == 0)) {
// the first
- return isSelected ? R.drawable.settingslib_round_background_top_selected
+ return isSelected
+ ? SettingsThemeHelper.isExpressiveTheme(mPreferenceGroup.getContext())
+ ? R.drawable.settingslib_round_background_top_selected
+ : com.android.settings.R.drawable.round_background_top_selected
: R.drawable.settingslib_round_background_top;
} else if (((CornerType & ROUND_CORNER_BOTTOM) != 0)
&& ((CornerType & ROUND_CORNER_TOP) == 0)) {
// the last
- return isSelected ? R.drawable.settingslib_round_background_bottom_selected
+ return isSelected
+ ? SettingsThemeHelper.isExpressiveTheme(mPreferenceGroup.getContext())
+ ? R.drawable.settingslib_round_background_bottom_selected
+ : com.android.settings.R.drawable.round_background_bottom_selected
: R.drawable.settingslib_round_background_bottom;
} else if (((CornerType & ROUND_CORNER_TOP) != 0)
&& ((CornerType & ROUND_CORNER_BOTTOM) != 0)) {
// the only one preference
- return isSelected ? R.drawable.settingslib_round_background_selected
+ return isSelected
+ ? SettingsThemeHelper.isExpressiveTheme(mPreferenceGroup.getContext())
+ ? R.drawable.settingslib_round_background_selected
+ : com.android.settings.R.drawable.round_background_selected
: R.drawable.settingslib_round_background;
} else {
// in the center
- return isSelected ? R.drawable.settingslib_round_background_center_selected
+ return isSelected
+ ? SettingsThemeHelper.isExpressiveTheme(mPreferenceGroup.getContext())
+ ? R.drawable.settingslib_round_background_center_selected
+ : com.android.settings.R.drawable.round_background_center_selected
: R.drawable.settingslib_round_background_center;
}
}
diff --git a/src/com/android/settings/widget/HighlightableTopLevelPreferenceAdapter.java b/src/com/android/settings/widget/HighlightableTopLevelPreferenceAdapter.java
index 15e83de9149..50417367705 100644
--- a/src/com/android/settings/widget/HighlightableTopLevelPreferenceAdapter.java
+++ b/src/com/android/settings/widget/HighlightableTopLevelPreferenceAdapter.java
@@ -38,6 +38,7 @@ import com.android.settings.Utils;
import com.android.settings.core.RoundCornerPreferenceAdapter;
import com.android.settings.flags.Flags;
import com.android.settings.homepage.SettingsHomepageActivity;
+import com.android.settingslib.widget.SettingsThemeHelper;
/**
* Adapter for highlighting top level preferences
@@ -243,6 +244,14 @@ public class HighlightableTopLevelPreferenceAdapter extends RoundCornerPreferenc
if (Flags.homepageRevamp()) {
@DrawableRes int bgRes = getRoundCornerDrawableRes(position, true /*isSelected*/);
v.setBackgroundResource(bgRes);
+ Context context = v.getContext();
+ if (SettingsThemeHelper.isExpressiveTheme(context)) {
+ TextView title = v.findViewById(android.R.id.title);
+ if (title != null) {
+ title.setTextAppearance(context, com.android.settingslib.widget.theme.R.style
+ .TextAppearance_SettingsLib_TitleMedium_Emphasized);
+ }
+ }
} else {
v.setBackgroundResource(RES_HIGHLIGHTED_BACKGROUND);
((TextView) v.findViewById(android.R.id.title)).setTextColor(mTitleColorHighlight);
@@ -259,6 +268,14 @@ public class HighlightableTopLevelPreferenceAdapter extends RoundCornerPreferenc
if (Flags.homepageRevamp()) {
@DrawableRes int bgRes = getRoundCornerDrawableRes(position, false /*isSelected*/);
v.setBackgroundResource(bgRes);
+ Context context = v.getContext();
+ if (SettingsThemeHelper.isExpressiveTheme(context)) {
+ TextView title = v.findViewById(android.R.id.title);
+ if (title != null) {
+ title.setTextAppearance(context, com.android.settingslib.widget.theme.R.style
+ .TextAppearance_SettingsLib_TitleMedium);
+ }
+ }
} else {
v.setBackgroundResource(RES_NORMAL_BACKGROUND);
((TextView) v.findViewById(android.R.id.title)).setTextColor(mTitleColorNormal);