Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to play animated GIF in TextView?

I'm using TextView for displayng text with GIF images:

Html.ImageGetter imageGetter=new Html.ImageGetter imageGetter() {
    public Drawable getDrawable(String source) {
        return getDrawableFromSd(String source);
    }
}
mtTextView.setText(Html.fromHtml(text,imageGetter,null));

Some files are animated, but it doesn't animate when displaying in TextView. How to display it with animation?

like image 850
BArtWell Avatar asked Apr 27 '13 16:04

BArtWell


1 Answers

You can use Glide to display gif rather than using WebView. its as simple as

Glide.with(context)
    .load(gifImageUrl)
    .asGif()
    .placeholder(R.drawable.loading)
    .crossFade()
    .into(imageView);

gif support glise

You may also like to read this post :- http://inthecheesefactory.com/blog/get-to-know-glide-recommended-by-google/en

like image 190
Hitesh Sahu Avatar answered Oct 07 '22 05:10

Hitesh Sahu