Making material you setting work fine. Its ready for release

This commit is contained in:
LucasGGamerM
2022-12-10 12:59:24 -03:00
parent dbb23d952c
commit 9d0ce33f5e
8 changed files with 154 additions and 1 deletions

View File

@@ -237,6 +237,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
}
private void onColorPreferenceClick(GlobalUserPreferences.ColorPreference color){
GlobalUserPreferences.color=color;
GlobalUserPreferences.save();
restartActivityToApplyNewTheme();
@@ -704,6 +705,15 @@ public class SettingsFragment extends MastodonToolbarFragment{
pref = GlobalUserPreferences.ColorPreference.YELLOW;
onColorPreferenceClick(pref);
}
else if(id==R.id.m3_color) {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
pref = GlobalUserPreferences.ColorPreference.MATERIAL3;
onColorPreferenceClick(pref);
}else{
Toast.makeText(getActivity(), R.string.sk_not_supported,
Toast.LENGTH_LONG).show();
}
}
else
return false;
return true;
@@ -723,6 +733,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
case BLUE -> R.string.sk_color_theme_blue;
case ORANGE -> R.string.sk_color_theme_brown;
case YELLOW -> R.string.sk_color_theme_yellow;
case MATERIAL3 -> R.string.sk_color_theme_material_you;
});
}
}