0
votes

In recycler view we can implement drag and drop functionality using ItemTouchHelper. How can i achieve the same thing in jetpack compose lazy column/row

import androidx.compose.foundation.lazy.items

@Composable
fun MessageList(messages: List<Message>) {
    LazyColumn {
        items(messages) { message ->
            MessageRow(message)
        }
    }
}
1

1 Answers

-2
votes

Use Modifiers. Modifier.pointerInput() can be used to react to gestures. See the official docs on Animation in Compose. It shows an example implementing a swipe to dismiss (delete) a list item. Hopefully you can implement something custom to achieve your desired effect