From ba2d805197ce668eabc884300cee0f07d73ba242 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Sat, 9 Aug 2014 19:12:36 +0200 Subject: [PATCH] Added x and y to specify maxX and maxY in route. --- src/com/owncloud/android/ui/adapter/FileListListAdapter.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java index 44e64824..e2ad4fa3 100644 --- a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java +++ b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java @@ -168,7 +168,8 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter { // TODO change to user preview.png - HttpGet httpget = new HttpGet(mClient.getBaseUri() + "/ocs/v1.php/thumbnail?path=" + URLEncoder.encode(file.getRemotePath(), "UTF-8")); + //HttpGet httpget = new HttpGet(mClient.getBaseUri() + "/index.php/core/preview.png?file="+URLEncoder.encode(file.getRemotePath(), "UTF-8")+"&x=36&y=36&forceIcon=1"); + HttpGet httpget = new HttpGet(mClient.getBaseUri() + "/ocs/v1.php/thumbnail?x=50&y=50&path=" + URLEncoder.encode(file.getRemotePath(), "UTF-8")); HttpResponse response = httpclient.execute(httpget); HttpEntity entity = response.getEntity(); @@ -181,7 +182,6 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter { if (thumbnail != null){ addBitmapToCache(imageKey, thumbnail); } - } } catch(Exception e){ e.printStackTrace(); @@ -194,7 +194,9 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter { } protected void onPostExecute(Bitmap bitmap){ - fileIcon.setImageBitmap(bitmap); + if (bitmap != null){ + fileIcon.setImageBitmap(bitmap); + } } } -- 2.11.0