Thanks for the wonderful library. Will there be any support for animated gif in the near future?
No, this won't be supported.
I found solution for the gifs.
https://gist.github.com/felipecsl/6289457
But have some issue with initial position of loaded gifs. It must be on center, but instead in in the upper right corner.
If i don`t use PhotoViewAttacher, then GIF in the center.
Here is layout code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black" >
<ru.futurobot.pikabuclient.controls.GifDecoderView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:visibility="gone"/>
<TextView
android:id="@+id/tvStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="visible"
android:textColor="@android:color/white"
android:textAppearance="@android:style/TextAppearance.Medium"
android:text="@string/loading"/>
</RelativeLayout>
The Best solution is https://github.com/koral--/android-gif-drawable
GifDrawable gif = null;
try {
gif = new GifDrawable(CurrentPath);
} catch (IOException e) {
e.printStackTrace();
}
photoView.setImageDrawable(gif);
Using Glide, you can load a gif into PhotoView: https://github.com/bumptech/glide/wiki#whats-new-in-30
Most helpful comment
The Best solution is https://github.com/koral--/android-gif-drawable
GifDrawable gif = null; try { gif = new GifDrawable(CurrentPath); } catch (IOException e) { e.printStackTrace(); } photoView.setImageDrawable(gif);