Open jeantuffier opened 1 day ago
Ooops, sorry, that needs to be updated. Wear Compose added rotaryScrollable which should be used instead.
@Composable
fun ScrollScreenLazyColumn(scrollState: LazyListState) {
val focusRequester = rememberActiveFocusRequester()
LazyColumn(
modifier = Modifier.rotaryScrollable(
behavior = behavior(scrollableState = scrollState),
focusRequester = focusRequester,
),
state = scrollState,
) {
items(3) { i ->
val modifier = Modifier.fillParentMaxHeight(0.5f)
ExampleCard(modifier = modifier, i = i)
}
}
}
I'll update the docs before closing this.
Maybe a better sample for Column
Column(
modifier =
Modifier.verticalScroll(scrollState)
.rotaryScrollable(
RotaryScrollableDefaults.behavior(
scrollableState = scrollState,
flingBehavior = ScrollableDefaults.flingBehavior()
),
focusRequester = focusRequester
)
) {
val modifier = Modifier.height(LocalConfiguration.current.screenHeightDp.dp / 2)
repeat(10) { i -> ExampleCard(modifier, i) }
}
Hi!
I'm trying to use the example from https://google.github.io/horologist/compose-layout/ but I haven't figure out in which dependency
rotaryWithScroll
is located. I triedhorlogist.composables
,horlogist.layout
andhorlogist.materials
but it doesn't seem to be there. Could you add a section in the documentation on where to find it?Thanks