mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-25 22:55:59 +03:00
Bump core-ktx dependency
This commit is contained in:
parent
157438e0c1
commit
f04cf72c0c
2 changed files with 3 additions and 26 deletions
|
@ -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 <reified T> 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 <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
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue