+\r
+ private static boolean endWhile(OCFile parentDir, SharedPreferences setting) {\r
+ if (parentDir.getRemotePath().compareToIgnoreCase(OCFile.ROOT_PATH) == 0) {\r
+ return false;\r
+ } else {\r
+ return !setting.contains(parentDir.getRemoteId());\r
+ }\r
+ }\r
+\r
+ public static void setViewMode(OCFile file, boolean setGrid){\r
+ SharedPreferences setting = MainApp.getAppContext().getSharedPreferences(\r
+ "viewMode", Context.MODE_PRIVATE);\r
+\r
+ SharedPreferences.Editor editor = setting.edit();\r
+ editor.putBoolean(file.getRemoteId(), setGrid);\r
+ editor.commit();\r
+ }\r
+\r
+ /**\r
+ * sets the coloring of the given progress bar to color_accent.\r
+ *\r
+ * @param progressBar the progress bar to be colored\r
+ */\r
+ public static void colorPreLollipopHorizontalProgressBar(ProgressBar progressBar) {\r
+ if (progressBar != null && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {\r
+ int color = progressBar.getResources().getColor(R.color.color_accent);\r
+ progressBar.getIndeterminateDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN);\r
+ progressBar.getProgressDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * sets the coloring of the given seek bar to color_accent.\r
+ *\r
+ * @param seekBar the seek bar to be colored\r
+ */\r
+ public static void colorPreLollipopHorizontalSeekBar(SeekBar seekBar) {\r
+ if (seekBar != null && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {\r
+ colorPreLollipopHorizontalProgressBar(seekBar);\r
+\r
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\r
+ int color = seekBar.getResources().getColor(R.color.color_accent);\r
+ seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);\r
+ seekBar.getThumb().setColorFilter(color, PorterDuff.Mode.SRC_IN);\r
+ }\r
+ }\r
+ }\r