use of android.content.SharedPreferences in project glimmr by brk3.
the class PhotoStreamGridFragment method storeNewestPhotoId.
@Override
public void storeNewestPhotoId(Photo photo) {
SharedPreferences prefs = mActivity.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
editor.putString(KEY_NEWEST_PHOTOSTREAM_PHOTO_ID, photo.getId());
editor.commit();
if (BuildConfig.DEBUG)
Log.d(getLogTag(), "Updated most recent photostream photo id to " + photo.getId());
}
use of android.content.SharedPreferences in project glimmr by brk3.
the class GroupPoolGridFragment method storeNewestPhotoId.
@Override
public void storeNewestPhotoId(Photo photo) {
SharedPreferences prefs = mActivity.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
editor.putString(KEY_NEWEST_GROUPPOOL_PHOTO_ID, photo.getId());
editor.commit();
if (BuildConfig.DEBUG)
Log.d(getLogTag(), "Updated most recent grouppool photo id to " + photo.getId());
}
use of android.content.SharedPreferences in project glimmr by brk3.
the class FavoritesGridFragment method storeNewestPhotoId.
@Override
public void storeNewestPhotoId(Photo photo) {
SharedPreferences prefs = mActivity.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
editor.putString(KEY_NEWEST_FAVORITES_PHOTO_ID, photo.getId());
editor.commit();
if (BuildConfig.DEBUG)
Log.d(getLogTag(), "Updated most recent favorites photo id to " + photo.getId());
}
use of android.content.SharedPreferences in project glimmr by brk3.
the class StackViewWidgetConfigure method loadWidgetType.
public static int loadWidgetType(Context context) {
SharedPreferences prefs = context.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_PRIVATE);
int widgetType = prefs.getInt(KEY_WIDGET_TYPE, -1);
if (widgetType == -1) {
Log.e(TAG, "No widgetType found in SharedPreferences (-1)");
widgetType = WIDGET_TYPE_EXPORE;
}
return widgetType;
}
use of android.content.SharedPreferences in project glimmr by brk3.
the class AppListener method scheduleAlarms.
@Override
public void scheduleAlarms(AlarmManager mgr, PendingIntent pendingIntent, Context context) {
/* If notifications off, ensure alarms are cancelled and return */
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean enableNotifications = prefs.getBoolean(Constants.KEY_ENABLE_NOTIFICATIONS, false);
if (!enableNotifications) {
if (BuildConfig.DEBUG)
Log.d(TAG, "Cancelling alarms");
AppService.cancelAlarms(context);
return;
}
mMinutes = getMinutes(context);
mgr.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + mMinutes * 60 * 1000, mMinutes * 60 * 1000, pendingIntent);
if (BuildConfig.DEBUG) {
Log.d(TAG, String.format("Set alarms for %d minute intervals", mMinutes));
}
}
Aggregations