Skip to content

Commit 33b1c33

Browse files
pekingmekendrickumstattd
authored andcommitted
[TopAppBar] Overrode the colorControlHighlight to reflect the Material state layer.
PiperOrigin-RevId: 721842600
1 parent 43d89ad commit 33b1c33

File tree

7 files changed

+82
-4
lines changed

7 files changed

+82
-4
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2025 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
18+
<item android:alpha="@dimen/m3_ripple_pressed_alpha" android:color="?attr/colorOnSurfaceVariant" android:state_pressed="true"/>
19+
<item android:alpha="@dimen/m3_ripple_focused_alpha" android:color="?attr/colorOnSurfaceVariant" android:state_focused="true"/>
20+
<item android:alpha="@dimen/m3_ripple_hovered_alpha" android:color="?attr/colorOnSurfaceVariant" android:state_hovered="true"/>
21+
<item android:alpha="@dimen/m3_ripple_default_alpha" android:color="?attr/colorOnSurfaceVariant"/>
22+
</selector>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2025 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<resources>
18+
<style name="Base.Theme.Material3.Light.Dialog" parent="Base.V23.Theme.Material3.Light.Dialog"/>
19+
<style name="Base.Theme.Material3.Dark.Dialog" parent="Base.V23.Theme.Material3.Dark.Dialog"/>
20+
</resources>

lib/java/com/google/android/material/dialog/res/values-v24/themes_base.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
~ limitations under the License.
1616
-->
1717
<resources>
18-
<style name="Base.V24.Theme.Material3.Light.Dialog" parent="Base.V14.Theme.Material3.Light.Dialog">
18+
<style name="Base.V24.Theme.Material3.Light.Dialog" parent="Base.V23.Theme.Material3.Light.Dialog">
1919
<item name="android:contextPopupMenuStyle">@style/Widget.Material3.PopupMenu.ContextMenu</item>
2020
</style>
2121

22-
<style name="Base.V24.Theme.Material3.Dark.Dialog" parent="Base.V14.Theme.Material3.Dark.Dialog">
22+
<style name="Base.V24.Theme.Material3.Dark.Dialog" parent="Base.V23.Theme.Material3.Dark.Dialog">
2323
<item name="android:contextPopupMenuStyle">@style/Widget.Material3.PopupMenu.ContextMenu</item>
2424
</style>
2525

lib/java/com/google/android/material/dialog/res/values/themes_base.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,14 @@
603603
<item name="dynamicColorThemeOverlay">@style/ThemeOverlay.Material3.DynamicColors.Dark</item>
604604
</style>
605605

606+
<style name="Base.V23.Theme.Material3.Light.Dialog" parent="Base.V14.Theme.Material3.Light.Dialog">
607+
<item name="colorControlHighlight">@color/m3_on_surface_variant_ripple_selector</item>
608+
</style>
609+
610+
<style name="Base.V23.Theme.Material3.Dark.Dialog" parent="Base.V14.Theme.Material3.Dark.Dialog">
611+
<item name="colorControlHighlight">@color/m3_on_surface_variant_ripple_selector</item>
612+
</style>
613+
606614
<style name="Base.Theme.Material3.Light.Dialog" parent="Base.V14.Theme.Material3.Light.Dialog"/>
607615
<style name="Base.Theme.Material3.Dark.Dialog" parent="Base.V14.Theme.Material3.Dark.Dialog"/>
608616

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2025 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<resources>
18+
<style name="Base.Theme.Material3.Light" parent="Base.V23.Theme.Material3.Light"/>
19+
<style name="Base.Theme.Material3.Dark" parent="Base.V23.Theme.Material3.Dark"/>
20+
</resources>

lib/java/com/google/android/material/theme/res/values-v24/themes_base.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
~ limitations under the License.
1616
-->
1717
<resources>
18-
<style name="Base.V24.Theme.Material3.Light" parent="Base.V14.Theme.Material3.Light">
18+
<style name="Base.V24.Theme.Material3.Light" parent="Base.V23.Theme.Material3.Light">
1919
<item name="android:contextPopupMenuStyle">@style/Widget.Material3.PopupMenu.ContextMenu</item>
2020
</style>
2121

22-
<style name="Base.V24.Theme.Material3.Dark" parent="Base.V14.Theme.Material3.Dark">
22+
<style name="Base.V24.Theme.Material3.Dark" parent="Base.V23.Theme.Material3.Dark">
2323
<item name="android:contextPopupMenuStyle">@style/Widget.Material3.PopupMenu.ContextMenu</item>
2424
</style>
2525

lib/java/com/google/android/material/theme/res/values/themes_base.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,14 @@
633633
<item name="dynamicColorThemeOverlay">@style/ThemeOverlay.Material3.DynamicColors.Dark</item>
634634
</style>
635635

636+
<style name="Base.V23.Theme.Material3.Light" parent="Base.V14.Theme.Material3.Light">
637+
<item name="colorControlHighlight">@color/m3_on_surface_variant_ripple_selector</item>
638+
</style>
639+
640+
<style name="Base.V23.Theme.Material3.Dark" parent="Base.V14.Theme.Material3.Dark">
641+
<item name="colorControlHighlight">@color/m3_on_surface_variant_ripple_selector</item>
642+
</style>
643+
636644
<style name="Base.Theme.Material3.Light" parent="Base.V14.Theme.Material3.Light"/>
637645
<style name="Base.Theme.Material3.Dark" parent="Base.V14.Theme.Material3.Dark"/>
638646

0 commit comments

Comments
 (0)