Fix deprecated funcs
Only fix kotlin code, because JAVA SUCKS
This commit is contained in:
1 parent
fafe25fee4
commit
0895af0ecc
5 files changed
+24
-14
No files matched your search
@@ -1,8 +0,0 @@
|
||||
package com.hippo.util
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.core.os.BundleCompat
|
||||
|
||||
inline fun <reified T> Bundle.getParcelableCompat(key: String?): T? {
|
||||
return BundleCompat.getParcelable(this, key, T::class.java)
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.hippo.util
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import androidx.core.content.IntentCompat
|
||||
import androidx.core.os.BundleCompat
|
||||
|
||||
inline fun <reified T : Parcelable> Bundle.getParcelableCompat(key: String?): T? {
|
||||
return BundleCompat.getParcelable(this, key, T::class.java)
|
||||
}
|
||||
|
||||
inline fun <reified T : Parcelable> Intent.getParcelableExtraCompat(key: String?): T? {
|
||||
return IntentCompat.getParcelableExtra(this, key, T::class.java)
|
||||
}
|
||||
Reference in new issue
Block a user