예제 #1
0
 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();
 }
예제 #2
0
 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()));
 }
예제 #3
0
 private static ReadFilter getDefaultReadFilter(SharedPreferences prefs) {
   return ReadFilter.valueOf(
       prefs.getString(PrefConstants.DEFAULT_READ_FILTER, ReadFilter.ALL.toString()));
 }