use of android.content.SharedPreferences in project iosched by google.
the class MyScheduleModel method addDataObservers.
/**
* Observe changes on base uri and in shared preferences
*/
private void addDataObservers() {
mContext.getContentResolver().registerContentObserver(ScheduleContract.BASE_CONTENT_URI, true, mObserver);
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
sp.registerOnSharedPreferenceChangeListener(mPrefChangeListener);
}
use of android.content.SharedPreferences in project iosched by google.
the class ConfMessageCardUtils method unregisterPreferencesChangeListener.
/**
* Unregister a {@code listener} which is notified when these settings are changed.
*
* @param context A context that has the same lifecycle as the listener that will be returned.
* @param listener Listener to unregister.
*/
public static void unregisterPreferencesChangeListener(final Context context, ConferencePrefChangeListener listener) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
sp.unregisterOnSharedPreferenceChangeListener(listener);
}
use of android.content.SharedPreferences in project iosched by google.
the class ConfMessageCardUtils method markDismissedConfMessageCard.
/**
* Mark that the user has dismissed one of the conference message cards so the app doesn't
* show that card to them again.
*
* @param context Context to be used to lookup the {@link android.content.SharedPreferences}.
* @param card One of the ConfMessageCard enum values
*/
public static void markDismissedConfMessageCard(final Context context, ConfMessageCard card) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
sp.edit().putBoolean(card.getDismissedPreferenceKey(), true).apply();
}
use of android.content.SharedPreferences in project iosched by google.
the class SettingsUtils method markConductAccepted.
/**
* Mark {@code newValue whether} the user has accepted the Code of Conduct 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 markConductAccepted(final Context context, boolean newValue) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
sp.edit().putBoolean(PREF_CONDUCT_ACCEPTED, newValue).apply();
}
use of android.content.SharedPreferences in project iosched by google.
the class SettingsUtils method setCurSyncInterval.
/**
* Set a new interval for the data sync time.
*
* @param context Context to be used to edit the {@link android.content.SharedPreferences}.
* @param newValue New value that will be set.
*/
public static void setCurSyncInterval(final Context context, long newValue) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
sp.edit().putLong(PREF_CUR_SYNC_INTERVAL, newValue).apply();
}
Aggregations