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