Collapse the Listen player when the article is scrolled
Categories
(Firefox for Android :: Contextual AI, task, P2)
Tracking
()
People
(Reporter: bclark, Unassigned)
References
(Depends on 1 open bug, Blocks 3 open bugs)
Details
(Whiteboard: [fxdroid][android-core])
When the user scrolls the article down, the player shrinks to the compact row. Scrolling up expands
it again.
EngineView exposes verticalScrollDelta, the same signal the toolbar's own scrolling behaviour uses.
Collect it in the integration, turn it into a boolean, and pass it to the card.
The same flow drives both directions, so the compact row needs no tap target of its own: its only
touchable things stay close, skip back, and play or pause. The player starts expanded and only
collapses after a downward scroll.
THIS STAYS LOCAL UI STATE AND NEVER ENTERS THE STORE
It is a settled decision, recorded in bug 2064817: no size or expansion state in the state model.
THE REAL WORK HERE IS NOT THE FLOW, IT IS THE THRASHING
Mapping every delta straight to a boolean makes the player flip size during a slow scroll and while a
fling settles. distinctUntilChanged() stops repeat emissions but not oscillation when deltas alternate
sign, so this needs an accumulated threshold or a debounce. Getting that wrong is the thing that will
look broken in a demo.
TECHNICAL NOTES
- Update: ListenSheetIntegration.kt for the scroll signal
- Update: ui/ListenPlayer.kt for the size parameter
- No store changes. The size is local UI state.
ACCEPTANCE CRITERIA
- [ ] Scrolling the article down collapses the player to the compact row.
- [ ] Scrolling up expands it again.
- [ ] The player starts expanded.
- [ ] A slow scroll does not make it flip size, and it does not oscillate while a fling settles.
- [ ] The size change is instant when the system has animations turned off.
- [ ] No size or expansion state is added to ListenState.
Updated•15 days ago
|
Description
•