webview - How to display an animated gif image in android with click functionality? -


is there way show animated gif image in control should display normal jpg,png formats, image source server.

i have tried webview have problem of scrolling, image should fit size of control , should accept click functionality.

my code webview:

webview class:

public class gifview extends webview { public static final string html_format = "<html><body style=\"text-align: center;  vertical-align: right;background-color: transparent;\"><img src = \"%s\" /></body></html>"; public gifview(context context, string fileurl) throws ioexception {     super(context);     final string html = string.format(html_format, fileurl);     setbackgroundcolor(color.transparent);     loaddatawithbaseurl("", html, "text/html", "utf-8", "");    } } 

myactivity:

linearlayout llprogress = (linearlayout) findviewbyid(r.id.ll_progress);     gifview gif = null;     try {         gif = new gifview(this, "file:///android_asset/giphy.gif");         llprogress.addview(gif);     } catch (ioexception e) {         // todo auto-generated catch block         e.printstacktrace();     } 

can 1 me out of issue please, in advance!

i achieved using glide library. further reference, please check on link https://github.com/bumptech/glide


Comments