Adding a green theme

This commit is contained in:
LucasGGamerM
2022-12-02 14:00:58 -03:00
parent 8fa5824e3e
commit 1747ff98b5
8 changed files with 118 additions and 1 deletions

View File

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

View File

@@ -675,6 +675,10 @@ public class SettingsFragment extends MastodonToolbarFragment{
pref = GlobalUserPreferences.ColorPreference.PURPLE;
onColorPreferenceClick(pref);
}
else if(id==R.id.green_color) {
pref = GlobalUserPreferences.ColorPreference.GREEN;
onColorPreferenceClick(pref);
}
else
return false;
return true;
@@ -689,6 +693,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
button.setText(switch(GlobalUserPreferences.color){
case PINK -> R.string.pink_color;
case PURPLE -> R.string.purple_color;
case GREEN -> R.string.green_color;
});
}
}

View File

@@ -678,6 +678,17 @@ public class UiUtils{
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Original : R.style.Theme_Mastodon_Dark_Original;
});
break;
case GREEN:
context.setTheme(switch(GlobalUserPreferences.theme){
case AUTO ->
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack_Green : R.style.Theme_Mastodon_AutoLightDark_Green;
case LIGHT ->
R.style.Theme_Mastodon_Light_Green;
case DARK ->
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Green : R.style.Theme_Mastodon_Dark_Green;
});
break;
}
}