I want to animate the task item placement to the bottom of the list when the task item checked (isDone == true)
This is the code for the Lazy Column
LazyColumn(
modifier = Modifier.padding(paddingValues),
state = listState,
contentPadding = PaddingValues(16.dp)
) {
items(tasks) { task ->
TaskItem(
task = task,
onEvent = viewModel::onEvent,
onItemClick = {
viewModel.onEvent(TaskEvents.OpenOrCreateTask(task.id))
containerState = ContainerState.Fullscreen
},
modifier = Modifier
.fillMaxWidth()
.border(BorderStroke(2.dp, Color.Black))
.padding(8.dp)
)
}
}
This is the data class for the task item (isDone represents if the task is completed or not)
I want the completed tasks to appear at the end of the list but also want to animate is
@Entity
data class Task(
val title: String,
val description: String?,
val isDone: Boolean,
@PrimaryKey val id: Int? = null
)
I tried the animateContentPlacement modifier and can’t figure anything else
Abhay Sharma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.