diff --git a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java
index 5ef37ee08..630bf63f4 100644
--- a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java
+++ b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java
@@ -82,7 +82,9 @@ public class GlobalUserPreferences{
GREEN,
BLUE,
BROWN,
- YELLOW
+ ORANGE,
+ YELLOW,
+ MATERIAL3
}
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 60648fe9b..f0d9d3231 100644
--- a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java
+++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java
@@ -242,6 +242,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
}
private void onColorPreferenceClick(GlobalUserPreferences.ColorPreference color){
+
GlobalUserPreferences.color=color;
GlobalUserPreferences.save();
restartActivityToApplyNewTheme();
@@ -709,6 +710,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;
@@ -728,6 +738,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
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;
});
}
}
diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java
index 7caf71663..eb08329eb 100644
--- a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java
+++ b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java
@@ -718,6 +718,16 @@ public class UiUtils{
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Yellow : R.style.Theme_Mastodon_Dark_Yellow;
});
break;
+ case MATERIAL3:
+ context.setTheme(switch(GlobalUserPreferences.theme){
+ case AUTO ->
+ GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack_Material3 : R.style.Theme_Mastodon_AutoLightDark_Material3;
+ case LIGHT ->
+ R.style.Theme_Mastodon_Light_Material3;
+ case DARK ->
+ GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Material3 : R.style.Theme_Mastodon_Dark_Material3;
+ });
+ break;
}
}
diff --git a/mastodon/src/main/res/menu/color_picker.xml b/mastodon/src/main/res/menu/color_picker.xml
index 85e4fa1bf..8edbeab1d 100644
--- a/mastodon/src/main/res/menu/color_picker.xml
+++ b/mastodon/src/main/res/menu/color_picker.xml
@@ -6,4 +6,5 @@
+
\ No newline at end of file
diff --git a/mastodon/src/main/res/values-night/styles.xml b/mastodon/src/main/res/values-night/styles.xml
index 6d2c4b41e..8d00d786b 100644
--- a/mastodon/src/main/res/values-night/styles.xml
+++ b/mastodon/src/main/res/values-night/styles.xml
@@ -17,4 +17,7 @@
+
+
+
\ No newline at end of file
diff --git a/mastodon/src/main/res/values-v31/colors.xml b/mastodon/src/main/res/values-v31/colors.xml
index a6bea3bdf..8937b4048 100644
--- a/mastodon/src/main/res/values-v31/colors.xml
+++ b/mastodon/src/main/res/values-v31/colors.xml
@@ -1,6 +1,9 @@
+
+ @android:color/system_neutral1_50
+
@android:color/system_neutral1_900
@android:color/system_neutral1_800
@android:color/system_neutral1_800
diff --git a/mastodon/src/main/res/values/strings_sk.xml b/mastodon/src/main/res/values/strings_sk.xml
index 9a833de9a..240f4b3d2 100644
--- a/mastodon/src/main/res/values/strings_sk.xml
+++ b/mastodon/src/main/res/values/strings_sk.xml
@@ -47,6 +47,7 @@
Blue
Brown
Yellow
+ Material You
Allow multiple choices
Translate
Show original
@@ -59,4 +60,4 @@
Welcome!
The shark salutes you! To get started, please enter your home instance’s domain name below.
example.social
-
\ No newline at end of file
+
diff --git a/mastodon/src/main/res/values/styles.xml b/mastodon/src/main/res/values/styles.xml
index f86688fdf..630a81df6 100644
--- a/mastodon/src/main/res/values/styles.xml
+++ b/mastodon/src/main/res/values/styles.xml
@@ -205,6 +205,122 @@
- @color/black
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+