This was an early attempt to get SVG to load with Glide, while it does work it does not support image tinting and probably some other things that I have not noticed yet.
I have since found a better library that does support tinting etc: Glide SVG. ()
Android Library for adding a Glide SVG module to your Android project
https://jitpack.io/#projectdelta6/GlideForSVG
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
and:
dependencies {
// add Glide to your project
implementation ("com.github.bumptech.glide:glide:4.11.0")
kapt 'com.github.bumptech.glide:compiler:4.11.0'
//GlideForSVG
compile 'com.github.projectdelta6:GlideForSVG:{latest version}'
}
//apply kotlin annotation processor for kotlin
apply plugin 'kotlin-kapt'
import com.bumptech.glide.annotation.GlideModule
import com.bumptech.glide.module.AppGlideModule
@GlideModule
class YourGlideModuleNameHere: AppGlideModule() {
// add your Glide customisation here...
}
lateinit var glideRqBuilder: GlideRequests
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//...
// init your GlideRequests object
glideRqBuilder = GlideApp.with(this)
//...
// Load an image into an ImageView(standard Glide process):
glideHelper
.load(yourImageUri)
.into(yourImageView)
}