Fix pasting soft ap configuration

This commit is contained in:
Mygod
2020-06-13 01:29:11 +08:00
parent b82f7b125b
commit 355d9d7e57

View File

@@ -61,10 +61,10 @@ fun Parcelable.toByteArray(parcelableFlags: Int = 0) = useParcel { p ->
p.writeParcelable(this, parcelableFlags) p.writeParcelable(this, parcelableFlags)
p.marshall() p.marshall()
} }
fun <T : Parcelable> ByteArray.toParcelable() = useParcel { p -> inline fun <reified T : Parcelable> ByteArray.toParcelable() = useParcel { p ->
p.unmarshall(this, 0, size) p.unmarshall(this, 0, size)
p.setDataPosition(0) p.setDataPosition(0)
p.readParcelable<T>(javaClass.classLoader) p.readParcelable<T>(T::class.java.classLoader)
} }
fun DialogFragment.showAllowingStateLoss(manager: FragmentManager, tag: String? = null) { fun DialogFragment.showAllowingStateLoss(manager: FragmentManager, tag: String? = null) {