Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SVG support #345

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ if (project.hasProperty('sign')) {
}

dependencies {
def coil_version = "2.6.0"
def markwon_version = "4.6.2"
implementation project(':client')
implementation 'androidx.appcompat:appcompat:1.6.1'
Expand All @@ -77,7 +78,8 @@ dependencies {
implementation 'androidx.preference:preference-ktx:1.2.1'

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:image-coil:$markwon_version"
implementation "io.noties.markwon:image:$markwon_version"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/kotlin/com/github/gotify/CoilHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.graphics.BitmapFactory
import android.graphics.drawable.BitmapDrawable
import coil.ImageLoader
import coil.annotation.ExperimentalCoilApi
import coil.decode.SvgDecoder
import coil.disk.DiskCache
import coil.executeBlocking
import coil.request.ImageRequest
Expand All @@ -28,6 +29,9 @@ internal class CoilHandler(private val context: Context, private val settings: S
.directory(context.cacheDir.resolve("coil-cache"))
.build()
}
.components {
add(SvgDecoder.Factory())
}
.build()
}

Expand Down
Loading