@@ -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
0 commit comments