-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author Bartek Przybylski\r
+ * @author David A. Velasco\r
* Copyright (C) 2011 Bartek Przybylski\r
- * Copyright (C) 2012-2013 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
\r
/**\r
* A helper class for some string operations.\r
- * \r
- * @author Bartek Przybylski\r
- * @author David A. Velasco\r
*/\r
public class DisplayUtils {\r
\r
\r
private static final String[] sizeSuffixes = { "B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };\r
\r
- private final static Double THUMBNAIL_THRESHOLD = 0.5;\r
-\r
private static HashMap<String, String> mimeType2HUmanReadable;\r
static {\r
mimeType2HUmanReadable = new HashMap<String, String>();\r
return path;\r
}\r
\r
- /**\r
- *\r
- * @param mFiles\r
- * @return true: imageView, false: listView\r
- */\r
- public static boolean decideViewLayout(Vector<OCFile> mFiles){\r
- // decide image vs. file view\r
- double countImages = 0;\r
- double countFiles = 0;\r
-\r
- for (OCFile file : mFiles){\r
- if (!file.isFolder()){\r
- countFiles++;\r
-\r
- if (file.isImage()){\r
- countImages++;\r
- }\r
- }\r
- }\r
-\r
- if ((countImages / countFiles) >= THUMBNAIL_THRESHOLD){\r
- return true;\r
- } else {\r
- return false;\r
- }\r
- }\r
}\r