mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
Passthrough comments sheet outside event
This commit is contained in:
parent
22d10ac6b0
commit
3d2dafa555
@ -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…
x
Reference in New Issue
Block a user