Merge tag 'oc-android-1-3-22' into oauth_login
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / fragment / FileDetailFragment.java
index 5595583..3668ff3 100644 (file)
@@ -1,9 +1,10 @@
 /* ownCloud Android client application\r
  *   Copyright (C) 2011  Bartek Przybylski\r
+ *   Copyright (C) 2012-2013 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 as published by\r
- *   the Free Software Foundation, either version 3 of the License, or\r
+ *   the Free Software Foundation, either version 2 of the License, or\r
  *   (at your option) any later version.\r
  *\r
  *   This program is distributed in the hope that it will be useful,\r
@@ -489,8 +490,7 @@ public class FileDetailFragment extends SherlockFragment implements
             \r
             // set file details\r
             setFilename(mFile.getFileName());\r
-            setFiletype(DisplayUtils.convertMIMEtoPrettyPrint(mFile\r
-                    .getMimetype()));\r
+            setFiletype(mFile.getMimetype());\r
             setFilesize(mFile.getFileLength());\r
             if(ocVersionSupportsTimeCreated()){\r
                 setTimeCreated(mFile.getCreationTimestamp());\r
@@ -542,8 +542,14 @@ public class FileDetailFragment extends SherlockFragment implements
      */\r
     private void setFiletype(String mimetype) {\r
         TextView tv = (TextView) getView().findViewById(R.id.fdType);\r
-        if (tv != null)\r
-            tv.setText(mimetype);\r
+        if (tv != null) {\r
+            String printableMimetype = DisplayUtils.convertMIMEtoPrettyPrint(mimetype);;        \r
+            tv.setText(printableMimetype);\r
+        }\r
+        ImageView iv = (ImageView) getView().findViewById(R.id.fdIcon);\r
+        if (iv != null) {\r
+            iv.setImageResource(DisplayUtils.getResourceId(mimetype));\r
+        }\r
     }\r
 \r
     /**\r