Fix TypecastException

(cherry picked from commit 0376ea6912)
This commit is contained in:
Nicolas Pomepuy
2019-12-10 10:45:54 +00:00
committed by Geoffrey Métais
parent 3af1841e3c
commit a988f61f49

View File

@@ -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()
}