Bump core-ktx dependency

This commit is contained in:
arkon 2023-01-11 19:01:13 -05:00
parent 157438e0c1
commit f04cf72c0c
2 changed files with 3 additions and 26 deletions

View File

@ -5,7 +5,7 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Build import android.os.Build
import android.os.Bundle import androidx.core.content.IntentCompat
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import java.io.Serializable import java.io.Serializable
@ -33,12 +33,7 @@ fun Uri.toShareIntent(context: Context, type: String = "image/*", message: Strin
} }
inline fun <reified T> Intent.getParcelableExtraCompat(name: String): T? { inline fun <reified T> Intent.getParcelableExtraCompat(name: String): T? {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { return IntentCompat.getParcelableExtra(this, name, T::class.java)
getParcelableExtra(name, T::class.java)
} else {
@Suppress("DEPRECATION")
getParcelableExtra(name)
}
} }
inline fun <reified T : Serializable> Intent.getSerializableExtraCompat(name: String): T? { inline fun <reified T : Serializable> Intent.getSerializableExtraCompat(name: String): T? {
@ -49,21 +44,3 @@ inline fun <reified T : Serializable> Intent.getSerializableExtraCompat(name: St
getSerializableExtra(name) as? T getSerializableExtra(name) as? T
} }
} }
inline fun <reified T : Serializable> 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 <reified T> 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)
}
}

View File

@ -8,7 +8,7 @@ appcompat = "androidx.appcompat:appcompat:1.6.0"
biometricktx = "androidx.biometric:biometric-ktx:1.2.0-alpha05" biometricktx = "androidx.biometric:biometric-ktx:1.2.0-alpha05"
constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4" constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4"
coordinatorlayout = "androidx.coordinatorlayout:coordinatorlayout:1.2.0" 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" splashscreen = "androidx.core:core-splashscreen:1.0.0-alpha02"
recyclerview = "androidx.recyclerview:recyclerview:1.3.0-rc01" recyclerview = "androidx.recyclerview:recyclerview:1.3.0-rc01"
viewpager = "androidx.viewpager:viewpager:1.1.0-alpha01" viewpager = "androidx.viewpager:viewpager:1.1.0-alpha01"