Changeset View
Changeset View
Standalone View
Standalone View
app/src/main/java/it/reyboz/bustorino/data/PreferencesHolder.java
Show All 33 Lines | |||||
public abstract class PreferencesHolder { | public abstract class PreferencesHolder { | ||||
public static final String PREF_GTFS_DB_VERSION = "gtfs_db_version"; | public static final String PREF_GTFS_DB_VERSION = "gtfs_db_version"; | ||||
public static final String PREF_INTRO_ACTIVITY_RUN ="pref_intro_activity_run"; | public static final String PREF_INTRO_ACTIVITY_RUN ="pref_intro_activity_run"; | ||||
public static final String DB_GTT_VERSION_KEY = "NextGenDB.GTTVersion"; | public static final String DB_GTT_VERSION_KEY = "NextGenDB.GTTVersion"; | ||||
public static final String DB_LAST_UPDATE_KEY = "NextGenDB.LastDBUpdate"; | public static final String DB_LAST_UPDATE_KEY = "NextGenDB.LastDBUpdate"; | ||||
public static final String PREF_FAVORITE_LINES = "pref_favorite_lines"; | public static final String PREF_FAVORITE_LINES = "pref_favorite_lines"; | ||||
public static final Set<String> KEYS_MERGE_SET = Set.of(PREF_FAVORITE_LINES); | |||||
public static final Set<String> IGNORE_KEYS_LOAD_MAIN = Set.of(PREF_GTFS_DB_VERSION, PREF_INTRO_ACTIVITY_RUN, DB_GTT_VERSION_KEY, DB_LAST_UPDATE_KEY); | public static final Set<String> IGNORE_KEYS_LOAD_MAIN = Set.of(PREF_GTFS_DB_VERSION, PREF_INTRO_ACTIVITY_RUN, DB_GTT_VERSION_KEY, DB_LAST_UPDATE_KEY); | ||||
public static SharedPreferences getMainSharedPreferences(Context context){ | public static SharedPreferences getMainSharedPreferences(Context context){ | ||||
return context.getSharedPreferences(context.getString(R.string.mainSharedPreferences), MODE_PRIVATE); | return context.getSharedPreferences(context.getString(R.string.mainSharedPreferences), MODE_PRIVATE); | ||||
} | } | ||||
public static SharedPreferences getAppPreferences(Context con){ | public static SharedPreferences getAppPreferences(Context con){ | ||||
return PreferenceManager.getDefaultSharedPreferences(con); | return PreferenceManager.getDefaultSharedPreferences(con); | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register