Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[M3][Dialog] Add date and time picker themes to M3 dialog themes
Also moves all theme overlays to separate files for internal building purpose. PiperOrigin-RevId: 421385265
- Loading branch information
Showing
6 changed files
with
141 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
lib/java/com/google/android/material/dialog/res/values/themes_overlay.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?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. | ||
--> | ||
<resources xmlns:tools="http://schemas.android.com/tools"> | ||
<style name="Base.V14.ThemeOverlay.MaterialComponents.Dialog" parent="ThemeOverlay.AppCompat.Dialog"> | ||
<!-- Widget styles --> | ||
<item name="materialButtonStyle">@style/Widget.MaterialComponents.Button.TextButton.Dialog.Flush</item> | ||
</style> | ||
|
||
<style name="Base.V14.ThemeOverlay.MaterialComponents.Dialog.Alert" parent="ThemeOverlay.AppCompat.Dialog.Alert"> | ||
<!-- Widget styles --> | ||
<item name="buttonBarButtonStyle">@style/Widget.MaterialComponents.Button.TextButton.Dialog.Flush</item> | ||
</style> | ||
|
||
<style name="Base.V14.ThemeOverlay.MaterialComponents.MaterialAlertDialog" parent="ThemeOverlay.AppCompat.Dialog.Alert"> | ||
<!-- Widget styles --> | ||
<item name="materialAlertDialogButtonSpacerVisibility">@integer/mtrl_view_invisible</item> | ||
<item name="alertDialogStyle">@style/MaterialAlertDialog.MaterialComponents</item> | ||
<item name="android:checkedTextViewStyle" tools:ignore="NewApi">@style/Widget.MaterialComponents.CheckedTextView</item> | ||
<item name="android:dialogCornerRadius" tools:ignore="newApi">@null</item> | ||
<item name="buttonBarButtonStyle">@style/Widget.MaterialComponents.Button.TextButton.Dialog</item> | ||
<item name="buttonBarPositiveButtonStyle">@style/Widget.MaterialComponents.Button.TextButton.Dialog</item> | ||
<item name="buttonBarNegativeButtonStyle">@style/Widget.MaterialComponents.Button.TextButton.Dialog</item> | ||
<item name="buttonBarNeutralButtonStyle">@style/Widget.MaterialComponents.Button.TextButton.Dialog.Flush</item> | ||
<item name="android:backgroundDimAmount">0.32</item> | ||
<item name="materialAlertDialogBodyTextStyle">@style/MaterialAlertDialog.MaterialComponents.Body.Text</item> | ||
</style> | ||
|
||
<style name="Base.ThemeOverlay.MaterialComponents.Dialog" parent="Base.V14.ThemeOverlay.MaterialComponents.Dialog"/> | ||
<style name="Base.ThemeOverlay.MaterialComponents.Dialog.Alert" parent="Base.V14.ThemeOverlay.MaterialComponents.Dialog.Alert"/> | ||
<style name="Base.ThemeOverlay.MaterialComponents.MaterialAlertDialog" parent="Base.V14.ThemeOverlay.MaterialComponents.MaterialAlertDialog"/> | ||
|
||
<!-- | ||
The default theme overlay used by MaterialComponents for regular dialogs. | ||
--> | ||
<style name="ThemeOverlay.MaterialComponents.Dialog" parent="Base.ThemeOverlay.MaterialComponents.Dialog"/> | ||
|
||
<!-- | ||
The default MaterialComponents theme overlay used for AlertDialogs built via the | ||
alertDialogTheme attribute. | ||
--> | ||
<style name="ThemeOverlay.MaterialComponents.Dialog.Alert" parent="Base.ThemeOverlay.MaterialComponents.Dialog.Alert"/> | ||
|
||
<!-- | ||
The default MaterialComponents theme overlay for AlertDialogs built with the MaterialAlertDialogBuilder, via the | ||
materialAlertDialogTheme attribute. | ||
--> | ||
<style name="ThemeOverlay.MaterialComponents.MaterialAlertDialog" parent="Base.ThemeOverlay.MaterialComponents.MaterialAlertDialog"> | ||
<item name="materialAlertDialogTitlePanelStyle">@style/MaterialAlertDialog.MaterialComponents.Title.Panel</item> | ||
<item name="materialAlertDialogTitleIconStyle">@style/MaterialAlertDialog.MaterialComponents.Title.Icon</item> | ||
<item name="materialAlertDialogTitleTextStyle">@style/MaterialAlertDialog.MaterialComponents.Title.Text</item> | ||
</style> | ||
|
||
<!-- A theme overlay for MaterialComponents Alert Dialog panels with a center aligned title text and icon. --> | ||
<style name="ThemeOverlay.MaterialComponents.MaterialAlertDialog.Centered" parent="Base.ThemeOverlay.MaterialComponents.MaterialAlertDialog"> | ||
<item name="materialAlertDialogTitlePanelStyle">@style/MaterialAlertDialog.MaterialComponents.Title.Panel.CenterStacked</item> | ||
<item name="materialAlertDialogTitleIconStyle">@style/MaterialAlertDialog.MaterialComponents.Title.Icon.CenterStacked</item> | ||
<item name="materialAlertDialogTitleTextStyle">@style/MaterialAlertDialog.MaterialComponents.Title.Text.CenterStacked</item> | ||
</style> | ||
|
||
<style name="Base.ThemeOverlay.Material3.Dialog" parent="Base.ThemeOverlay.MaterialComponents.Dialog"> | ||
<item name="materialButtonStyle">@style/Widget.Material3.Button.TextButton.Dialog.Flush</item> | ||
</style> | ||
|
||
<style name="ThemeOverlay.Material3.Dialog" parent="Base.ThemeOverlay.Material3.Dialog"/> | ||
|
||
<!-- | ||
The default Material3 theme overlay used for AlertDialogs built via the | ||
alertDialogTheme attribute. | ||
--> | ||
<style name="ThemeOverlay.Material3.Dialog.Alert" parent="ThemeOverlay.MaterialComponents.Dialog.Alert"> | ||
<item name="buttonBarButtonStyle">@style/Widget.Material3.Button.TextButton.Dialog.Flush</item> | ||
<item name="android:windowElevation" tools:ignore="NewApi">@dimen/m3_alert_dialog_elevation</item> | ||
</style> | ||
|
||
<!-- | ||
The default Material3 theme overlay for AlertDialogs built with the MaterialAlertDialogBuilder, via the | ||
materialAlertDialogTheme attribute. | ||
--> | ||
<style name="ThemeOverlay.Material3.MaterialAlertDialog" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog"> | ||
<item name="alertDialogStyle">@style/MaterialAlertDialog.Material3</item> | ||
<item name="android:windowElevation" tools:ignore="NewApi">@dimen/m3_alert_dialog_elevation</item> | ||
<item name="android:checkedTextViewStyle" tools:ignore="NewApi">@style/Widget.Material3.CheckedTextView</item> | ||
<item name="buttonBarButtonStyle">@style/Widget.Material3.Button.TextButton.Dialog</item> | ||
<item name="buttonBarPositiveButtonStyle">@style/Widget.Material3.Button.TextButton.Dialog</item> | ||
<item name="buttonBarNegativeButtonStyle">@style/Widget.Material3.Button.TextButton.Dialog</item> | ||
<item name="buttonBarNeutralButtonStyle">@style/Widget.Material3.Button.TextButton.Dialog.Flush</item> | ||
<item name="materialAlertDialogTitlePanelStyle">@style/MaterialAlertDialog.Material3.Title.Panel</item> | ||
<item name="materialAlertDialogTitleIconStyle">@style/MaterialAlertDialog.Material3.Title.Icon</item> | ||
<item name="materialAlertDialogTitleTextStyle">@style/MaterialAlertDialog.Material3.Title.Text</item> | ||
<item name="materialAlertDialogBodyTextStyle">@style/MaterialAlertDialog.Material3.Body.Text</item> | ||
</style> | ||
|
||
<!-- A theme overlay for Material3 Alert Dialog panels with a center aligned title text and icon. --> | ||
<style name="ThemeOverlay.Material3.MaterialAlertDialog.Centered"> | ||
<item name="materialAlertDialogTitlePanelStyle">@style/MaterialAlertDialog.Material3.Title.Panel.CenterStacked</item> | ||
<item name="materialAlertDialogTitleIconStyle">@style/MaterialAlertDialog.Material3.Title.Icon.CenterStacked</item> | ||
<item name="materialAlertDialogTitleTextStyle">@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked</item> | ||
</style> | ||
</resources> |