Allow clients to offer the same UX in regards to the dynamic toolbar feature
offered by our `BrowserToolbar` and `EngineView` when used together.
Going further this will ease development and ensure the best UX for users.
In some scenarios BrowserToolbarBottomBehavior could be set for a layout which
doesn't contain a BrowserToolbar or where such a view has Visibility.GONE
(like in the case of PWAs).
Protect against the behavior still trying to animate the toolbar which at that
time might be be null.
Last ditch effort to prevent against crashes caused by ACTION_DOWN event being
null in GestureDetector.SimpleOnGestureListener#onScroll.
We can use the fact that the parameters are platform types and so can consider
the first parameter (that should be the ACTION_DOWN MotionEvent) being null so
that we won't automatically crash in such situations.
This will result in the toolbar not being animated as a result of a scroll
gesture by the user.
More investigations about why the ACTION_DOWN event is null are to be done in
android-components/issues/8552.
8357: For https://github.com/mozilla-mobile/android-components/issues/8356 - Speculative fix for BrowserGestureDetector IAE r=pocmo a=Mugurell
Try to resolve a situation in which system's GestureDetector calls us as a
callback with null parameters, so triggering an IllegalArgumentException.
A possible explanation could be that not all MotionEvents are passed to the
GestureDetector, situation which this patch tries to fix.
Co-authored-by: Mugurell <Mugurell@users.noreply.github.com>
Try to resolve a situation in which system's GestureDetector calls us as a
callback with null parameters, so triggering an IllegalArgumentException.
A possible explanation could be that not all MotionEvents are passed to the
GestureDetector, situation which this patch tries to fix.
browser-menu v2: A new browser menu designed to work with lib-state.
This introduces a new API using immutable data classes to represent
options. Stateful functionality like the two-state button is replaced
with swapping out data classes and submitting a new list of options.
Internally this uses a recycler view and the view holders intentionally
do not map 1:1 to data classes. This way we can use different views
based on properties instead of introducing all new classes for every
combination of properties.
7610: Format mozac_browser_toolbar_displaytoolbar.xml r=pocmo a=gabrielluong
This fixes an unneeded indentation in `mozac_browser_toolbar_displaytoolbar.xml`
Co-authored-by: Gabriel Luong <gabriel.luong@gmail.com>