mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 22:00:30 +05:30
expand bottom sheet by default
This commit is contained in:
parent
308060cea6
commit
c555c4b2d5
@ -87,6 +87,7 @@ import com.google.android.exoplayer2.upstream.DefaultDataSource
|
||||
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource
|
||||
import com.google.android.exoplayer2.util.RepeatModeUtil
|
||||
import com.google.android.exoplayer2.video.VideoSize
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
@ -6,10 +6,12 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.github.libretube.databinding.BottomSheetBinding
|
||||
import com.github.libretube.interfaces.PlayerOptionsInterface
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
|
||||
class BottomSheetFragment : BottomSheetDialogFragment() {
|
||||
private lateinit var binding: BottomSheetBinding
|
||||
lateinit var binding: BottomSheetBinding
|
||||
private lateinit var playerOptionsInterface: PlayerOptionsInterface
|
||||
|
||||
override fun onCreateView(
|
||||
@ -17,6 +19,15 @@ class BottomSheetFragment : BottomSheetDialogFragment() {
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
// expand the bottom sheet on creation
|
||||
dialog!!.setOnShowListener { dialog ->
|
||||
val d = dialog as BottomSheetDialog
|
||||
val bottomSheetInternal =
|
||||
d.findViewById<View>(com.google.android.material.R.id.design_bottom_sheet)!!
|
||||
BottomSheetBehavior.from(bottomSheetInternal).state =
|
||||
BottomSheetBehavior.STATE_EXPANDED
|
||||
}
|
||||
|
||||
binding = BottomSheetBinding.inflate(layoutInflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user