Loading app/src/main/java/app/fedilab/android/mastodon/helper/ThemeHelper.java +3 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -314,6 +314,8 @@ public class ThemeHelper { public enum themes { LIGHT, DARK, BLACK, DRACULA, SYSTEM, SOLARIZED_LIGHT, SOLARIZED_DARK Loading app/src/main/res/values-night/themes.xml +12 −0 Original line number Diff line number Diff line Loading @@ -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"> Loading Loading @@ -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> Loading @@ -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"> Loading Loading @@ -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"> Loading Loading @@ -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"> Loading @@ -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"> Loading Loading @@ -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"> Loading Loading @@ -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"> Loading @@ -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"> Loading Loading @@ -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> Loading Loading @@ -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"> Loading @@ -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"> Loading app/src/main/res/values/themes.xml +6 −0 Original line number Diff line number Diff line Loading @@ -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"> Loading Loading @@ -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"> Loading @@ -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"> Loading Loading @@ -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"> Loading @@ -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"> Loading Loading @@ -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"> Loading Loading
app/src/main/java/app/fedilab/android/mastodon/helper/ThemeHelper.java +3 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -314,6 +314,8 @@ public class ThemeHelper { public enum themes { LIGHT, DARK, BLACK, DRACULA, SYSTEM, SOLARIZED_LIGHT, SOLARIZED_DARK Loading
app/src/main/res/values-night/themes.xml +12 −0 Original line number Diff line number Diff line Loading @@ -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"> Loading Loading @@ -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> Loading @@ -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"> Loading Loading @@ -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"> Loading Loading @@ -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"> Loading @@ -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"> Loading Loading @@ -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"> Loading Loading @@ -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"> Loading @@ -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"> Loading Loading @@ -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> Loading Loading @@ -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"> Loading @@ -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"> Loading
app/src/main/res/values/themes.xml +6 −0 Original line number Diff line number Diff line Loading @@ -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"> Loading Loading @@ -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"> Loading @@ -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"> Loading Loading @@ -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"> Loading @@ -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"> Loading Loading @@ -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"> Loading