Bug 1854131 - Compare availableHeightToTop and availableHeightToBottom when positioni...
commit9a68c5aeca7785d24169f97b3c7cd85f82e5f1cb
authormcarare <mcarare@mozilla.com>
Wed, 20 Mar 2024 13:19:26 +0000 (20 13:19 +0000)
committermcarare <mcarare@mozilla.com>
Wed, 20 Mar 2024 13:19:26 +0000 (20 13:19 +0000)
tree1bb55e685826865895af850a7f39a0decf79f2bf
parentaf4b1f34a632388353d988b74f701f2ec3f30253
Bug 1854131 - Compare availableHeightToTop and availableHeightToBottom when positioning menu. r=android-reviewers,twhite

When the popup doesn't fit up or down, because both availableHeightToTop and availableHeightToBottom are both smaller than containerHeight choose the highest one to choose menu direction.

Differential Revision: https://phabricator.services.mozilla.com/D205207
mobile/android/android-components/components/browser/menu/src/main/java/mozilla/components/browser/menu/BrowserMenuPositioning.kt
mobile/android/android-components/components/browser/menu/src/test/java/mozilla/components/browser/menu/BrowserMenuPositioningTest.kt