Mahir Chowdhury
09/01/2021, 9:06 PMLazyRow(
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)
)
Here's how I did it