Adding mastodon original colors toggle. Partially fixing #90

This commit is contained in:
LucasGGamerM
2022-11-28 15:40:29 -03:00
parent e6bb319d8b
commit ff215412c8
6 changed files with 59 additions and 5 deletions

View File

@@ -99,6 +99,8 @@ public class SettingsFragment extends MastodonToolbarFragment{
GlobalUserPreferences.disableMarquee=i.checked;
GlobalUserPreferences.save();
}));
items.add(new SwitchItem(R.string.enable_mastodon_original_colors, R.drawable.bg_button_green, GlobalUserPreferences.originalColors, this::onOriginalColorChanged));
items.add(new HeaderItem(R.string.settings_behavior));
items.add(new SwitchItem(R.string.settings_gif, R.drawable.ic_fluent_gif_24_regular, GlobalUserPreferences.playGifs, i->{
@@ -240,6 +242,12 @@ public class SettingsFragment extends MastodonToolbarFragment{
}
}
private void onOriginalColorChanged(SwitchItem item){
GlobalUserPreferences.originalColors=item.checked;
GlobalUserPreferences.save();
restartActivityToApplyNewTheme();
}
private void restartActivityToApplyNewTheme(){
// Calling activity.recreate() causes a black screen for like half a second.
// So, let's take a screenshot and overlay it on top to create the illusion of a smoother transition.