public static Bitmap mDefaultImg =
BitmapFactory.decodeResource(
- MainApp.getAppContext().getResources(),
- DisplayUtils.getFileTypeIconId("image/png", "default.png")
+ MainApp.getAppContext().getResources(),
+ R.drawable.file_image
);
}
protected void onPostExecute(Bitmap bitmap){
- if (isCancelled()) {
- bitmap = null;
- }
-
if (bitmap != null) {
final ImageView imageView = mImageViewReference.get();
final ThumbnailGenerationTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
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;
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;