Example #1
0
 public static void setStoryOrderForFolder(
     Context context, String folderName, StoryOrder newValue) {
   SharedPreferences prefs = context.getSharedPreferences(PrefConstants.PREFERENCES, 0);
   Editor editor = prefs.edit();
   editor.putString(PrefConstants.FOLDER_STORY_ORDER_PREFIX + folderName, newValue.toString());
   editor.commit();
 }
Example #2
0
 public static StoryOrder getStoryOrderForFolder(Context context, String folderName) {
   SharedPreferences prefs = context.getSharedPreferences(PrefConstants.PREFERENCES, 0);
   return StoryOrder.valueOf(
       prefs.getString(
           PrefConstants.FOLDER_STORY_ORDER_PREFIX + folderName,
           getDefaultStoryOrder(prefs).toString()));
 }
Example #3
0
 private static StoryOrder getDefaultStoryOrder(SharedPreferences prefs) {
   return StoryOrder.valueOf(
       prefs.getString(PrefConstants.DEFAULT_STORY_ORDER, StoryOrder.NEWEST.toString()));
 }