mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 17:35:54 +03:00
Avoid UNCHECKED_CAST.
This commit is contained in:
parent
5cb47dae35
commit
3c1e1090e7
2 changed files with 5 additions and 5 deletions
|
@ -20,7 +20,6 @@ apply plugin: 'kotlin-android-extensions'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion "29.0.3"
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 19
|
minSdkVersion 19
|
||||||
|
|
|
@ -103,10 +103,11 @@ abstract class Picker<T>(open val requestCode: Int) {
|
||||||
selectedUriList.add(dataUri)
|
selectedUriList.add(dataUri)
|
||||||
} else {
|
} else {
|
||||||
data?.extras?.get(Intent.EXTRA_STREAM)?.let {
|
data?.extras?.get(Intent.EXTRA_STREAM)?.let {
|
||||||
@Suppress("UNCHECKED_CAST")
|
(it as? List<*>)?.filterIsInstance<Uri>()?.let { uriList ->
|
||||||
when (it) {
|
selectedUriList.addAll(uriList)
|
||||||
is List<*> -> selectedUriList.addAll(it as List<Uri>)
|
}
|
||||||
else -> selectedUriList.add(it as Uri)
|
if (it is Uri) {
|
||||||
|
selectedUriList.add(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue