From fa159e4891c30983cb58c85957963e143d0c3ad4 Mon Sep 17 00:00:00 2001 From: jabarros Date: Wed, 31 Dec 2014 14:25:24 +0100 Subject: [PATCH] Fix. Some icons are not correct. Showed default file icon when there is not mimetype --- src/com/owncloud/android/utils/DisplayUtils.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/owncloud/android/utils/DisplayUtils.java b/src/com/owncloud/android/utils/DisplayUtils.java index a1afb894..ec311a05 100644 --- a/src/com/owncloud/android/utils/DisplayUtils.java +++ b/src/com/owncloud/android/utils/DisplayUtils.java @@ -164,9 +164,12 @@ public class DisplayUtils { */ 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; - + } else { String [] parts = mimetype.split("/"); String type = parts[0]; @@ -318,7 +321,7 @@ public class DisplayUtils { } } - return dateString.toString().split(",")[0]; + return dateString.toString().split(",")[0]; } /** -- 2.11.0