Added x and y to specify maxX and maxY in route.
authortobiasKaminsky <tobias@kaminsky.me>
Sat, 9 Aug 2014 17:12:36 +0000 (19:12 +0200)
committertobiasKaminsky <tobias@kaminsky.me>
Sat, 9 Aug 2014 17:12:36 +0000 (19:12 +0200)
src/com/owncloud/android/ui/adapter/FileListListAdapter.java

index 44e6482..e2ad4fa 100644 (file)
@@ -168,7 +168,8 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
                         \r
 \r
                         // TODO change to user preview.png\r
-                        HttpGet httpget = new HttpGet(mClient.getBaseUri() + "/ocs/v1.php/thumbnail?path=" + URLEncoder.encode(file.getRemotePath(), "UTF-8"));\r
+                        //HttpGet httpget = new HttpGet(mClient.getBaseUri() + "/index.php/core/preview.png?file="+URLEncoder.encode(file.getRemotePath(), "UTF-8")+"&x=36&y=36&forceIcon=1");\r
+                        HttpGet httpget = new HttpGet(mClient.getBaseUri() + "/ocs/v1.php/thumbnail?x=50&y=50&path=" + URLEncoder.encode(file.getRemotePath(), "UTF-8"));\r
                         HttpResponse response = httpclient.execute(httpget);\r
                         HttpEntity entity = response.getEntity();\r
                         \r
@@ -181,7 +182,6 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
                             if (thumbnail != null){\r
                                 addBitmapToCache(imageKey, thumbnail);\r
                             }\r
-                            \r
                         }\r
                     } catch(Exception e){\r
                         e.printStackTrace();\r
@@ -194,7 +194,9 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
         }\r
         \r
         protected void onPostExecute(Bitmap bitmap){\r
-            fileIcon.setImageBitmap(bitmap);\r
+            if (bitmap != null){\r
+                fileIcon.setImageBitmap(bitmap);\r
+            }\r
         }\r
     }\r
   \r