Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ internal class DialogSession(
val was = field
field = value
holder.dialog.window?.takeIf { value != was }?.let { window ->
// https://stackoverflow.com/questions/2886407/dealing-with-rapid-tapping-on-buttons
// If any motion events were enqueued on the main thread, cancel them.
dispatchCancelEvent { window.superDispatchTouchEvent(it) }
// When we cancel, have to warn things like RecyclerView that handle streams
// of motion events and eventually dispatch input events (click, key pressed, etc.)
// based on them.
window.peekDecorView()?.cancelPendingInputEvents()
window.peekDecorView()?.let { decorView ->
// https://stackoverflow.com/questions/2886407/dealing-with-rapid-tapping-on-buttons
// If any motion events were enqueued on the main thread, cancel them.
dispatchCancelEvent { window.superDispatchTouchEvent(it) }
// When we cancel, have to warn things like RecyclerView that handle streams
// of motion events and eventually dispatch input events (click, key pressed, etc.)
// based on them.
decorView.cancelPendingInputEvents()
}
}
}

Expand Down
Loading