Skip to content

Commit

Permalink
renamed method, changed input parameter + javaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyScherzinger committed Jun 13, 2016
1 parent 9eb6dc1 commit d00cf73
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
27 changes: 16 additions & 11 deletions src/com/owncloud/android/ui/preview/ImageViewCustom.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private boolean checkIfMaximumBitmapExceed(Canvas canvas) {

@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) {
Expand All @@ -127,18 +127,23 @@ public void setImageBitmap(Bitmap bm) {
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");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ private void showLoadedImage(LoadImage result) {
}

if (result.ocFile.getMimetype().equalsIgnoreCase("image/gif")) {
imageView.setGIFImage(result.ocFile);
imageView.setGIFImageFromStoragePath(result.ocFile.getStoragePath());
} else {
imageView.setImageBitmap(bitmap);
}
Expand Down

0 comments on commit d00cf73

Please sign in to comment.