What is the best way to detect if user-initiated (...
# compose
d
What is the best way to detect if user-initiated (not programmatical!) scroll was performed on
LazyColumn
? I need only to detect this fact and not interfere with the gesture itself in any way. Should I use lower level gesture detection modifiers?
a
Copy code
val lazyListState = rememberLazyListState()
val isDragged by lazyListState.interactionSource.collectIsDraggedAsState()
LazyColumn(state = lazyListState) { ... }
d
nice, thank you!
I wonder how could I achieve the behavior where
isDragged
would be set to true only once and forever. Do I have to create another
MutableState<Boolean>
and set it to true inside
LanchedEffect(isDragged)
only once? seems overcomplicated.
nevermind, I checked sources of
collectIsDraggedAsState
and devised my own function which only waits for the first
DragInteraction.Start