https://kotlinlang.org logo
Title
m

Mahir Chowdhury

09/01/2021, 8:19 PM
LazyRow(
    state = listState,
    modifier = Modifier.fillMaxWidth().padding(50.dp, 0.dp)
        .pointerInput(Unit) {
            detectHorizontalDragGestures { _, dragAmount ->
                coroutineScope.launch {
                    if (dragAmount < 0) {//scroll right
                        listState.animateScrollToItem( listState.firstVisibleItemIndex+2)
                    } else if (dragAmount > 0) {//scroll left
                        listState.animateScrollToItem(listState.firstVisibleItemIndex -1)
                    }
                }
            }
        },
    horizontalArrangement = Arrangement.spacedBy(10.dp)
)
This is what I have in the parameters for LazyRow
r

Ruckus

09/01/2021, 9:01 PM
#compose-desktop or #compose may be a more fitting place for such questions.
m

Mahir Chowdhury

09/01/2021, 9:04 PM
sorry I didn't see that channel on my left. I'm still new to Slack