mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +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 {
|
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||||
val dialog = super.onCreateDialog(savedInstanceState)
|
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 {
|
dialog.apply {
|
||||||
setOnKeyListener { _, keyCode, _ ->
|
setOnKeyListener { _, keyCode, _ ->
|
||||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||||
|
@ -29,10 +29,7 @@ open class ExpandedBottomSheet : BottomSheetDialogFragment() {
|
|||||||
return dialog
|
return dialog
|
||||||
}
|
}
|
||||||
|
|
||||||
fun show(fragmentManager: FragmentManager) = show(
|
fun show(fragmentManager: FragmentManager) = show(fragmentManager, null)
|
||||||
fragmentManager,
|
|
||||||
null
|
|
||||||
)
|
|
||||||
|
|
||||||
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
|
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
|
||||||
super.onPictureInPictureModeChanged(isInPictureInPictureMode)
|
super.onPictureInPictureModeChanged(isInPictureInPictureMode)
|
||||||
|
Loading…
Reference in New Issue
Block a user