[components] For https://github.com/mozilla-mobile/android-components/issues/10005...
commit2f5eb09d122b10c92176d206f29919067a2833f8
authorMugurell <Mugurell@users.noreply.github.com>
Thu, 1 Apr 2021 10:11:38 +0000 (1 13:11 +0300)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 6 Apr 2021 15:09:59 +0000 (6 15:09 +0000)
tree882b58ea3e3e55081b86576795764d2369a7e32c
parent3c723e77b463ec93aebb74e7eb995763752461eb
[components] For https://github.com/mozilla-mobile/android-components/issues/10005 - Replace layout manager to effectively change stackFromEnd

The `stackFromEnd` property is not initially set even though
`endOfMenuAlwaysVisible` might be true since when having a bottom expandable
menu, that should always be scrolled to the top.
And we know if we're in that situation only later, after menu is configured and
based on it it can be inferred if it should be collapsed or not.

Setting `stackFromEnd` only after this steps, even if the menu is not yet on
the screen seems to have no effect.

The only solution is to replace menu's layout manager with one that has this
`stackFromEnd` from the beginning.
mobile/android/android-components/components/browser/menu/src/main/java/mozilla/components/browser/menu/BrowserMenu.kt
mobile/android/android-components/components/browser/menu/src/test/java/mozilla/components/browser/menu/BrowserMenuTest.kt
mobile/android/android-components/docs/changelog.md