Skip to content

Commit

Permalink
Update to compile SDK 34. (#1830)
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrtwhite authored Jul 26, 2023
1 parent e133f32 commit 043964a
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 4 deletions.
7 changes: 6 additions & 1 deletion coil-base/src/main/java/coil/util/Bitmaps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ internal val Bitmap.allocationByteCountCompat: Int
internal val Bitmap.Config.isHardware: Boolean
get() = SDK_INT >= 26 && this == Bitmap.Config.HARDWARE

/** Guard against null bitmap configs. */
/**
* Guard against null bitmap configs.
*
* Don't believe the nullability annotation: [Bitmap.getConfig] is null for static GIF images.
*/
@Suppress("USELESS_ELVIS")
internal val Bitmap.safeConfig: Bitmap.Config
get() = config ?: Bitmap.Config.ARGB_8888

Expand Down
3 changes: 3 additions & 0 deletions coil-base/src/test/java/coil/disk/DiskLruCacheTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ import okio.fakefilesystem.FakeFileSystem
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner

/**
* Derived from OkHttp's DiskLruCache tests:
* https://github.com/square/okhttp/blob/master/okhttp/src/jvmTest/java/okhttp3/internal/cache/DiskLruCacheTest.kt
*/
@RunWith(RobolectricTestRunner::class)
class DiskLruCacheTest {

private lateinit var fileSystem: FaultyFileSystem
Expand Down
1 change: 1 addition & 0 deletions coil-base/src/test/resources/robolectric.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk=33
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class BaselineProfileGenerator {
val baselineProfileRule = BaselineProfileRule()

@Test
fun generate() = baselineProfileRule.collectBaselineProfile(
fun generate() = baselineProfileRule.collect(
packageName = "sample.$PROJECT",
filterPredicate = newFilterPredicate(),
) {
Expand Down
1 change: 1 addition & 0 deletions coil-gif/src/test/resources/robolectric.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk=33
1 change: 1 addition & 0 deletions coil-singleton/src/test/resources/robolectric.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk=33
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk=33
1 change: 1 addition & 0 deletions coil-test/src/test/resources/robolectric.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk=33
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
org.gradle.jvmargs=-Xmx6g -Dfile.encoding=UTF-8

# AndroidX
# Android
android.suppressUnsupportedCompileSdk=34
android.useAndroidX=true

# https://kotlinlang.org/docs/code-style-migration-guide.html#in-gradle
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ androidx-activity = { module = "androidx.activity:activity-ktx", version.ref = "
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
androidx-appcompat-resources = "androidx.appcompat:appcompat-resources:1.6.1"
androidx-annotation = "androidx.annotation:annotation:1.6.0"
androidx-benchmark-macro = "androidx.benchmark:benchmark-macro-junit4:1.2.0-alpha15"
androidx-benchmark-macro = "androidx.benchmark:benchmark-macro-junit4:1.2.0-beta01"
androidx-collection = "androidx.collection:collection:1.2.0"
androidx-constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4"
androidx-core = "androidx.core:core-ktx:1.10.1"
Expand Down

0 comments on commit 043964a

Please sign in to comment.