Эх сурвалжийг харах

Fix. Some icons are not correct. Showed default file icon when there is not mimetype

jabarros 10 жил өмнө
parent
commit
fa159e4891

+ 6 - 3
src/com/owncloud/android/utils/DisplayUtils.java

@@ -164,9 +164,12 @@ public class DisplayUtils {
      */
      */
     public static int getResourceId(String mimetype, String filename) {
     public static int getResourceId(String mimetype, String filename) {
 
 
-        if (mimetype == null || "DIR".equals(mimetype)) {
+        if (mimetype == null) {
+            return R.drawable.file;
+
+        } else if ("DIR".equals(mimetype)) {
             return R.drawable.ic_menu_archive;
             return R.drawable.ic_menu_archive;
-            
+
         } else {
         } else {
             String [] parts = mimetype.split("/");
             String [] parts = mimetype.split("/");
             String type = parts[0];
             String type = parts[0];
@@ -318,7 +321,7 @@ public class DisplayUtils {
             }
             }
         }
         }
         
         
-        return dateString.toString().split(",")[0];
+        return dateString.toString().split(",")[0];
     }
     }
 
 
     /**
     /**