[components] Closes https://github.com/mozilla-mobile/android-components/issues/8209...
commit7bde74b74bff5f364abb69c9a0fb163da1dca667
authorMugurell <Mugurell@users.noreply.github.com>
Tue, 25 Aug 2020 13:59:56 +0000 (25 16:59 +0300)
committerMugurell <Mugurell@users.noreply.github.com>
Wed, 26 Aug 2020 15:39:32 +0000 (26 18:39 +0300)
tree72460d359510b327fbc030d855a60e7e683500cd
parent1ef558551fbb5cb3e59313b82546d37dc7a9bc1e
[components] Closes https://github.com/mozilla-mobile/android-components/issues/8209 - Use new onTouchEventForResult GV api

Changes:
- previously NestedGV#onTouchEvent event would call onTouchEventForResult where
we would make possible the integration of GV in CoordinatorLayout.
Since NestedGV#onTouchEvent does not anymore call onTouchEventForResult I've
moved all code in onTouchEvent and then call onTouchEventForResult only for
ACTION_DOWN events as snorp recommended.
- we now must wait for onTouchEventForResult#GeckoResult<Int> and only then
call startNestedScroll(..) since otherwise when executing that method in
BrowserToolbarBottomBehavior we would return false since the MotionEvent is
at that time unhandled.
- only dispatch startNestedScroll and dispatchNestedPreScroll if GV returned
INPUT_RESULT_HANDLED.
- Ignored "ClickableViewAccessibility" since NestedGeckoView is not intented
to be clickable, but rather the elements from the webpage displayed.

In testing I saw most of the times GeckoResult resolves in < 5ms with bigger
timeouts showing a logarithmic growth. As such I think the change should be
imperceptible to users.
mobile/android/android-components/buildSrc/src/main/java/Gecko.kt
mobile/android/android-components/components/browser/engine-gecko-nightly/src/main/java/mozilla/components/browser/engine/gecko/NestedGeckoView.kt
mobile/android/android-components/components/browser/engine-gecko-nightly/src/test/java/mozilla/components/browser/engine/gecko/NestedGeckoViewTest.kt