summaryrefslogtreecommitdiffstats
path: root/src/com/cyngn/theme/util/PreferenceUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/cyngn/theme/util/PreferenceUtils.java')
-rw-r--r--src/com/cyngn/theme/util/PreferenceUtils.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/cyngn/theme/util/PreferenceUtils.java b/src/com/cyngn/theme/util/PreferenceUtils.java
index f3c7d02..6b3417d 100644
--- a/src/com/cyngn/theme/util/PreferenceUtils.java
+++ b/src/com/cyngn/theme/util/PreferenceUtils.java
@@ -16,6 +16,7 @@ import java.util.Set;
public class PreferenceUtils {
public static final String PREF_APPLIED_BASE_THEME = "applied_base_theme";
public static final String PREF_UPDATED_THEMES = "updated_themes";
+ public static final String PREF_NEWLY_INSTALLED_THEME_COUNT = "newly_installed_theme_count";
public static SharedPreferences getSharedPreferences(Context context) {
if (context == null) return null;
@@ -80,4 +81,18 @@ public class PreferenceUtils {
Set<String> updatedThemes = getUpdatedThemes(context);
return updatedThemes != null && updatedThemes.contains(pkgName);
}
+
+ public static int getNewlyInstalledThemeCount(Context context) {
+ SharedPreferences prefs = getSharedPreferences(context);
+ if (prefs == null) return 0;
+
+ return prefs.getInt(PREF_NEWLY_INSTALLED_THEME_COUNT, 0);
+ }
+
+ public static void setNewlyInstalledThemeCount(Context context, int count) {
+ SharedPreferences prefs = getSharedPreferences(context);
+ if (prefs != null) {
+ prefs.edit().putInt(PREF_NEWLY_INSTALLED_THEME_COUNT, count).apply();
+ }
+ }
}