Skip to content

Glide Integration Library for Playing .svga Animation Files

Notifications You must be signed in to change notification settings

YvesCheung/SVGAGlidePlugin

Repository files navigation

SVGAGlidePlugin

Glide Integration Library for Playing .svga Animation Files


SVGA

you can know more at svga.io .

Feature

  • Thread pool management.
  • Resource cache management(Memory & Disk).
  • Users only need to care about loading and displaying a resource from Url, no matter what format it is, JPG, GIF or SVGA.
  • Support RePlugin even with this ISSUE.

Usage

fun loadSVGAFromNetwork(v: View) {
    Glide.with(this)
        .load("https://github.com/yyued/SVGA-Samples/blob/master/kingset.svga?raw=true")
        .into(iv_img)
}

fun loadSVGAFromAssets(v: View) {
    Glide.with(this)
        .load("file:///android_asset/angel.svga")
        .into(iv_img)
}

fun loadSVGAFromRes(v: View) {
    Glide.with(this)
        .load(R.raw.angel)
        .into(iv_img)
}

fun loadSVGAFromNetworkAndAddText(v: View) {
    GlideApp.with(this)
        .asSVGA()
        .load("https://github.com/yyued/SVGA-Samples/blob/master/kingset.svga?raw=true")
        .into(SVGATarget(iv_img, requestDynamicItemWithSpannableText()))
}

Install

dependencies {
    // SVGAPlayer
    implementation 'com.github.yyued:SVGAPlayer-Android:2.6.1'
    
    // Glide 
    implementation "com.github.bumptech.glide:glide:4.13.2"
    kapt "com.github.bumptech.glide:compiler:4.13.2"
    
    // integration for them
    implementation 'com.github.YvesCheung:SVGAGlidePlugin:x.y.z'
}

x.y.z is

About

Glide Integration Library for Playing .svga Animation Files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages