Skip to content

Commit 4853fbd

Browse files
committed
Upgraded to 2.0.0
1 parent 080bdc8 commit 4853fbd

File tree

6 files changed

+9
-14
lines changed

6 files changed

+9
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Just add to image loader heif decoder factory and use it as image loader in coil
1414
```kotlin
1515
val imageLoader = ImageLoader.Builder(context)
1616
.components {
17-
add(HeifDecoder.Factory(context))
17+
add(HeifDecoder.Factory())
1818
}
1919
.build()
2020
```

app/src/main/java/com/awxkee/avif/coil/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class MainActivity : AppCompatActivity() {
2222
binding.imageView.load("https://wh.aimuse.online/preset/federico-beccari.avif",
2323
imageLoader = ImageLoader.Builder(this)
2424
.components {
25-
add(HeifDecoder.Factory(this@MainActivity))
25+
add(HeifDecoder.Factory())
2626
}
27-
.bitmapConfig(Bitmap.Config.HARDWARE)
27+
.bitmapConfig(Bitmap.Config.RGBA_1010102)
2828
.build())
2929
}
3030
}

avifcoillibrary/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ dependencies {
6464
androidTestImplementation("androidx.test.ext:junit:1.1.5")
6565
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
6666
api("io.coil-kt:coil:2.6.0")
67-
api("com.github.awxkee:avif-coder:1.8.0")
67+
api("com.github.awxkee:avif-coder:2.0.0")
6868
}

avifcoillibrary/src/main/java/com/github/awxkee/avifcoil/decoder/HeifDecoder.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
package com.github.awxkee.avifcoil.decoder
3030

31-
import android.content.Context
3231
import android.graphics.Bitmap
3332
import android.graphics.drawable.BitmapDrawable
3433
import android.os.Build
@@ -46,14 +45,13 @@ import kotlinx.coroutines.runInterruptible
4645
import okio.ByteString.Companion.encodeUtf8
4746

4847
class HeifDecoder(
49-
private val context: Context?,
5048
private val source: SourceResult,
5149
private val options: Options,
5250
private val imageLoader: ImageLoader,
5351
private val exceptionLogger: ((Exception) -> Unit)? = null,
5452
) : Decoder {
5553

56-
private val coder = HeifCoder(context)
54+
private val coder = HeifCoder()
5755

5856
override suspend fun decode(): DecodeResult? = runInterruptible {
5957
try {
@@ -115,18 +113,15 @@ class HeifDecoder(
115113
}
116114
}
117115

118-
/**
119-
* @param context is preferred to be set when displaying an HDR content to apply Vulkan shaders
120-
*/
121-
class Factory(private val context: Context? = null) : Decoder.Factory {
116+
class Factory : Decoder.Factory {
122117
override fun create(
123118
result: SourceResult,
124119
options: Options,
125120
imageLoader: ImageLoader
126121
): Decoder? {
127122
return if (AVAILABLE_BRANDS.any {
128123
result.source.source().rangeEquals(4, it)
129-
}) HeifDecoder(context, result, options, imageLoader) else null
124+
}) HeifDecoder(result, options, imageLoader) else null
130125
}
131126

132127
companion object {

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id("com.android.application") version "8.2.2" apply false
3+
id("com.android.application") version "8.7.0" apply false
44
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Sun Sep 17 23:53:38 MYT 2023
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)