Add SVG support

This commit is contained in:
Niko Diamadis
2024-04-22 20:33:04 +02:00
parent d5903b2531
commit 4cc82267f8
2 changed files with 7 additions and 1 deletions

View File

@@ -66,6 +66,7 @@ if (project.hasProperty('sign')) {
} }
dependencies { dependencies {
def coil_version = "2.6.0"
def markwon_version = "4.6.2" def markwon_version = "4.6.2"
implementation project(':client') implementation project(':client')
implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.appcompat:appcompat:1.6.1'
@@ -77,7 +78,8 @@ dependencies {
implementation 'androidx.preference:preference-ktx:1.2.1' implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'com.github.cyb3rko:QuickPermissions-Kotlin:1.1.3' implementation 'com.github.cyb3rko:QuickPermissions-Kotlin:1.1.3'
implementation 'io.coil-kt:coil:2.6.0' implementation "io.coil-kt:coil:$coil_version"
implementation "io.coil-kt:coil-svg:$coil_version"
implementation "io.noties.markwon:core:$markwon_version" implementation "io.noties.markwon:core:$markwon_version"
implementation "io.noties.markwon:image-coil:$markwon_version" implementation "io.noties.markwon:image-coil:$markwon_version"
implementation "io.noties.markwon:image:$markwon_version" implementation "io.noties.markwon:image:$markwon_version"

View File

@@ -6,6 +6,7 @@ import android.graphics.BitmapFactory
import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.BitmapDrawable
import coil.ImageLoader import coil.ImageLoader
import coil.annotation.ExperimentalCoilApi import coil.annotation.ExperimentalCoilApi
import coil.decode.SvgDecoder
import coil.disk.DiskCache import coil.disk.DiskCache
import coil.executeBlocking import coil.executeBlocking
import coil.request.ImageRequest import coil.request.ImageRequest
@@ -28,6 +29,9 @@ internal class CoilHandler(private val context: Context, private val settings: S
.directory(context.cacheDir.resolve("coil-cache")) .directory(context.cacheDir.resolve("coil-cache"))
.build() .build()
} }
.components {
add(SvgDecoder.Factory())
}
.build() .build()
} }