Adding blue theme and refactoring styles.xml

This commit is contained in:
LucasGGamerM
2022-12-03 16:25:28 -03:00
parent 77669cedf6
commit bad44b145c
9 changed files with 205 additions and 128 deletions

View File

@@ -54,7 +54,8 @@ public class GlobalUserPreferences{
public enum ColorPreference{
PINK,
PURPLE,
GREEN
GREEN,
BLUE
}
public enum ThemePreference{

View File

@@ -679,6 +679,10 @@ public class SettingsFragment extends MastodonToolbarFragment{
pref = GlobalUserPreferences.ColorPreference.GREEN;
onColorPreferenceClick(pref);
}
else if(id==R.id.blue_color) {
pref = GlobalUserPreferences.ColorPreference.BLUE;
onColorPreferenceClick(pref);
}
else
return false;
return true;
@@ -694,6 +698,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
case PINK -> R.string.pink_color;
case PURPLE -> R.string.purple_color;
case GREEN -> R.string.green_color;
case BLUE -> R.string.blue_color;
});
}
}

View File

@@ -688,7 +688,16 @@ public class UiUtils{
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Green : R.style.Theme_Mastodon_Dark_Green;
});
break;
case BLUE:
context.setTheme(switch(GlobalUserPreferences.theme){
case AUTO ->
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack_Blue : R.style.Theme_Mastodon_AutoLightDark_Blue;
case LIGHT ->
R.style.Theme_Mastodon_Light_Blue;
case DARK ->
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Blue : R.style.Theme_Mastodon_Dark_Blue;
});
break;
}
}