Fixed a few bugs from the earlier commit.
This commit is contained in:
@@ -655,14 +655,14 @@ public class UiUtils{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setUserPreferredTheme(Context context){
|
public static void setUserPreferredTheme(Context context){
|
||||||
boolean isDarkTheme = isDarkTheme();
|
// boolean isDarkTheme = isDarkTheme();
|
||||||
context.setTheme(switch(GlobalUserPreferences.theme){
|
context.setTheme(switch(GlobalUserPreferences.theme){
|
||||||
case AUTO ->
|
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 ->
|
case LIGHT ->
|
||||||
GlobalUserPreferences.originalColors ? R.style.Theme_Mastodon_Light_Original : R.style.Theme_Mastodon_Light;
|
GlobalUserPreferences.originalColors ? R.style.Theme_Mastodon_Light_Original : R.style.Theme_Mastodon_Light;
|
||||||
case DARK ->
|
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(){
|
public static boolean isDarkTheme(){
|
||||||
|
|||||||
@@ -2,4 +2,7 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<style name="Theme.Mastodon.AutoLightDark" parent="Theme.Mastodon.Dark"/>
|
<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.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>
|
</resources>
|
||||||
@@ -135,7 +135,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Mastodon.AutoLightDark.Original" parent="Theme.Mastodon.Light.Original"/>
|
<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">
|
<style name="Theme.Mastodon.Toolbar" parent="android:ThemeOverlay.Material.ActionBar">
|
||||||
|
|||||||
Reference in New Issue
Block a user