Skip to content

Commit d00cf73

Browse files
renamed method, changed input parameter + javaDoc
1 parent 9eb6dc1 commit d00cf73

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

‎src/com/owncloud/android/ui/preview/ImageViewCustom.java‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private boolean checkIfMaximumBitmapExceed(Canvas canvas) {
118118

119119
@Override
120120
/**
121-
* Keeps the size of the bitmap cached in member variables for faster access in {@link #onDraw(Canvas)} ,
121+
* Keeps the size of the bitmap cached in member variables for faster access in {@link #onDraw(Canvas)},
122122
* but without keeping another reference to the {@link Bitmap}
123123
*/
124124
public void setImageBitmap(Bitmap bm) {
@@ -127,18 +127,23 @@ public void setImageBitmap(Bitmap bm) {
127127
super.setImageBitmap(bm);
128128
}
129129

130-
public void setGIFImage(OCFile file) {
131-
try {
132-
InputStream gifInputStream = new FileInputStream(file.getStoragePath());
133-
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
134-
setFocusable(true);
130+
/**
131+
* sets the GIF image of the given storage path.
132+
*
133+
* @param storagePath the storage path of the GIF image
134+
*/
135+
public void setGIFImageFromStoragePath(String storagePath) {
136+
try {
137+
InputStream gifInputStream = new FileInputStream(storagePath);
138+
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
139+
setFocusable(true);
135140

136-
mGifMovie = Movie.decodeStream(gifInputStream);
137-
mMovieWidth = mGifMovie.width();
138-
mMovieHeight = mGifMovie.height();
139-
mMovieDuration = mGifMovie.duration();
141+
mGifMovie = Movie.decodeStream(gifInputStream);
142+
mMovieWidth = mGifMovie.width();
143+
mMovieHeight = mGifMovie.height();
144+
mMovieDuration = mGifMovie.duration();
140145
} catch (Exception e) {
141-
Log_OC.e(TAG, "Failed to set GIF image");
146+
Log_OC.e(TAG, "Failed to set GIF image");
142147
}
143148
}
144149

‎src/com/owncloud/android/ui/preview/PreviewImageFragment.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ private void showLoadedImage(LoadImage result) {
505505
}
506506

507507
if (result.ocFile.getMimetype().equalsIgnoreCase("image/gif")) {
508-
imageView.setGIFImage(result.ocFile);
508+
imageView.setGIFImageFromStoragePath(result.ocFile.getStoragePath());
509509
} else {
510510
imageView.setImageBitmap(bitmap);
511511
}

0 commit comments

Comments
 (0)