Add GV API for D-pad scrolling and navigation

RESOLVED FIXED in Firefox 67

Status

enhancement
P1
normal
RESOLVED FIXED
8 months ago
5 months ago

People

(Reporter: cpeterson, Assigned: rbarker)

Tracking

unspecified
mozilla67
ARM
Android

Firefox Tracking Flags

(firefox64 wontfix, firefox65 wontfix, firefox66 wontfix, firefox67 fixed)

Details

(Whiteboard: [gvtv], )

Attachments

(1 attachment)

A dispatchTouchEvent() API is need to implement scrolling and selection using Fire TV's DPAD (via touch event simulation). Without this, any site that uses a cursor cannot be interacted with.

TBD: Is dispatchTouchEvent() the right API? Should DPAD support be implemented in A-C or inside GV itself instead of the FFTV app?
You can simulate touch events (and therefore scrolling) by calling GeckoSession.getPanZoomController().onTouchEvent()[0]. Is this sufficient, or do we need something else? Do we really just want caret browsing for this type of thing?

[0] https://mozilla.github.io/geckoview/javadoc/mozilla-central/org/mozilla/geckoview/PanZoomController.html#onTouchEvent-android.view.MotionEvent-
Flags: needinfo?(michael.l.comella)
Currently, WebView handles web page dpad interactions (e.g. YouTube TV navigation, VoiceView accessibility). On top of that, we manually call `Activity.dispatchTouchEvent` (which afaik should use the same code path as someone touching the screen) to trigger a touch event (e.g. to click links using the cursor).

I would expect GeckoView to work the same way and that it would be working correctly already (i.e. GeckoView handles dpad events when focused and touch events work without special casing in GeckoView).

Perhaps we can check with Simon (would NI but no BZ yet?), who did the GeckoView implementation on Fire TV or pull down his WIP PR.
Flags: needinfo?(michael.l.comella)
> A dispatchTouchEvent() API is need to implement scrolling

This is actually using `WebView.scrollBy` [1]. The original implementation may have simulated touch events but it was janky and inaccurate.

[1]: https://github.com/mozilla-mobile/firefox-tv/blob/00b61b4f5344eb878b0efa4cafb61d535f1b9bc3/app/src/main/java/org/mozilla/tv/firefox/ext/EngineView.kt#L90
Product: Firefox for Android → GeckoView
Points: --- → 3

Randall is going to look into D-pad support.

TBD: Will FFTV want flings or absolute scrollTo?

Assignee: nobody → rbarker
Priority: P2 → P1
Summary: Add GV API for DPAD scrolling and navigation (via dispatchTouchEvent API?) → Add GV API for D-pad scrolling and navigation (via dispatchTouchEvent API?)

The scrollTo() and scrollBy functions in the PanZoomController may be
used to scroll the root document in GeckoView.

Group: mozilla-employee-confidential
Hardware: Unspecified → ARM
Summary: Add GV API for D-pad scrolling and navigation (via dispatchTouchEvent API?) → Add GV API for D-pad scrolling and navigation

Randall says he will land the new API soon. FFTV will need to use this new GV API. That FFTV work is https://github.com/mozilla-mobile/firefox-tv/issues/1819.

Pushed by rbarker@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8066fe9c81ee
Add scrollTo and scrollBy to PanZoomController r=geckoview-reviewers,snorp,esawin
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.