Merge pull request #795 from Martysh12/794-fix-empty-menu

Disable swiping on overridden overflow menus
This commit is contained in:
Alexander Capehart 2024-06-08 12:13:51 -06:00 committed by GitHub
commit ad17c82909
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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
// first child that isn't a plain action button.
if (menuChild !is ActionMenuItemView) {
// Override all listeners related to opening the overflow menu.
menuChild.setOnTouchListener(null)
menuChild.setOnClickListener(block)
return
}