+            return dots + url;\r
+        }\r
+    }\r
+\r
+    /**\r
+     * Get the file extension if it is on path as type "content://.../DocInfo.doc"\r
+     * @param filepath: Content Uri converted to string format\r
+     * @return String: fileExtension (type '.pdf'). Empty if no extension\r
+     */\r
+    public static String getComposedFileExtension(String filepath) {\r
+        String fileExtension = "";\r
+        String fileNameInContentUri = filepath.substring(filepath.lastIndexOf("/"));\r
+\r
+        // Check if extension is included in uri\r
+        int pos = fileNameInContentUri.lastIndexOf('.');\r
+        if (pos >= 0) {\r
+            fileExtension = fileNameInContentUri.substring(pos);\r
+        }\r
+        return fileExtension;\r
+    }\r
+\r
+    @SuppressWarnings("deprecation")\r
+    public static CharSequence getRelativeDateTimeString (\r
+            Context c, long time, long minResolution, long transitionResolution, int flags\r
+            ){\r
+        \r
+        CharSequence dateString = "";\r
+        \r
+        // in Future\r
+        if (time > System.currentTimeMillis()){\r
+            return DisplayUtils.unixTimeToHumanReadable(time);\r
+        } \r
+        // < 60 seconds -> seconds ago\r
+        else if ((System.currentTimeMillis() - time) < 60 * 1000) {\r
+            return c.getString(R.string.file_list_seconds_ago);\r
+        } else {\r
+            dateString = DateUtils.getRelativeDateTimeString(c, time, minResolution, transitionResolution, flags);\r
+        }\r
+\r
+        String[] parts = dateString.toString().split(",");\r
+        if (parts.length == 2) {\r
+            if (parts[1].contains(":") && !parts[0].contains(":")) {\r
+                return parts[0];\r
+            } else if (parts[0].contains(":") && !parts[1].contains(":")) {\r
+                return parts[1];\r
+            }\r
+        }\r
+        //dateString contains unexpected format. fallback: use relative date time string from android api as is.\r
+        return dateString.toString();\r
+    }\r
+\r
+    /**\r
+     * Update the passed path removing the last "/" if it is not the root folder\r
+     * @param path\r
+     */\r
+    public static String getPathWithoutLastSlash(String path) {\r
+\r
+        // Remove last slash from path\r
+        if (path.length() > 1 && path.charAt(path.length()-1) == OCFile.PATH_SEPARATOR.charAt(0)) {\r
+            path = path.substring(0, path.length()-1);\r
+        }\r
+        return path;\r
+    }\r
+\r
+\r
+    /**\r
+     * Gets the screen size in pixels in a backwards compatible way\r
+     *\r
+     * @param caller        Activity calling; needed to get access to the {@link android.view.WindowManager}\r
+     * @return              Size in pixels of the screen, or default {@link Point} if caller is null\r
+     */\r
+    public static Point getScreenSize(Activity caller) {\r
+        Point size = new Point();\r
+        if (caller != null) {\r
+            Display display = caller.getWindowManager().getDefaultDisplay();\r
+            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR2) {\r
+                display.getSize(size);\r
+            } else {\r
+                size.set(display.getWidth(), display.getHeight());\r
+            }\r
+        }\r
+        return size;\r
+    }\r
+\r
+    /**\r
+     * Determines if user set folder to grid or list view. If folder is not set itself,\r
+     * it finds a parent that is set (at least root is set).\r
+     * @param file\r
+     * @param storageManager\r
+     * @return\r
+     */\r
+    public static boolean isGridView(OCFile file, FileDataStorageManager storageManager){\r
+        if (file != null) {\r
+            OCFile fileToTest = file;\r
+            OCFile parentDir = null;\r
+            String parentPath = null;\r
+\r
+            SharedPreferences setting = MainApp.getAppContext().getSharedPreferences(\r
+                    "viewMode", Context.MODE_PRIVATE);\r
+\r
+            if (setting.contains(fileToTest.getRemoteId())) {\r
+                return setting.getBoolean(fileToTest.getRemoteId(), false);\r
+            } else {\r
+                do {\r
+                    if (fileToTest.getParentId() != FileDataStorageManager.ROOT_PARENT_ID) {\r
+                        parentPath = new File(fileToTest.getRemotePath()).getParent();\r
+                        parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :\r
+                                parentPath + OCFile.PATH_SEPARATOR;\r
+                        parentDir = storageManager.getFileByPath(parentPath);\r
+                    } else {\r
+                        parentDir = storageManager.getFileByPath(OCFile.ROOT_PATH);\r
+                    }\r
+\r
+                    while (parentDir == null) {\r
+                        parentPath = new File(parentPath).getParent();\r
+                        parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :\r
+                                parentPath + OCFile.PATH_SEPARATOR;\r
+                        parentDir = storageManager.getFileByPath(parentPath);\r
+                    }\r
+                    fileToTest = parentDir;\r
+                } while (endWhile(parentDir, setting));\r
+                return setting.getBoolean(fileToTest.getRemoteId(), false);\r
+            }\r
+        } else {\r
+            return false;\r
+        }\r
+    }\r
+\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