I guess this question have been asked before, but ...
# compose
m
I guess this question have been asked before, but I could not find it, so sorry if it’s now asked again. If I use AnchoredDraggable to create a listitem that can reveal actions under (left or right) the content of that item, how do I, when this is used a lazycolumn, reset the anchor to its resting state on all other items when one item has been swept, or reset all when the user scrolls the content of the LazyColumn? Basically how iOS handles Tableviews with actions by default.
s
Something like this, maybe:
Copy code
val swipeState = remember { SwipeState() }
val listState = rememberLazyListState()
LazyColumn(state = listState) {
...
}
LaunchedEffect(listState.firstVisibleItemIndex, listState.firstVisibleItemScrollOffset) {
    swipeState.clear()
}
where
SwipeState
contains an observable set of indexes mapped to swipe positions.
m
Thanks, ill try