Making material you default for devices that support it. For devices that dont, still setting purple as the main theme.
This commit is contained in:
@@ -4,6 +4,7 @@ import static org.joinmastodon.android.api.MastodonAPIController.gson;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
@@ -56,7 +57,12 @@ public class GlobalUserPreferences{
|
|||||||
voteButtonForSingleChoice=prefs.getBoolean("voteButtonForSingleChoice", true);
|
voteButtonForSingleChoice=prefs.getBoolean("voteButtonForSingleChoice", true);
|
||||||
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
|
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
|
||||||
recentLanguages=fromJson(prefs.getString("recentLanguages", "{}"), recentLanguagesType, new HashMap<>());
|
recentLanguages=fromJson(prefs.getString("recentLanguages", "{}"), recentLanguagesType, new HashMap<>());
|
||||||
color=ColorPreference.values()[prefs.getInt("color", 1)];
|
if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.S){
|
||||||
|
color=ColorPreference.values()[prefs.getInt("color", 0)];
|
||||||
|
}else{
|
||||||
|
color=ColorPreference.values()[prefs.getInt("color", 1)];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void save(){
|
public static void save(){
|
||||||
@@ -78,13 +84,13 @@ public class GlobalUserPreferences{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum ColorPreference{
|
public enum ColorPreference{
|
||||||
PINK,
|
MATERIAL3,
|
||||||
PURPLE,
|
PURPLE,
|
||||||
|
PINK,
|
||||||
GREEN,
|
GREEN,
|
||||||
BLUE,
|
BLUE,
|
||||||
ORANGE,
|
ORANGE,
|
||||||
YELLOW,
|
YELLOW
|
||||||
MATERIAL3
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ThemePreference{
|
public enum ThemePreference{
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:id="@+id/m3_color" android:title="@string/sk_color_theme_material3"/>
|
||||||
<item android:id="@+id/purple_color" android:title="@string/sk_color_theme_purple"/>
|
<item android:id="@+id/purple_color" android:title="@string/sk_color_theme_purple"/>
|
||||||
<item android:id="@+id/pink_color" android:title="@string/sk_color_theme_pink"/>
|
<item android:id="@+id/pink_color" android:title="@string/sk_color_theme_pink"/>
|
||||||
<item android:id="@+id/green_color" android:title="@string/sk_color_theme_green"/>
|
<item android:id="@+id/green_color" android:title="@string/sk_color_theme_green"/>
|
||||||
<item android:id="@+id/blue_color" android:title="@string/sk_color_theme_blue"/>
|
<item android:id="@+id/blue_color" android:title="@string/sk_color_theme_blue"/>
|
||||||
<item android:id="@+id/orange_color" android:title="@string/sk_color_theme_brown"/>
|
<item android:id="@+id/orange_color" android:title="@string/sk_color_theme_brown"/>
|
||||||
<item android:id="@+id/yellow_color" android:title="@string/sk_color_theme_yellow"/>
|
<item android:id="@+id/yellow_color" android:title="@string/sk_color_theme_yellow"/>
|
||||||
<item android:id="@+id/m3_color" android:title="@string/sk_color_theme_material3"/>
|
|
||||||
</menu>
|
</menu>
|
||||||
Reference in New Issue
Block a user