refactor(bump): update glide module and fix regressions (#789)

* upgrade glide module and glide ksp

* fix glide breaking changes and regressions
This commit is contained in:
IndusAryan 2023-12-08 02:21:42 +05:30 committed by GitHub
parent f7bc83024a
commit 25b042fb83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 11 deletions

View File

@ -172,9 +172,9 @@ dependencies {
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
// Glide Module // Glide Module
ksp("com.github.bumptech.glide:ksp:4.15.1") ksp("com.github.bumptech.glide:ksp:4.16.0")
implementation("com.github.bumptech.glide:glide:4.15.1") implementation("com.github.bumptech.glide:glide:4.16.0")
implementation("com.github.bumptech.glide:okhttp3-integration:4.15.1") implementation("com.github.bumptech.glide:okhttp3-integration:4.16.0")
// For KSP -> Official Annotation Processors are Not Yet Supported for KSP // For KSP -> Official Annotation Processors are Not Yet Supported for KSP
ksp("dev.zacsweers.autoservice:auto-service-ksp:1.1.0") ksp("dev.zacsweers.autoservice:auto-service-ksp:1.1.0")

View File

@ -30,7 +30,7 @@ class GlideModule : AppGlideModule() {
.signature(ObjectKey(System.currentTimeMillis().toShort())) .signature(ObjectKey(System.currentTimeMillis().toShort()))
}.setDiskCache { }.setDiskCache {
// Possible to make this a setting in the future. // Possible to make this a setting in the future.
val memoryCacheSizeBytes: Long = 1024 * 1024 * 100; // 100mb val memoryCacheSizeBytes: Long = 1024 * 1024 * 100 // 100mb
InternalCacheDiskCacheFactory(context, memoryCacheSizeBytes).build() InternalCacheDiskCacheFactory(context, memoryCacheSizeBytes).build()
} }
} }

View File

@ -316,15 +316,15 @@ object UIHelper {
if (colorCallback != null) { if (colorCallback != null) {
builder = builder.listener(object : RequestListener<Drawable> { builder = builder.listener(object : RequestListener<Drawable> {
@SuppressLint("CheckResult")
override fun onResourceReady( override fun onResourceReady(
resource: Drawable?, resource: Drawable,
model: Any?, model: Any,
target: Target<Drawable>?, target: Target<Drawable>?,
dataSource: DataSource?, dataSource: DataSource,
isFirstResource: Boolean isFirstResource: Boolean
): Boolean { ): Boolean {
resource?.toBitmapOrNull() resource.toBitmapOrNull()
?.let { bitmap -> ?.let { bitmap ->
createPaletteAsync( createPaletteAsync(
identifier, identifier,
@ -335,11 +335,10 @@ object UIHelper {
return false return false
} }
@SuppressLint("CheckResult")
override fun onLoadFailed( override fun onLoadFailed(
e: GlideException?, e: GlideException?,
model: Any?, model: Any?,
target: Target<Drawable>?, target: Target<Drawable>,
isFirstResource: Boolean isFirstResource: Boolean
): Boolean { ): Boolean {
return false return false