From 86b92a17537178d032084f01a8efef8e78f7ff2a Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Tue, 25 Aug 2015 13:34:41 +0200 Subject: [PATCH 01/10] add support for showing animated gifs in imagePreview --- .../android/ui/preview/ImageViewCustom.java | 81 ++++++++++++++++--- .../ui/preview/PreviewImageFragment.java | 7 +- 2 files changed, 75 insertions(+), 13 deletions(-) diff --git a/src/com/owncloud/android/ui/preview/ImageViewCustom.java b/src/com/owncloud/android/ui/preview/ImageViewCustom.java index 69182d6e0b..e249bd06be 100644 --- a/src/com/owncloud/android/ui/preview/ImageViewCustom.java +++ b/src/com/owncloud/android/ui/preview/ImageViewCustom.java @@ -4,13 +4,18 @@ import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; +import android.graphics.Movie; import android.os.Build; import android.util.AttributeSet; import android.view.View; import android.widget.ImageView; +import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.common.utils.Log_OC; +import java.io.FileInputStream; +import java.io.InputStream; + public class ImageViewCustom extends ImageView { private static final String TAG = ImageViewCustom.class.getSimpleName(); @@ -23,7 +28,12 @@ public class ImageViewCustom extends ImageView { private int mBitmapHeight; private int mBitmapWidth; - + private Movie gifMovie; + private int movieWidth, movieHeight; + private long movieDuration; + private long movieRunDuration; + private long lastTick; + public ImageViewCustom(Context context) { super(context); } @@ -39,18 +49,54 @@ public class ImageViewCustom extends ImageView { @SuppressLint("NewApi") @Override protected void onDraw(Canvas canvas) { - if(IS_ICS_OR_HIGHER && checkIfMaximumBitmapExceed(canvas) || IS_VERSION_BUGGY_ON_RECYCLES ) { // Software type is set with two targets: // 1. prevent that bitmaps larger than maximum textures allowed are shown as black views in devices // with LAYER_TYPE_HARDWARE enabled by default; - // 2. grant that bitmaps are correctly dellocated from memory in versions suffering the bug fixed in + // 2. grant that bitmaps are correctly de-allocated from memory in versions suffering the bug fixed in // https://android.googlesource.com/platform/frameworks/base/+/034de6b1ec561797a2422314e6ef03e3cd3e08e0; // setLayerType(View.LAYER_TYPE_SOFTWARE, null); } - super.onDraw(canvas); + if(gifMovie == null){ + super.onDraw(canvas); + } else { + long nowTick = android.os.SystemClock.uptimeMillis(); + if (lastTick == 0) { + movieRunDuration = 0; + } else { + movieRunDuration += nowTick -lastTick; + if(movieRunDuration > movieDuration){ + movieRunDuration = 0; + } + } + + gifMovie.setTime((int) movieRunDuration); + + float scale; + if(gifMovie.height() > getHeight() || gifMovie.width() > getWidth()) { + scale = (1f / Math.min(canvas.getHeight() / gifMovie.height(), + canvas.getWidth() / gifMovie.width())) + 0.25f; + } else { + scale = Math.min(canvas.getHeight() / gifMovie.height(), + canvas.getWidth() / gifMovie.width()); + } + + canvas.scale(scale, scale); + canvas.translate(((float) getWidth() / scale - (float) gifMovie.width()) / 2f, + ((float) getHeight() / scale - (float) gifMovie.height()) /2f); + + gifMovie.draw(canvas, 0, 0); + + lastTick = nowTick; + invalidate(); + } + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + setMeasuredDimension(movieWidth, movieHeight); } /** @@ -60,13 +106,9 @@ public class ImageViewCustom extends ImageView { */ @SuppressLint("NewApi") private boolean checkIfMaximumBitmapExceed(Canvas canvas) { - Log_OC.v(TAG, "Canvas maximum: " + canvas.getMaximumBitmapWidth() + " - " + canvas.getMaximumBitmapHeight()); - if (mBitmapWidth > canvas.getMaximumBitmapWidth() - || mBitmapHeight > canvas.getMaximumBitmapHeight()) { - return true; - } - - return false; + return mBitmapWidth > canvas.getMaximumBitmapWidth() + || mBitmapHeight > canvas.getMaximumBitmapHeight(); + } @Override @@ -74,10 +116,25 @@ public class ImageViewCustom extends ImageView { * Keeps the size of the bitmap cached in member variables for faster access in {@link #onDraw(Canvas)} , * but without keeping another reference to the {@link Bitmap} */ - public void setImageBitmap (Bitmap bm) { + public void setImageBitmap(Bitmap bm) { mBitmapWidth = bm.getWidth(); mBitmapHeight = bm.getHeight(); super.setImageBitmap(bm); } + public void setGifImage(OCFile file){ + try { + InputStream gifInputStream = new FileInputStream(file.getStoragePath()); + setLayerType(View.LAYER_TYPE_SOFTWARE, null); + setFocusable(true); + + gifMovie = Movie.decodeStream(gifInputStream); + movieWidth = gifMovie.width(); + movieHeight = gifMovie.height(); + movieDuration = gifMovie.duration(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } diff --git a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java index da5be22d04..f52dd29b15 100644 --- a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java @@ -504,7 +504,12 @@ public class PreviewImageFragment extends FileFragment { imageView.setBackground(backrepeat); } - imageView.setImageBitmap(bitmap); + if (result.ocFile.getMimetype().equalsIgnoreCase("image/gif")){ + imageView.setGifImage(result.ocFile); + } else { + imageView.setImageBitmap(bitmap); + } + imageView.setVisibility(View.VISIBLE); mBitmap = bitmap; // needs to be kept for recycling when not useful } From 7e583891f06d358ed7dc6696b55d74cfec48d450 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 16 Sep 2015 20:15:46 +0200 Subject: [PATCH 02/10] - variables with m - onMeasure sets always width/height --- .../android/ui/preview/ImageViewCustom.java | 57 ++++++++++--------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/com/owncloud/android/ui/preview/ImageViewCustom.java b/src/com/owncloud/android/ui/preview/ImageViewCustom.java index e249bd06be..5bb24e7b8d 100644 --- a/src/com/owncloud/android/ui/preview/ImageViewCustom.java +++ b/src/com/owncloud/android/ui/preview/ImageViewCustom.java @@ -11,7 +11,6 @@ import android.view.View; import android.widget.ImageView; import com.owncloud.android.datamodel.OCFile; -import com.owncloud.android.lib.common.utils.Log_OC; import java.io.FileInputStream; import java.io.InputStream; @@ -28,11 +27,11 @@ public class ImageViewCustom extends ImageView { private int mBitmapHeight; private int mBitmapWidth; - private Movie gifMovie; - private int movieWidth, movieHeight; - private long movieDuration; - private long movieRunDuration; - private long lastTick; + private Movie mGifMovie; + private int mMovieWidth, mMovieHeight; + private long mMovieDuration; + private long mMovieRunDuration; + private long mLastTick; public ImageViewCustom(Context context) { super(context); @@ -59,44 +58,48 @@ public class ImageViewCustom extends ImageView { setLayerType(View.LAYER_TYPE_SOFTWARE, null); } - if(gifMovie == null){ + if(mGifMovie == null){ super.onDraw(canvas); } else { long nowTick = android.os.SystemClock.uptimeMillis(); - if (lastTick == 0) { - movieRunDuration = 0; + if (mLastTick == 0) { + mMovieRunDuration = 0; } else { - movieRunDuration += nowTick -lastTick; - if(movieRunDuration > movieDuration){ - movieRunDuration = 0; + mMovieRunDuration += nowTick - mLastTick; + if(mMovieRunDuration > mMovieDuration){ + mMovieRunDuration = 0; } } - gifMovie.setTime((int) movieRunDuration); + mGifMovie.setTime((int) mMovieRunDuration); float scale; - if(gifMovie.height() > getHeight() || gifMovie.width() > getWidth()) { - scale = (1f / Math.min(canvas.getHeight() / gifMovie.height(), - canvas.getWidth() / gifMovie.width())) + 0.25f; + if(mGifMovie.height() > getHeight() || mGifMovie.width() > getWidth()) { + scale = (1f / Math.min(canvas.getHeight() / mGifMovie.height(), + canvas.getWidth() / mGifMovie.width())) + 0.25f; } else { - scale = Math.min(canvas.getHeight() / gifMovie.height(), - canvas.getWidth() / gifMovie.width()); + scale = Math.min(canvas.getHeight() / mGifMovie.height(), + canvas.getWidth() / mGifMovie.width()); } canvas.scale(scale, scale); - canvas.translate(((float) getWidth() / scale - (float) gifMovie.width()) / 2f, - ((float) getHeight() / scale - (float) gifMovie.height()) /2f); + canvas.translate(((float) getWidth() / scale - (float) mGifMovie.width()) / 2f, + ((float) getHeight() / scale - (float) mGifMovie.height()) /2f); - gifMovie.draw(canvas, 0, 0); + mGifMovie.draw(canvas, 0, 0); - lastTick = nowTick; + mLastTick = nowTick; invalidate(); } } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - setMeasuredDimension(movieWidth, movieHeight); + if (mGifMovie == null){ + setMeasuredDimension(widthMeasureSpec, heightMeasureSpec); + } else { + setMeasuredDimension(mMovieWidth, mMovieHeight); + } } /** @@ -128,10 +131,10 @@ public class ImageViewCustom extends ImageView { setLayerType(View.LAYER_TYPE_SOFTWARE, null); setFocusable(true); - gifMovie = Movie.decodeStream(gifInputStream); - movieWidth = gifMovie.width(); - movieHeight = gifMovie.height(); - movieDuration = gifMovie.duration(); + mGifMovie = Movie.decodeStream(gifInputStream); + mMovieWidth = mGifMovie.width(); + mMovieHeight = mGifMovie.height(); + mMovieDuration = mGifMovie.duration(); } catch (Exception e) { e.printStackTrace(); } From 4adecc96e865285f9b793b3d3fb2f939e9e73206 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 13 Jun 2016 21:16:27 +0200 Subject: [PATCH 03/10] changes due to CR --- .../android/ui/preview/ImageViewCustom.java | 29 ++++++++++++------- .../ui/preview/PreviewImageFragment.java | 6 ++-- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/com/owncloud/android/ui/preview/ImageViewCustom.java b/src/com/owncloud/android/ui/preview/ImageViewCustom.java index 5bb24e7b8d..b1318bf8cc 100644 --- a/src/com/owncloud/android/ui/preview/ImageViewCustom.java +++ b/src/com/owncloud/android/ui/preview/ImageViewCustom.java @@ -11,6 +11,7 @@ import android.view.View; import android.widget.ImageView; import com.owncloud.android.datamodel.OCFile; +import com.owncloud.android.lib.common.utils.Log_OC; import java.io.FileInputStream; import java.io.InputStream; @@ -73,14 +74,7 @@ public class ImageViewCustom extends ImageView { mGifMovie.setTime((int) mMovieRunDuration); - float scale; - if(mGifMovie.height() > getHeight() || mGifMovie.width() > getWidth()) { - scale = (1f / Math.min(canvas.getHeight() / mGifMovie.height(), - canvas.getWidth() / mGifMovie.width())) + 0.25f; - } else { - scale = Math.min(canvas.getHeight() / mGifMovie.height(), - canvas.getWidth() / mGifMovie.width()); - } + float scale = getScaleToViewFactor(mGifMovie, canvas); canvas.scale(scale, scale); canvas.translate(((float) getWidth() / scale - (float) mGifMovie.width()) / 2f, @@ -93,6 +87,21 @@ public class ImageViewCustom extends ImageView { } } + private float getScaleToViewFactor(Movie movie, Canvas canvas){ + float scale; + + if (movie.height() > getHeight() || movie.width() > getWidth()) { + float offset = 0.25f; + scale = (1f / Math.min(canvas.getHeight() / movie.height(), + canvas.getWidth() / movie.width())) + offset; + } else { + scale = Math.min(canvas.getHeight() / movie.height(), + canvas.getWidth() / movie.width()); + } + + return scale; + } + @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (mGifMovie == null){ @@ -125,7 +134,7 @@ public class ImageViewCustom extends ImageView { super.setImageBitmap(bm); } - public void setGifImage(OCFile file){ + public void setGIFImage(OCFile file) { try { InputStream gifInputStream = new FileInputStream(file.getStoragePath()); setLayerType(View.LAYER_TYPE_SOFTWARE, null); @@ -136,7 +145,7 @@ public class ImageViewCustom extends ImageView { mMovieHeight = mGifMovie.height(); mMovieDuration = mGifMovie.duration(); } catch (Exception e) { - e.printStackTrace(); + Log_OC.e(TAG, "Failed to set GIF image"); } } diff --git a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java index f52dd29b15..5e81e2ef9c 100644 --- a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java @@ -499,13 +499,13 @@ public class PreviewImageFragment extends FileFragment { Log_OC.d(TAG, "Showing image with resolution " + bitmap.getWidth() + "x" + bitmap.getHeight()); - if (result.ocFile.getMimetype().equalsIgnoreCase("image/png")){ + if (result.ocFile.getMimetype().equalsIgnoreCase("image/png")) { Drawable backrepeat = getResources().getDrawable(R.drawable.backrepeat); imageView.setBackground(backrepeat); } - if (result.ocFile.getMimetype().equalsIgnoreCase("image/gif")){ - imageView.setGifImage(result.ocFile); + if (result.ocFile.getMimetype().equalsIgnoreCase("image/gif")) { + imageView.setGIFImage(result.ocFile); } else { imageView.setImageBitmap(bitmap); } From 0a351f58992b8a7ef079e0aa684d5be51c0b98d3 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 13 Jun 2016 21:54:07 +0200 Subject: [PATCH 04/10] formatting --- src/com/owncloud/android/ui/preview/ImageViewCustom.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/owncloud/android/ui/preview/ImageViewCustom.java b/src/com/owncloud/android/ui/preview/ImageViewCustom.java index b1318bf8cc..d9c7bfe7a3 100644 --- a/src/com/owncloud/android/ui/preview/ImageViewCustom.java +++ b/src/com/owncloud/android/ui/preview/ImageViewCustom.java @@ -59,7 +59,7 @@ public class ImageViewCustom extends ImageView { setLayerType(View.LAYER_TYPE_SOFTWARE, null); } - if(mGifMovie == null){ + if(mGifMovie == null) { super.onDraw(canvas); } else { long nowTick = android.os.SystemClock.uptimeMillis(); From 6d7651eff917a6f276f9dcbd4b3343a0b077dcac Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 13 Jun 2016 22:03:11 +0200 Subject: [PATCH 05/10] return early --- .../owncloud/android/ui/preview/ImageViewCustom.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/com/owncloud/android/ui/preview/ImageViewCustom.java b/src/com/owncloud/android/ui/preview/ImageViewCustom.java index d9c7bfe7a3..2abc531e7a 100644 --- a/src/com/owncloud/android/ui/preview/ImageViewCustom.java +++ b/src/com/owncloud/android/ui/preview/ImageViewCustom.java @@ -87,19 +87,13 @@ public class ImageViewCustom extends ImageView { } } - private float getScaleToViewFactor(Movie movie, Canvas canvas){ - float scale; - + private float getScaleToViewFactor(Movie movie, Canvas canvas) { if (movie.height() > getHeight() || movie.width() > getWidth()) { float offset = 0.25f; - scale = (1f / Math.min(canvas.getHeight() / movie.height(), - canvas.getWidth() / movie.width())) + offset; - } else { - scale = Math.min(canvas.getHeight() / movie.height(), - canvas.getWidth() / movie.width()); + return (1f / Math.min(canvas.getHeight() / movie.height(), canvas.getWidth() / movie.width())) + offset; } - return scale; + return Math.min(canvas.getHeight() / movie.height(), canvas.getWidth() / movie.width()); } @Override From 82f9f338fdec783f91594f9e6a90aec902dea9e2 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 13 Jun 2016 22:04:34 +0200 Subject: [PATCH 06/10] again, small formatting --- src/com/owncloud/android/ui/preview/ImageViewCustom.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/owncloud/android/ui/preview/ImageViewCustom.java b/src/com/owncloud/android/ui/preview/ImageViewCustom.java index 2abc531e7a..3b26506a04 100644 --- a/src/com/owncloud/android/ui/preview/ImageViewCustom.java +++ b/src/com/owncloud/android/ui/preview/ImageViewCustom.java @@ -67,7 +67,7 @@ public class ImageViewCustom extends ImageView { mMovieRunDuration = 0; } else { mMovieRunDuration += nowTick - mLastTick; - if(mMovieRunDuration > mMovieDuration){ + if(mMovieRunDuration > mMovieDuration) { mMovieRunDuration = 0; } } @@ -98,7 +98,7 @@ public class ImageViewCustom extends ImageView { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - if (mGifMovie == null){ + if (mGifMovie == null) { setMeasuredDimension(widthMeasureSpec, heightMeasureSpec); } else { setMeasuredDimension(mMovieWidth, mMovieHeight); From 9eb6dc14ec9a670cec861ab6e89568f0b7ea8f3e Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 13 Jun 2016 22:11:42 +0200 Subject: [PATCH 07/10] moved up onDraw super call --- src/com/owncloud/android/ui/preview/ImageViewCustom.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/com/owncloud/android/ui/preview/ImageViewCustom.java b/src/com/owncloud/android/ui/preview/ImageViewCustom.java index 3b26506a04..93fe9b0ffb 100644 --- a/src/com/owncloud/android/ui/preview/ImageViewCustom.java +++ b/src/com/owncloud/android/ui/preview/ImageViewCustom.java @@ -58,10 +58,9 @@ public class ImageViewCustom extends ImageView { // setLayerType(View.LAYER_TYPE_SOFTWARE, null); } + super.onDraw(canvas); - if(mGifMovie == null) { - super.onDraw(canvas); - } else { + if(mGifMovie != null) { long nowTick = android.os.SystemClock.uptimeMillis(); if (mLastTick == 0) { mMovieRunDuration = 0; From d00cf73feee805f7ebc2c316a3490a9e4e7e14d3 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 13 Jun 2016 22:25:04 +0200 Subject: [PATCH 08/10] renamed method, changed input parameter + javaDoc --- .../android/ui/preview/ImageViewCustom.java | 27 +++++++++++-------- .../ui/preview/PreviewImageFragment.java | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/com/owncloud/android/ui/preview/ImageViewCustom.java b/src/com/owncloud/android/ui/preview/ImageViewCustom.java index 93fe9b0ffb..2c9afa97d1 100644 --- a/src/com/owncloud/android/ui/preview/ImageViewCustom.java +++ b/src/com/owncloud/android/ui/preview/ImageViewCustom.java @@ -118,7 +118,7 @@ public class ImageViewCustom extends ImageView { @Override /** - * Keeps the size of the bitmap cached in member variables for faster access in {@link #onDraw(Canvas)} , + * Keeps the size of the bitmap cached in member variables for faster access in {@link #onDraw(Canvas)}, * but without keeping another reference to the {@link Bitmap} */ public void setImageBitmap(Bitmap bm) { @@ -127,18 +127,23 @@ public class ImageViewCustom extends ImageView { super.setImageBitmap(bm); } - public void setGIFImage(OCFile file) { - try { - InputStream gifInputStream = new FileInputStream(file.getStoragePath()); - setLayerType(View.LAYER_TYPE_SOFTWARE, null); - setFocusable(true); + /** + * sets the GIF image of the given storage path. + * + * @param storagePath the storage path of the GIF image + */ + public void setGIFImageFromStoragePath(String storagePath) { + try { + InputStream gifInputStream = new FileInputStream(storagePath); + setLayerType(View.LAYER_TYPE_SOFTWARE, null); + setFocusable(true); - mGifMovie = Movie.decodeStream(gifInputStream); - mMovieWidth = mGifMovie.width(); - mMovieHeight = mGifMovie.height(); - mMovieDuration = mGifMovie.duration(); + mGifMovie = Movie.decodeStream(gifInputStream); + mMovieWidth = mGifMovie.width(); + mMovieHeight = mGifMovie.height(); + mMovieDuration = mGifMovie.duration(); } catch (Exception e) { - Log_OC.e(TAG, "Failed to set GIF image"); + Log_OC.e(TAG, "Failed to set GIF image"); } } diff --git a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java index 5e81e2ef9c..9bfcc91804 100644 --- a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java @@ -505,7 +505,7 @@ public class PreviewImageFragment extends FileFragment { } if (result.ocFile.getMimetype().equalsIgnoreCase("image/gif")) { - imageView.setGIFImage(result.ocFile); + imageView.setGIFImageFromStoragePath(result.ocFile.getStoragePath()); } else { imageView.setImageBitmap(bitmap); } From 9e116e6a98744a6e31ce8eb981dbe360943152ca Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Tue, 14 Jun 2016 09:47:45 +0200 Subject: [PATCH 09/10] removed ImageView onDraw super call --- src/com/owncloud/android/ui/preview/ImageViewCustom.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/com/owncloud/android/ui/preview/ImageViewCustom.java b/src/com/owncloud/android/ui/preview/ImageViewCustom.java index 2c9afa97d1..47ac7a8c79 100644 --- a/src/com/owncloud/android/ui/preview/ImageViewCustom.java +++ b/src/com/owncloud/android/ui/preview/ImageViewCustom.java @@ -58,7 +58,6 @@ public class ImageViewCustom extends ImageView { // setLayerType(View.LAYER_TYPE_SOFTWARE, null); } - super.onDraw(canvas); if(mGifMovie != null) { long nowTick = android.os.SystemClock.uptimeMillis(); From abe2b24f48cbff3389e0148daf67fd62211f414c Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Tue, 14 Jun 2016 13:29:12 +0200 Subject: [PATCH 10/10] bugfix for image rendering --- src/com/owncloud/android/ui/preview/ImageViewCustom.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/owncloud/android/ui/preview/ImageViewCustom.java b/src/com/owncloud/android/ui/preview/ImageViewCustom.java index 47ac7a8c79..f4e808bf6d 100644 --- a/src/com/owncloud/android/ui/preview/ImageViewCustom.java +++ b/src/com/owncloud/android/ui/preview/ImageViewCustom.java @@ -82,6 +82,8 @@ public class ImageViewCustom extends ImageView { mLastTick = nowTick; invalidate(); + } else { + super.onDraw(canvas); } }