Closed ichenhe closed 5 months ago
Cc @Kpeved in case you have thoughts
@Kpeved Here's my basic idea:
To support nested scrolling, we must implement the following:
ScrollableState
.NestedScrollDispatcher
to dispatch the event.Parameter
A parameter can be introduced to allow developer to specify the scroll axis and to provide their own NestedScrollDispatcher
if needed.
Dispatch
Make RotaryInputNode
extend DelegatingNode
and register a delegate node: nestedScrollModifierNode()
. The NestedScrollConnection
here is meaningless so an empty implementation can be used.
Modify the RotaryScrollBehavior
to dispatch nested scroll event.
@ichenhe thanks for your feedback and proposal. That request makes total sense. We're working on bringing rotary support by default to Compose for WearOS in AndroidX, so this will be very useful. What we have to do is to align this api with similar apis regarding nested scroll support.
This is no longer relevant for the deprecated methods in horologist.
Horologist Version: 0.4.17
Currently
Modifier.rotaryWithScroll()
takes and manipulatesScrollableState
directly, which may bypass the nested scroll mechanism.Maybe this modifier factory function can take
NestedScrollDispatcher
as another parameter so that it can incorporate nested scrolling. Alternatively, it would be great to have another, more concise API design.