#gifloader
this is an simple & lightweight to load gif from internet for android.
it use memorycache defaultly, and you can use your own cache by implment GifCache
and you can also use MemoryCache,WeakMemoryCache DiskCache and DoubleCache>
MemoryCache using LruCache
WeakMemoryCache using WeakReference
DisCache using DiskLruCache
DoubleCache contans Memory & disk, and you need to new instance width assignating Memory cache
for examle:
DoubleCache = new DoubleCache(appContext,new WeakMemoryCache());
#Installation repositories { jcenter() }
dependencies {
compile'com.arvin.gifloader:library:1.0.0'
}
#Usage you can use gifview in you layou file or through constructor as an normal view <com.arvin.gifloader.widget.GifView android:id="@+id/gif" android:layout_width="match_parent" android:layout_height="match_parent" />
at first, you should init in you application
GifLoaderConfig config = new GifLoaderConfig();
config.setCache(new DoubleCache(this, new MemoryCache())).
setThreadCount(5);
GifLoader.getInstance().init(config);
and displayGif with
GifLoader.getInstance().displayGif(gifView, "your gif url");