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:
LucasGGamerM
2022-12-16 12:07:29 -03:00
parent 390ecc48fb
commit bce2367cfc
2 changed files with 11 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ import static org.joinmastodon.android.api.MastodonAPIController.gson;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
@@ -56,7 +57,12 @@ public class GlobalUserPreferences{
voteButtonForSingleChoice=prefs.getBoolean("voteButtonForSingleChoice", true);
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
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(){
@@ -78,13 +84,13 @@ public class GlobalUserPreferences{
}
public enum ColorPreference{
PINK,
MATERIAL3,
PURPLE,
PINK,
GREEN,
BLUE,
ORANGE,
YELLOW,
MATERIAL3
YELLOW
}
public enum ThemePreference{