Merge remote-tracking branch 'remotes/upstream/resizedImages' into beta
authortobiasKaminsky <tobias@kaminsky.me>
Sat, 31 Oct 2015 07:36:39 +0000 (08:36 +0100)
committertobiasKaminsky <tobias@kaminsky.me>
Sat, 31 Oct 2015 07:36:39 +0000 (08:36 +0100)
src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java
src/com/owncloud/android/ui/adapter/FileListListAdapter.java

index 3586fd5..56c9063 100644 (file)
@@ -424,13 +424,20 @@ public class ThumbnailsCacheManager {
         }
 
         private Bitmap doFileInBackground(Boolean mIsThumbnail) {
-            Bitmap thumbnail = null;
             File file = (File)mFile;
 
-            final String imageKey = String.valueOf(file.hashCode());
+            // distinguish between thumbnail and resized image
+            String temp = String.valueOf(file.hashCode());
+            if (mIsThumbnail){
+                temp = "t" + temp;
+            } else {
+                temp = "r" + temp;
+            }
+
+            final String imageKey = temp;
 
             // Check disk cache in background thread
-            thumbnail = getBitmapFromDiskCache(imageKey);
+            Bitmap thumbnail = getBitmapFromDiskCache(imageKey);
 
             // Not found in disk cache
             if (thumbnail == null) {
index 7657d10..3aecd7e 100644 (file)
@@ -325,8 +325,7 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
                 if (file.isImage() && file.getRemoteId() != null){\r
                     // Thumbnail in Cache?\r
                     Bitmap thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(\r
-                            String.valueOf(file.getRemoteId())\r
-                            );\r
+                            "t" + String.valueOf(file.getRemoteId()));\r
                     if (thumbnail != null && !file.needsUpdateThumbnail()){\r
                         fileIcon.setImageBitmap(thumbnail);\r
                     } else {\r