[Android] Fix TypecastException

Nicolas Pomepuy git at videolan.org
Tue Dec 10 11:55:25 CET 2019


vlc-android | branch: 3.2.x | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Tue Dec 10 10:45:54 2019 +0000| [a988f61f49f596076d11cbfd5b91fa89b53c2bd7] | committer: Geoffrey Métais

Fix TypecastException


(cherry picked from commit 0376ea691229a259ff7793d18787dcdd8d0d9446)

> https://code.videolan.org/videolan/vlc-android/commit/a988f61f49f596076d11cbfd5b91fa89b53c2bd7
---

 .../src/org/videolan/vlc/gui/dialogs/VLCBottomSheetDialogFragment.kt   | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/VLCBottomSheetDialogFragment.kt b/vlc-android/src/org/videolan/vlc/gui/dialogs/VLCBottomSheetDialogFragment.kt
index e72164f80..fcc11d3f3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/VLCBottomSheetDialogFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/VLCBottomSheetDialogFragment.kt
@@ -9,7 +9,6 @@ import android.view.ViewGroup
 import android.widget.FrameLayout
 import androidx.annotation.LayoutRes
 import com.google.android.material.bottomsheet.BottomSheetBehavior
-import com.google.android.material.bottomsheet.BottomSheetDialog
 import com.google.android.material.bottomsheet.BottomSheetDialogFragment
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
@@ -43,7 +42,7 @@ abstract class VLCBottomSheetDialogFragment : BottomSheetDialogFragment() {
 
         AppScope.launch(Dispatchers.Main) {
             dialog?.window?.setLayout(resources.getDimensionPixelSize(R.dimen.default_context_width), ViewGroup.LayoutParams.MATCH_PARENT)
-            (dialog as BottomSheetDialog).findViewById<FrameLayout>(com.google.android.material.R.id.design_bottom_sheet)?.let {
+            dialog?.findViewById<FrameLayout>(com.google.android.material.R.id.design_bottom_sheet)?.let {
                 val bsb = BottomSheetBehavior.from(it)
                 if (bsb.state == BottomSheetBehavior.STATE_COLLAPSED) bsb.state = getDefaultState()
             }



More information about the Android mailing list