Skip to content

Commit daa3a04

Browse files
committed
DayNight Bridge Themes
Also add some non-Base dialog themes that were missing PiperOrigin-RevId: 250520918
1 parent 188cf27 commit daa3a04

File tree

9 files changed

+155
-6
lines changed

9 files changed

+155
-6
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,30 @@
1717
<resources>
1818
<public name="Theme.MaterialComponents.Dialog" type="style"/>
1919
<public name="Theme.MaterialComponents.Light.Dialog" type="style"/>
20+
<public name="Theme.MaterialComponents.DayNight.Dialog" type="style"/>
2021
<public name="Theme.MaterialComponents.Dialog.Alert" type="style"/>
2122
<public name="Theme.MaterialComponents.Light.Dialog.Alert" type="style"/>
23+
<public name="Theme.MaterialComponents.DayNight.Dialog.Alert" type="style"/>
2224
<public name="Theme.MaterialComponents.Dialog.MinWidth" type="style"/>
2325
<public name="Theme.MaterialComponents.Light.Dialog.MinWidth" type="style"/>
26+
<public name="Theme.MaterialComponents.DayNight.Dialog.MinWidth" type="style"/>
27+
<public name="Theme.MaterialComponents.Dialog.FixedSize" type="style"/>
28+
<public name="Theme.MaterialComponents.Light.Dialog.FixedSize" type="style"/>
29+
<public name="Theme.MaterialComponents.DayNight.Dialog.FixedSize" type="style"/>
30+
31+
<public name="Theme.MaterialComponents.Dialog.Bridge" type="style"/>
32+
<public name="Theme.MaterialComponents.Light.Dialog.Bridge" type="style"/>
33+
<public name="Theme.MaterialComponents.DayNight.Dialog.Bridge" type="style"/>
34+
<public name="Theme.MaterialComponents.Dialog.Alert.Bridge" type="style"/>
35+
<public name="Theme.MaterialComponents.Light.Dialog.Alert.Bridge" type="style"/>
36+
<public name="Theme.MaterialComponents.DayNight.Dialog.Alert.Bridge" type="style"/>
37+
<public name="Theme.MaterialComponents.Dialog.MinWidth.Bridge" type="style"/>
38+
<public name="Theme.MaterialComponents.DayNight.Dialog.MinWidth.Bridge" type="style"/>
39+
<public name="Theme.MaterialComponents.Light.Dialog.MinWidth.Bridge" type="style"/>
40+
<public name="Theme.MaterialComponents.Dialog.FixedSize.Bridge" type="style"/>
41+
<public name="Theme.MaterialComponents.Light.Dialog.FixedSize.Bridge" type="style"/>
42+
<public name="Theme.MaterialComponents.DayNight.Dialog.FixedSize.Bridge" type="style"/>
43+
2444
<public name="ThemeOverlay.MaterialComponents.Dialog" type="style"/>
2545
<public name="ThemeOverlay.MaterialComponents.Dialog.Alert" type="style"/>
2646
<public name="ThemeOverlay.MaterialComponents.Dialog.Alert.Centered" type="style"/>

lib/java/com/google/android/material/dialog/res/values-night/themes_daynight.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@
2323

2424
<style name="Theme.MaterialComponents.DayNight.Dialog.MinWidth" parent="Theme.MaterialComponents.Dialog.MinWidth"/>
2525

26+
<style name="Theme.MaterialComponents.DayNight.Dialog.FixedSize" parent="Theme.MaterialComponents.Dialog.FixedSize"/>
27+
2628
</resources>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2019 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+
19+
<!-- Material bridge themes (day/night versions) for dialogs. -->
20+
<style name="Theme.MaterialComponents.DayNight.Dialog.Bridge" parent="Theme.MaterialComponents.Dialog.Bridge"/>
21+
22+
<style name="Theme.MaterialComponents.DayNight.Dialog.Alert.Bridge" parent="Theme.MaterialComponents.Dialog.Alert.Bridge"/>
23+
24+
<style name="Theme.MaterialComponents.DayNight.Dialog.MinWidth.Bridge" parent="Theme.MaterialComponents.Dialog.MinWidth.Bridge"/>
25+
26+
<style name="Theme.MaterialComponents.DayNight.Dialog.FixedSize.Bridge" parent="Theme.MaterialComponents.Dialog.FixedSize.Bridge"/>
27+
28+
</resources>

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@
4545

4646
<style name="Theme.MaterialComponents.Light.Dialog.MinWidth" parent="Base.Theme.MaterialComponents.Light.Dialog.MinWidth"/>
4747

48+
<!--
49+
Variant of Theme.MaterialComponents.Dialog that has a fixed size for a regular dialog.
50+
-->
51+
<style name="Theme.MaterialComponents.Dialog.FixedSize" parent="Base.Theme.MaterialComponents.Dialog.FixedSize"/>
52+
53+
<style name="Theme.MaterialComponents.Light.Dialog.FixedSize" parent="Base.Theme.MaterialComponents.Light.Dialog.FixedSize"/>
54+
55+
<!--
56+
The default theme overlay used by MaterialComponents for regular dialogs.
57+
-->
4858
<style name="ThemeOverlay.MaterialComponents.Dialog" parent="Base.ThemeOverlay.MaterialComponents.Dialog"/>
4959

5060
<!--

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@
2323

2424
<style name="Theme.MaterialComponents.DayNight.Dialog.MinWidth" parent="Theme.MaterialComponents.Light.Dialog.MinWidth"/>
2525

26+
<style name="Theme.MaterialComponents.DayNight.Dialog.FixedSize" parent="Theme.MaterialComponents.Light.Dialog.FixedSize"/>
27+
2628
</resources>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2019 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+
19+
<!-- Material bridge themes (day/night versions) for dialogs. -->
20+
<style name="Theme.MaterialComponents.DayNight.Dialog.Bridge" parent="Theme.MaterialComponents.Light.Dialog.Bridge"/>
21+
22+
<style name="Theme.MaterialComponents.DayNight.Dialog.Alert.Bridge" parent="Theme.MaterialComponents.Light.Dialog.Alert.Bridge"/>
23+
24+
<style name="Theme.MaterialComponents.DayNight.Dialog.MinWidth.Bridge" parent="Theme.MaterialComponents.Light.Dialog.MinWidth.Bridge"/>
25+
26+
<style name="Theme.MaterialComponents.DayNight.Dialog.FixedSize.Bridge" parent="Theme.MaterialComponents.Light.Dialog.FixedSize.Bridge"/>
27+
28+
</resources>

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,35 @@
1717
<resources>
1818
<public name="Platform.MaterialComponents" type="style"/>
1919
<public name="Platform.MaterialComponents.Light" type="style"/>
20+
2021
<public name="Theme.MaterialComponents" type="style"/>
21-
<public name="Theme.MaterialComponents.NoActionBar" type="style"/>
22-
<public name="Theme.MaterialComponents.DialogWhenLarge" type="style"/>
23-
<public name="Theme.MaterialComponents.CompactMenu" type="style"/>
2422
<public name="Theme.MaterialComponents.Light" type="style"/>
25-
<public name="Theme.MaterialComponents.Light.NoActionBar" type="style"/>
26-
<public name="Theme.MaterialComponents.Light.DarkActionBar" type="style"/>
27-
<public name="Theme.MaterialComponents.Light.DialogWhenLarge" type="style"/>
2823
<public name="Theme.MaterialComponents.DayNight" type="style"/>
24+
<public name="Theme.MaterialComponents.NoActionBar" type="style"/>
25+
<public name="Theme.MaterialComponents.Light.NoActionBar" type="style"/>
2926
<public name="Theme.MaterialComponents.DayNight.NoActionBar" type="style"/>
27+
<public name="Theme.MaterialComponents.Light.DarkActionBar" type="style"/>
3028
<public name="Theme.MaterialComponents.DayNight.DarkActionBar" type="style"/>
29+
<public name="Theme.MaterialComponents.DialogWhenLarge" type="style"/>
30+
<public name="Theme.MaterialComponents.Light.DialogWhenLarge" type="style"/>
3131
<public name="Theme.MaterialComponents.DayNight.DialogWhenLarge" type="style"/>
32+
<public name="Theme.MaterialComponents.CompactMenu" type="style"/>
33+
3234
<public name="Theme.MaterialComponents.Bridge" type="style"/>
3335
<public name="Theme.MaterialComponents.Light.Bridge" type="style"/>
36+
<public name="Theme.MaterialComponents.DayNight.Bridge" type="style"/>
3437
<public name="Theme.MaterialComponents.NoActionBar.Bridge" type="style"/>
3538
<public name="Theme.MaterialComponents.Light.NoActionBar.Bridge" type="style"/>
39+
<public name="Theme.MaterialComponents.DayNight.NoActionBar.Bridge" type="style"/>
3640
<public name="Theme.MaterialComponents.Light.DarkActionBar.Bridge" type="style"/>
41+
<public name="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge" type="style"/>
42+
3743
<public name="ThemeOverlay.MaterialComponents" type="style"/>
3844
<public name="ThemeOverlay.MaterialComponents.Light" type="style"/>
3945
<public name="ThemeOverlay.MaterialComponents.Dark" type="style"/>
4046
<public name="ThemeOverlay.MaterialComponents.ActionBar" type="style"/>
4147
<public name="ThemeOverlay.MaterialComponents.Dark.ActionBar" type="style"/>
48+
4249
<public name="Theme.Design" type="style"/>
4350
<public name="Theme.Design.Light" type="style"/>
4451
<public name="Theme.Design.NoActionBar" type="style"/>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2019 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+
19+
<!-- Material bridge themes (day/night versions) for activities. -->
20+
<style name="Theme.MaterialComponents.DayNight.Bridge" parent="Theme.MaterialComponents.Bridge"/>
21+
22+
<style name="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge" parent="Theme.MaterialComponents.Bridge"/>
23+
24+
<style name="Theme.MaterialComponents.DayNight.NoActionBar.Bridge" parent="Theme.MaterialComponents.NoActionBar.Bridge"/>
25+
26+
</resources>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2019 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+
19+
<!-- Material bridge themes (day/night versions) for activities. -->
20+
<style name="Theme.MaterialComponents.DayNight.Bridge" parent="Theme.MaterialComponents.Light.Bridge"/>
21+
22+
<style name="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge" parent="Theme.MaterialComponents.Light.DarkActionBar.Bridge"/>
23+
24+
<style name="Theme.MaterialComponents.DayNight.NoActionBar.Bridge" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge"/>
25+
26+
</resources>

0 commit comments

Comments
 (0)