Skip to content

Commit 294b9cf

Browse files
Rm unused declaration
1 parent e082bca commit 294b9cf

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

  • app/src/main/java/org/schabi/newpipe/ktx
Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
11
package org.schabi.newpipe.ktx
22

3-
import android.os.Build
43
import android.os.Bundle
54
import android.os.Parcelable
65
import androidx.core.os.BundleCompat
7-
import java.io.Serializable
8-
import kotlin.reflect.safeCast
96

107
inline fun <reified T : Parcelable> Bundle.parcelableArrayList(key: String?): ArrayList<T>? {
118
return BundleCompat.getParcelableArrayList(this, key, T::class.java)
129
}
13-
14-
inline fun <reified T : Serializable> Bundle.serializable(key: String?): T? {
15-
return getSerializable(this, key, T::class.java)
16-
}
17-
18-
fun <T : Serializable> getSerializable(bundle: Bundle, key: String?, clazz: Class<T>): T? {
19-
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
20-
bundle.getSerializable(key, clazz)
21-
} else {
22-
@Suppress("DEPRECATION")
23-
clazz.kotlin.safeCast(bundle.getSerializable(key))
24-
}
25-
}

0 commit comments

Comments
 (0)