Tint alert dialogs

Apply the accent color to alert dialog buttons. Note that without
"android:windowMinWidthMajor" and "android:windowMinWidthMinor" attributes
dialog width is calculated incorrectly resulting in visual artifacts.
This commit is contained in:
relan 2015-07-23 09:19:20 +03:00
parent 4b699d5376
commit 04e8b591ab
2 changed files with 26 additions and 5 deletions

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AlertDialogBaseThemeDark" parent="Theme.AppCompat.Dialog.Alert">
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
</style>
<style name="AlertDialogBaseThemeLight" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
</style>
</resources>

View File

@ -6,6 +6,7 @@
<item name="colorPrimary">@color/fdroid_blue</item> <item name="colorPrimary">@color/fdroid_blue</item>
<item name="colorPrimaryDark">@color/fdroid_blue_dark</item> <item name="colorPrimaryDark">@color/fdroid_blue_dark</item>
<item name="colorAccent">@color/fdroid_green</item> <item name="colorAccent">@color/fdroid_green</item>
<item name="alertDialogTheme">@style/AlertDialogThemeDark</item>
</style> </style>
<style name="AppBaseThemeLight" parent="Theme.AppCompat.Light.DarkActionBar"> <style name="AppBaseThemeLight" parent="Theme.AppCompat.Light.DarkActionBar">
@ -14,17 +15,13 @@
<item name="colorPrimary">@color/fdroid_blue</item> <item name="colorPrimary">@color/fdroid_blue</item>
<item name="colorPrimaryDark">@color/fdroid_blue_dark</item> <item name="colorPrimaryDark">@color/fdroid_blue_dark</item>
<item name="colorAccent">@color/fdroid_green</item> <item name="colorAccent">@color/fdroid_green</item>
<item name="alertDialogTheme">@style/AlertDialogThemeLight</item>
</style> </style>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="red">#FFFF0000</color> <color name="red">#FFFF0000</color>
<style name="AboutDialogLight" parent="@android:style/Theme.Dialog">
<item name="@android:windowBackground">@color/black</item>
<item name="@android:textColor">@color/white</item>
</style>
<style name="AppThemeDark" parent="AppBaseThemeDark"> <style name="AppThemeDark" parent="AppBaseThemeDark">
<!-- customizations that are not API-level specific go here. --> <!-- customizations that are not API-level specific go here. -->
</style> </style>
@ -33,6 +30,16 @@
<!-- customizations that are not API-level specific go here. --> <!-- customizations that are not API-level specific go here. -->
</style> </style>
<style name="AlertDialogBaseThemeDark" parent="Theme.AppCompat.Dialog.Alert" />
<style name="AlertDialogThemeDark" parent="AlertDialogBaseThemeDark">
<item name="colorAccent">@color/fdroid_green</item>
</style>
<style name="AlertDialogBaseThemeLight" parent="Theme.AppCompat.Light.Dialog.Alert" />
<style name="AlertDialogThemeLight" parent="AlertDialogBaseThemeLight">
<item name="colorAccent">@color/fdroid_green</item>
</style>
<style name="SwapTheme.Wizard" parent="AppThemeDark"> <style name="SwapTheme.Wizard" parent="AppThemeDark">
<item name="android:windowBackground">@drawable/swap_window_background</item> <item name="android:windowBackground">@drawable/swap_window_background</item>
<item name="android:actionBarStyle">@style/Widget.AppCompat.ActionBar.Solid</item> <item name="android:actionBarStyle">@style/Widget.AppCompat.ActionBar.Solid</item>