X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/ca2892bdf1928c67e5fcb6dbfa80262fcedb3117..c54d7e35d0efb3d1352ff6d1330cac185bef0a21:/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java diff --git a/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java b/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java index e0d0fcc9..f0ecf767 100644 --- a/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java +++ b/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java @@ -74,8 +74,8 @@ public class ThumbnailsCacheManager { public static Bitmap mDefaultImg = BitmapFactory.decodeResource( - MainApp.getAppContext().getResources(), - DisplayUtils.getFileTypeIconId("image/png", "default.png") + MainApp.getAppContext().getResources(), + R.drawable.file_image ); @@ -195,10 +195,6 @@ public class ThumbnailsCacheManager { } protected void onPostExecute(Bitmap bitmap){ - if (isCancelled()) { - bitmap = null; - } - if (bitmap != null) { final ImageView imageView = mImageViewReference.get(); final ThumbnailGenerationTask bitmapWorkerTask = getBitmapWorkerTask(imageView); @@ -323,11 +319,9 @@ public class ThumbnailsCacheManager { px, Bitmap.Config.ARGB_8888); Canvas c = new Canvas(resultBitmap); - ColorDrawable backgroundColor = - new ColorDrawable(MainApp.getAppContext().getResources(). - getColor(R.color.background_color)); - backgroundColor.draw(c); + c.drawColor(MainApp.getAppContext().getResources(). + getColor(R.color.background_color)); c.drawBitmap(bitmap, 0, 0, null); return resultBitmap; @@ -367,6 +361,7 @@ public class ThumbnailsCacheManager { if (bitmapData == null || bitmapData != file) { // Cancel previous task bitmapWorkerTask.cancel(true); + Log_OC.v(TAG, "Cancelled generation of thumbnail for a reused imageView"); } else { // The same work is already in progress return false;