ui: disable swiping on overridden overflow menus

This commit is contained in:
Martin K 2024-06-05 21:34:41 +03:00
parent 6b818030eb
commit 5767094519
No known key found for this signature in database

View file

@ -124,6 +124,8 @@ fun Toolbar.overrideOnOverflowMenuClick(block: (View) -> Unit) {
// The overflow menu's view implementation is package-private, so test for the // The overflow menu's view implementation is package-private, so test for the
// first child that isn't a plain action button. // first child that isn't a plain action button.
if (menuChild !is ActionMenuItemView) { if (menuChild !is ActionMenuItemView) {
// Override all listeners related to opening the overflow menu.
menuChild.setOnTouchListener(null)
menuChild.setOnClickListener(block) menuChild.setOnClickListener(block)
return return
} }