From f04cf72c0cb53fdbb37daa3440482b35ea5f8591 Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 11 Jan 2023 19:01:13 -0500 Subject: [PATCH] Bump core-ktx dependency --- .../tachiyomi/util/system/IntentExtensions.kt | 27 ++----------------- gradle/androidx.versions.toml | 2 +- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/IntentExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/IntentExtensions.kt index 29dfdf601d..ac26265cd8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/IntentExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/IntentExtensions.kt @@ -5,7 +5,7 @@ import android.content.Context import android.content.Intent import android.net.Uri import android.os.Build -import android.os.Bundle +import androidx.core.content.IntentCompat import eu.kanade.tachiyomi.R import java.io.Serializable @@ -33,12 +33,7 @@ fun Uri.toShareIntent(context: Context, type: String = "image/*", message: Strin } inline fun Intent.getParcelableExtraCompat(name: String): T? { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - getParcelableExtra(name, T::class.java) - } else { - @Suppress("DEPRECATION") - getParcelableExtra(name) - } + return IntentCompat.getParcelableExtra(this, name, T::class.java) } inline fun Intent.getSerializableExtraCompat(name: String): T? { @@ -49,21 +44,3 @@ inline fun Intent.getSerializableExtraCompat(name: St getSerializableExtra(name) as? T } } - -inline fun Bundle.getSerializableCompat(name: String): T? { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - getSerializable(name, T::class.java) - } else { - @Suppress("DEPRECATION") - getSerializable(name) as? T - } -} - -inline fun Bundle.getParcelableCompat(name: String): T? { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - getParcelable(name, T::class.java) - } else { - @Suppress("DEPRECATION") - getParcelable(name) - } -} diff --git a/gradle/androidx.versions.toml b/gradle/androidx.versions.toml index 43568e7985..c24e6a3c42 100644 --- a/gradle/androidx.versions.toml +++ b/gradle/androidx.versions.toml @@ -8,7 +8,7 @@ appcompat = "androidx.appcompat:appcompat:1.6.0" biometricktx = "androidx.biometric:biometric-ktx:1.2.0-alpha05" constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4" coordinatorlayout = "androidx.coordinatorlayout:coordinatorlayout:1.2.0" -corektx = "androidx.core:core-ktx:1.9.0" +corektx = "androidx.core:core-ktx:1.10.0-alpha01" splashscreen = "androidx.core:core-splashscreen:1.0.0-alpha02" recyclerview = "androidx.recyclerview:recyclerview:1.3.0-rc01" viewpager = "androidx.viewpager:viewpager:1.1.0-alpha01"