diff --git a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java index 630bf63f4..9ecc6c3ef 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java +++ b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java @@ -77,14 +77,14 @@ public class GlobalUserPreferences{ } public enum ColorPreference{ + MATERIAL3, PINK, PURPLE, GREEN, BLUE, BROWN, ORANGE, - YELLOW, - MATERIAL3 + YELLOW } public enum ThemePreference{ diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java index cc526aba2..3bf630b86 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java @@ -247,19 +247,15 @@ public class SettingsFragment extends MastodonToolbarFragment{ ColorPreference pref = null; int id = item.getItemId(); - if (id == R.id.pink_color) pref = ColorPreference.PINK; + if (id == R.id.m3_color) pref = ColorPreference.MATERIAL3; + else if (id == R.id.pink_color) pref = ColorPreference.PINK; else if (id == R.id.purple_color) pref = ColorPreference.PURPLE; else if (id == R.id.green_color) pref = ColorPreference.GREEN; else if (id == R.id.blue_color) pref = ColorPreference.BLUE; else if (id == R.id.brown_color) pref = ColorPreference.BROWN; else if (id == R.id.yellow_color) pref = ColorPreference.YELLOW; - else if (id == R.id.m3_color) pref = ColorPreference.MATERIAL3; if (pref == null) return false; - if (pref == ColorPreference.MATERIAL3 && Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { - Toast.makeText(getActivity(), R.string.sk_unsupported, Toast.LENGTH_LONG).show(); - return false; - } GlobalUserPreferences.color=pref; GlobalUserPreferences.save(); @@ -711,13 +707,13 @@ public class SettingsFragment extends MastodonToolbarFragment{ public void onBind(ColorPicker item){ icon.setImageResource(R.drawable.ic_fluent_color_24_regular); button.setText(switch(GlobalUserPreferences.color){ + case MATERIAL3 -> R.string.sk_color_theme_material3; case PINK -> R.string.sk_color_theme_pink; case PURPLE -> R.string.sk_color_theme_purple; case GREEN -> R.string.sk_color_theme_green; case BLUE -> R.string.sk_color_theme_blue; case BROWN -> R.string.sk_color_theme_brown; case YELLOW -> R.string.sk_color_theme_yellow; - case MATERIAL3 -> R.string.sk_color_theme_material_you; default -> throw new IllegalStateException("Unexpected value: "+GlobalUserPreferences.color); }); } diff --git a/mastodon/src/main/res/menu/color_picker.xml b/mastodon/src/main/res/menu/color_picker.xml index 8edbeab1d..ad3d30dda 100644 --- a/mastodon/src/main/res/menu/color_picker.xml +++ b/mastodon/src/main/res/menu/color_picker.xml @@ -1,10 +1,10 @@ + - \ No newline at end of file diff --git a/mastodon/src/main/res/values/strings_sk.xml b/mastodon/src/main/res/values/strings_sk.xml index c4c9145a3..d7c57823a 100644 --- a/mastodon/src/main/res/values/strings_sk.xml +++ b/mastodon/src/main/res/values/strings_sk.xml @@ -41,14 +41,13 @@ Posts Post notifications Color theme + System Pink Purple Green Blue Brown Yellow - Material You - Not supported on your device Allow multiple choices Translate Show original