diff options
author | Thomas <tschneider.ac@gmail.com> | 2023-12-23 17:01:26 +0100 |
---|---|---|
committer | Thomas <tschneider.ac@gmail.com> | 2023-12-23 17:01:26 +0100 |
commit | 25c237f0a8e9c036436ec1d9977e24fd19498bd3 (patch) | |
tree | b522a5a6859a00ccc522297d14ed4b38b409e538 | |
parent | d60900e2f9cbe1697fa5ef19e311fd93903cbc7a (diff) |
Fix theme issues
-rw-r--r-- | app/src/main/java/app/fedilab/android/mastodon/helper/ThemeHelper.java | 4 | ||||
-rw-r--r-- | app/src/main/res/values-night/themes.xml | 12 | ||||
-rw-r--r-- | app/src/main/res/values/themes.xml | 6 |
3 files changed, 21 insertions, 1 deletions
diff --git a/app/src/main/java/app/fedilab/android/mastodon/helper/ThemeHelper.java b/app/src/main/java/app/fedilab/android/mastodon/helper/ThemeHelper.java index db4c32fd5..51d1b8d07 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/helper/ThemeHelper.java +++ b/app/src/main/java/app/fedilab/android/mastodon/helper/ThemeHelper.java @@ -275,7 +275,7 @@ public class ThemeHelper { public static void switchTo(String themePref) { if (themes.LIGHT.name().equals(themePref) || themes.SOLARIZED_LIGHT.name().equals(themePref)) { AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); - } else if (themes.DARK.name().equals(themePref) || themes.SOLARIZED_DARK.name().equals(themePref)) { + } else if (themes.DARK.name().equals(themePref) || themes.SOLARIZED_DARK.name().equals(themePref) || themes.DRACULA.name().equals(themePref) || themes.BLACK.name().equals(themePref)) { AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); } else { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { @@ -314,6 +314,8 @@ public class ThemeHelper { public enum themes { LIGHT, DARK, + BLACK, + DRACULA, SYSTEM, SOLARIZED_LIGHT, SOLARIZED_DARK diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index a77b7b9ad..8344bd2c0 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -45,6 +45,7 @@ </item> <item name="android:windowSharedElementExitTransition">@transition/change_image_transform </item> + <item name="alertDialogTheme">@style/AppThemeAlertDialog</item> </style> <style name="AppThemeBar" parent="Theme.Material3.Dark"> @@ -81,6 +82,7 @@ <item name="android:windowLightStatusBar" tools:targetApi="m">false</item> <item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">false</item> <item name="android:isLightTheme" tools:targetApi="q">false</item> + <item name="alertDialogTheme">@style/AppThemeAlertDialog</item> </style> @@ -98,6 +100,7 @@ </item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> + <item name="alertDialogTheme">@style/AppThemeAlertDialog</item> </style> <style name="AppThemeAlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog"> @@ -168,6 +171,7 @@ <item name="colorOnSurfaceInverse">@color/solarized_md_theme_dark_inverseOnSurface</item> <item name="colorSurfaceInverse">@color/solarized_md_theme_dark_inverseSurface</item> <item name="colorPrimaryInverse">@color/solarized_md_theme_dark_inversePrimary</item> + <item name="alertDialogTheme">@style/SolarizedAlertDialog</item> </style> <style name="SolarizedAppThemeBar" parent="AppThemeBar"> @@ -203,6 +207,7 @@ <item name="colorOnSurfaceInverse">@color/solarized_md_theme_dark_inverseOnSurface</item> <item name="colorSurfaceInverse">@color/solarized_md_theme_dark_inverseSurface</item> <item name="colorPrimaryInverse">@color/solarized_md_theme_dark_inversePrimary</item> + <item name="alertDialogTheme">@style/SolarizedAlertDialog</item> </style> <style name="TransparentSolarized" parent="SolarizedAppThemeBar"> @@ -221,6 +226,7 @@ </item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> + <item name="alertDialogTheme">@style/SolarizedAlertDialog</item> </style> <style name="SolarizedAlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog"> @@ -289,6 +295,7 @@ <item name="colorOnSurfaceInverse">@color/black</item> <item name="colorSurfaceInverse">@color/white</item> <item name="colorPrimaryInverse">@color/black</item> + <item name="alertDialogTheme">@style/BlackAlertDialog</item> </style> <style name="BlackAppThemeBar" parent="AppThemeBar"> @@ -320,6 +327,7 @@ <item name="colorOnSurfaceInverse">@color/black</item> <item name="colorSurfaceInverse">@color/white</item> <item name="colorPrimaryInverse">@color/black</item> + <item name="alertDialogTheme">@style/BlackAlertDialog</item> </style> <style name="TransparentBlack" parent="BlackAppThemeBar"> @@ -337,6 +345,7 @@ </item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> + <item name="alertDialogTheme">@style/BlackAlertDialog</item> </style> <style name="BlackAlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog"> @@ -402,6 +411,7 @@ <item name="colorOnSurfaceInverse">@color/dracula_comment</item> <item name="colorSurfaceInverse">@color/dracula_foreground</item> <item name="colorPrimaryInverse">@color/dracula_comment</item> + <item name="alertDialogTheme">@style/DraculaAlertDialog</item> </style> @@ -434,6 +444,7 @@ <item name="colorOnSurfaceInverse">@color/dracula_comment</item> <item name="colorSurfaceInverse">@color/dracula_foreground</item> <item name="colorPrimaryInverse">@color/dracula_comment</item> + <item name="alertDialogTheme">@style/DraculaAlertDialog</item> </style> <style name="TransparentDracula" parent="DraculaAppThemeBar"> @@ -452,6 +463,7 @@ </item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> + <item name="alertDialogTheme">@style/DraculaAlertDialog</item> </style> <style name="DraculaAlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog"> diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 409d14f9d..e69af45c3 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -46,6 +46,7 @@ <item name="android:windowSharedElementExitTransition">@transition/change_image_transform </item> <item name="android:statusBarColor">?android:colorBackground</item> + <item name="alertDialogTheme">@style/AppThemeAlertDialog</item> </style> <style name="AppThemeBar" parent="Theme.Material3.Light"> @@ -82,6 +83,7 @@ <item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">true</item> <item name="android:isLightTheme" tools:targetApi="q">true</item> <item name="android:statusBarColor">?android:colorBackground</item> + <item name="alertDialogTheme">@style/AppThemeAlertDialog</item> </style> <style name="Transparent" parent="AppThemeBar"> @@ -98,6 +100,7 @@ </item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> + <item name="alertDialogTheme">@style/AppThemeAlertDialog</item> </style> <style name="AppThemeAlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog"> @@ -167,6 +170,7 @@ <item name="colorOnSurfaceInverse">@color/solarized_md_theme_light_inverseOnSurface</item> <item name="colorSurfaceInverse">@color/solarized_md_theme_light_inverseSurface</item> <item name="colorPrimaryInverse">@color/solarized_md_theme_light_inversePrimary</item> + <item name="alertDialogTheme">@style/SolarizedAlertDialog</item> </style> <style name="TransparentSolarized" parent="SolarizedAppThemeBar"> @@ -183,6 +187,7 @@ </item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> + <item name="alertDialogTheme">@style/SolarizedAlertDialog</item> </style> <style name="SolarizedAlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog"> @@ -254,6 +259,7 @@ <item name="colorOnSurfaceInverse">@color/solarized_md_theme_light_inverseOnSurface</item> <item name="colorSurfaceInverse">@color/solarized_md_theme_light_inverseSurface</item> <item name="colorPrimaryInverse">@color/solarized_md_theme_light_inversePrimary</item> + <item name="alertDialogTheme">@style/SolarizedAlertDialog</item> </style> <style name="Fedilab.SmallIconButton" parent="Widget.Material3.Button.IconButton"> |