Closed
Bug 1371796
Opened 7 years ago
Closed 7 years ago
Add listener for content scroll events
Categories
(GeckoView :: General, enhancement)
Tracking
(firefox56 fixed)
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: esawin, Assigned: esawin)
References
Details
Attachments
(2 files, 1 obsolete file)
3.88 KB,
patch
|
Details | Diff | Splinter Review | |
7.28 KB,
patch
|
esawin
:
review+
|
Details | Diff | Splinter Review |
GeckoView should expose content scroll events.
This could be used to to implement features like pull-to-refresh.
Assignee | ||
Updated•7 years ago
|
Version: 51 Branch → Trunk
Assignee | ||
Comment 1•7 years ago
|
||
Add ScrollListener interface with the onScrollChanged callback.
We might want to override getScroll{X,Y}, scrollTo, and scrollBy.
For this it would be better to keep scroll state directly in GeckoView.
Attachment #8876273 -
Flags: review?(snorp)
Assignee | ||
Comment 2•7 years ago
|
||
This is an example implementation based on SwipeRefreshLayout to enable pull-to-refresh in geckoview_example.
Comment on attachment 8876273 [details] [diff] [review]
0001-Bug-1371796-1.0-Add-ScrollListener-for-content-scrol.patch
Review of attachment 8876273 [details] [diff] [review]:
-----------------------------------------------------------------
I think we really might need to hook up to APZ for this. The content scroll change is delayed and is basically meaningless because of that. This might be good enough for pull-to-refresh, but likely still not great for that either.
Also, we should only hook up to the scroll event if we actually have a java listener.
Randall sorta nuked most of the stuff we could use to implement something like this against APZ. Maybe we could put some stuff back? Compositor process would make this a pain...
Attachment #8876273 -
Flags: review?(snorp) → review-
See comment #3
Flags: needinfo?(rbarker)
Assignee | ||
Comment 5•7 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #3)
> Also, we should only hook up to the scroll event if we actually have a java
> listener.
This holds for most events, I would like to solve this generally for all GeckoView listeners in a separate bug.
Comment 6•7 years ago
|
||
We currently get the overscroll distance for the root in NativePanZoomController.java. The ImmutableViewportMetrics.java contains the scroll offset but is only updated when the page is in a steady state. I'm not sure the content scroll values are *that* delayed. The only other option would be send the scroll position every time they change in APZ. One of the reasons we moved the toolbar into the compositor was so the frame metrics would not need to be sent back to the UI thread after every update (at frame rate).
Flags: needinfo?(rbarker)
Comment on attachment 8876273 [details] [diff] [review]
0001-Bug-1371796-1.0-Add-ScrollListener-for-content-scrol.patch
Review of attachment 8876273 [details] [diff] [review]:
-----------------------------------------------------------------
Talked some more about this and it seems ok. I would like the scrolling bits separated into another content script, though, so we can enable it on-demand.
Attachment #8876273 -
Flags: review- → review+
Assignee | ||
Comment 8•7 years ago
|
||
Addressed comment: added a dedicated scroll frame script.
Module registration handling will be fixed in bug 1372681.
Attachment #8876273 -
Attachment is obsolete: true
Attachment #8881854 -
Flags: review+
Pushed by esawin@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b7f85a213aac
[1.1] Add ScrollListener for content scroll events to GeckoView. r=snorp
Comment 10•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 56
Updated•6 years ago
|
Product: Firefox for Android → GeckoView
Updated•6 years ago
|
Target Milestone: Firefox 56 → mozilla56
You need to log in
before you can comment on or make changes to this bug.
Description
•