From 66ba704f978033652466261fc17e07414128d795 Mon Sep 17 00:00:00 2001 From: Colin White Date: Wed, 28 Aug 2024 14:43:29 -0700 Subject: [PATCH] Update compile sdk to 35. --- .../src/androidMain/kotlin/coil3/util/SystemCallbacks.kt | 5 ++++- gradle.properties | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/coil-core/src/androidMain/kotlin/coil3/util/SystemCallbacks.kt b/coil-core/src/androidMain/kotlin/coil3/util/SystemCallbacks.kt index 7c6bece75e..1ed499278b 100644 --- a/coil-core/src/androidMain/kotlin/coil3/util/SystemCallbacks.kt +++ b/coil-core/src/androidMain/kotlin/coil3/util/SystemCallbacks.kt @@ -21,6 +21,7 @@ internal actual fun SystemCallbacks( * it be freed automatically by the garbage collector. If the [imageLoader] is freed, it unregisters * its callbacks. */ +@Suppress("DEPRECATION", "OVERRIDE_DEPRECATION") internal class AndroidSystemCallbacks( imageLoader: RealImageLoader, ) : SystemCallbacks, ComponentCallbacks2 { @@ -55,8 +56,10 @@ internal class AndroidSystemCallbacks( "trimMemory, level=$level" } if (level >= TRIM_MEMORY_BACKGROUND) { + // The app is in the background. imageLoader.memoryCache?.clear() - } else if (level in TRIM_MEMORY_RUNNING_LOW until TRIM_MEMORY_UI_HIDDEN) { + } else if (level >= TRIM_MEMORY_RUNNING_LOW) { + // The app is in the foreground, but is running low on memory. imageLoader.memoryCache?.apply { trimToSize(size / 2) } } } diff --git a/gradle.properties b/gradle.properties index 366289b857..a3c4e13e01 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,8 +23,8 @@ org.jetbrains.compose.experimental.wasm.enabled=true # Config minSdk=21 -targetSdk=34 -compileSdk=34 +targetSdk=35 +compileSdk=35 # Maven SONATYPE_HOST=DEFAULT