use of android.content.SharedPreferences in project iosched by google.
the class SettingsUtils method markDataBootstrapDone.
/**
* Mark that the app has finished loading the {@code R.raw.bootstrap_data bootstrap data}.
*
* @param context Context to be used to edit the {@link android.content.SharedPreferences}.
*/
public static void markDataBootstrapDone(final Context context) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
sp.edit().putBoolean(BuildConfig.PREF_DATA_BOOTSTRAP_DONE, true).apply();
}
use of android.content.SharedPreferences in project iosched by google.
the class SettingsUtils method markTosAccepted.
/**
* Mark {@code newValue whether} the user has accepted the TOS so the app doesn't ask again.
*
* @param context Context to be used to edit the {@link android.content.SharedPreferences}.
* @param newValue New value that will be set.
*/
public static void markTosAccepted(final Context context, boolean newValue) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
sp.edit().putBoolean(PREF_TOS_ACCEPTED, newValue).apply();
}
use of android.content.SharedPreferences in project iosched by google.
the class SettingsUtils method setShowSessionFeedbackReminders.
/**
* @param context Context to be used to edit the {@link android.content.SharedPreferences}.
* @param show Whether app should show session feedback reminders
*/
public static void setShowSessionFeedbackReminders(final Context context, boolean show) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
sp.edit().putBoolean(BuildConfig.PREF_SESSION_FEEDBACK_REMINDERS_ENABLED, show).apply();
}
use of android.content.SharedPreferences in project iosched by google.
the class SettingsUtils method markAnsweredLocalOrRemote.
/**
* Mark that the user answered whether they're a local or remote I/O attendee.
*
* @param context Context to be used to edit the {@link android.content.SharedPreferences}.
* @param newValue New value that will be set.
*/
public static void markAnsweredLocalOrRemote(final Context context, boolean newValue) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
sp.edit().putBoolean(PREF_ANSWERED_LOCAL_OR_REMOTE, newValue).apply();
}
use of android.content.SharedPreferences in project iosched by google.
the class SettingsUtils method registerOnSharedPreferenceChangeListener.
/**
* Helper method to register a settings_prefs listener. This method does not automatically handle
* {@code unregisterOnSharedPreferenceChangeListener() un-registering} the listener at the end
* of the {@code context} lifecycle.
*
* @param context Context to be used to lookup the {@link android.content.SharedPreferences}.
* @param listener Listener to register.
*/
public static void registerOnSharedPreferenceChangeListener(final Context context, SharedPreferences.OnSharedPreferenceChangeListener listener) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
sp.registerOnSharedPreferenceChangeListener(listener);
}
Aggregations