Fixed a few bugs from the earlier commit.

This commit is contained in:
LucasGGamerM 2022-11-28 16:47:04 -03:00
parent ff215412c8
commit bc2ac4e915
3 changed files with 7 additions and 4 deletions

View File

@ -655,14 +655,14 @@ public class UiUtils{
}
public static void setUserPreferredTheme(Context context){
boolean isDarkTheme = isDarkTheme();
// boolean isDarkTheme = isDarkTheme();
context.setTheme(switch(GlobalUserPreferences.theme){
case AUTO ->
GlobalUserPreferences.originalColors ? (GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack_Original : (isDarkTheme ? R.style.Theme_Mastodon_Dark_Original : R.style.Theme_Mastodon_AutoLightDark_Original)) : (GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack : R.style.Theme_Mastodon_AutoLightDark);
GlobalUserPreferences.originalColors ? (GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack_Original : R.style.Theme_Mastodon_AutoLightDark_Original) : (GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack : R.style.Theme_Mastodon_AutoLightDark);
case LIGHT ->
GlobalUserPreferences.originalColors ? R.style.Theme_Mastodon_Light_Original : R.style.Theme_Mastodon_Light;
case DARK ->
GlobalUserPreferences.trueBlackTheme ? (GlobalUserPreferences.originalColors ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack_Original : R.style.Theme_Mastodon_Dark_TrueBlack) : (GlobalUserPreferences.originalColors ? R.style.Theme_Mastodon_Dark_Original : R.style.Theme_Mastodon_Dark);
GlobalUserPreferences.originalColors ? (GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack_Original : R.style.Theme_Mastodon_Dark_Original) : R.style.Theme_Mastodon_Dark;
});
}
public static boolean isDarkTheme(){

View File

@ -2,4 +2,7 @@
<resources>
<style name="Theme.Mastodon.AutoLightDark" parent="Theme.Mastodon.Dark"/>
<style name="Theme.Mastodon.AutoLightDark.TrueBlack" parent="Theme.Mastodon.Dark.TrueBlack"/>
<style name="Theme.Mastodon.AutoLightDark.Original" parent="Theme.Mastodon.Dark.Original"/>
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Original" parent="Theme.Mastodon.Dark.TrueBlack.Original"/>
</resources>

View File

@ -135,7 +135,7 @@
</style>
<style name="Theme.Mastodon.AutoLightDark.Original" parent="Theme.Mastodon.Light.Original"/>
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Original" parent="Theme.Mastodon.Dark.TrueBlack.Original"/>
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Original" parent="Theme.Mastodon.Light.Original"/>
<style name="Theme.Mastodon.Toolbar" parent="android:ThemeOverlay.Material.ActionBar">