예제 #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();
 }
예제 #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()));
 }
예제 #3
0
 private static StoryOrder getDefaultStoryOrder(SharedPreferences prefs) {
   return StoryOrder.valueOf(
       prefs.getString(PrefConstants.DEFAULT_STORY_ORDER, StoryOrder.NEWEST.toString()));
 }