public static void setReadFilterForFolder( Context context, String folderName, ReadFilter newValue) { SharedPreferences prefs = context.getSharedPreferences(PrefConstants.PREFERENCES, 0); Editor editor = prefs.edit(); editor.putString(PrefConstants.FOLDER_READ_FILTER_PREFIX + folderName, newValue.toString()); editor.commit(); }
public static ReadFilter getReadFilterForFolder(Context context, String folderName) { SharedPreferences prefs = context.getSharedPreferences(PrefConstants.PREFERENCES, 0); return ReadFilter.valueOf( prefs.getString( PrefConstants.FOLDER_READ_FILTER_PREFIX + folderName, getDefaultReadFilter(prefs).toString())); }
private static ReadFilter getDefaultReadFilter(SharedPreferences prefs) { return ReadFilter.valueOf( prefs.getString(PrefConstants.DEFAULT_READ_FILTER, ReadFilter.ALL.toString())); }