Is there any reason why rotary input on the wear e...
# compose-wear
a
Is there any reason why rotary input on the wear emulator doesnt seem to scroll lists?
j
For various reasons this is still a work in progress as there is work we need to do at the Core Compose library level to fully integrate rotary into scrollables. That said we do have samples for Rotating Side Button integration in Wear Compose. Take a look at https://github.com/androidx/androidx/blob/androidx-main/wear/compose/integration-t[…]rc/main/java/androidx/wear/compose/integration/demos/DemoApp.kt for a sample rsbScroll modifier. We are looking at RotaryBezel at the moment as well, but that is not supported by this sample modifier. @Michail Kulaga FYI
y
There is a less full featured one (no fling support) that I've used in a few places.
Copy code
public fun Modifier.scrollableColumn(
    focusRequester: FocusRequester,
    scrollableState: ScrollableState
): Modifier = composed {
    val coroutineScope = rememberCoroutineScope()

    onPreRotaryScrollEvent {
        coroutineScope.launch {
            scrollableState.scrollBy(it.verticalScrollPixels)
        }
        true
    }
        .focusRequester(focusRequester)
        .focusable()
}
j
@yschimke Do you have anything for Bezel?
y
That one should work for bezel
a
Gotcha, just curious as to the reason. My project is definitely not production ready quite yet, and wear isn’t first priority either. Good to know it’s in the works!