Merge pull request #3624 from xz-dev/master

Ability to interact with player while viewing comments
This commit is contained in:
Bnyro 2023-04-25 13:47:54 +02:00 committed by GitHub
commit 94d37c5224
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -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) {

View File

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