mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
Merge pull request #3624 from xz-dev/master
Ability to interact with player while viewing comments
This commit is contained in:
commit
94d37c5224
@ -90,6 +90,18 @@ class CommentsSheet : ExpandedBottomSheet() {
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val dialog = super.onCreateDialog(savedInstanceState)
|
||||
|
||||
// BottomSheetDialogFragment passthrough user outside touch event
|
||||
dialog.setOnShowListener {
|
||||
dialog.findViewById<View>(R.id.touch_outside)?.apply {
|
||||
setOnTouchListener { v, event ->
|
||||
event.setLocation(event.rawX - v.x, event.rawY - v.y)
|
||||
activity?.dispatchTouchEvent(event)
|
||||
v.performClick()
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dialog.apply {
|
||||
setOnKeyListener { _, keyCode, _ ->
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
|
@ -29,10 +29,7 @@ open class ExpandedBottomSheet : BottomSheetDialogFragment() {
|
||||
return dialog
|
||||
}
|
||||
|
||||
fun show(fragmentManager: FragmentManager) = show(
|
||||
fragmentManager,
|
||||
null
|
||||
)
|
||||
fun show(fragmentManager: FragmentManager) = show(fragmentManager, null)
|
||||
|
||||
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
|
||||
super.onPictureInPictureModeChanged(isInPictureInPictureMode)
|
||||
|
Loading…
Reference in New Issue
Block a user