Billy Newman
06/23/2023, 11:45 PMBilly Newman
06/23/2023, 11:46 PM@Composable
fun Items(
viewModel: ItemsViewModel = hiltViewModel()
) {
val myItems by viewModel.items.observeAsState(emptyList())
Surface(Modifier.fillMaxSize()) {
LazyColumn {
items(
count = myItems.count()
) { index ->
val item = myItems[index]
AnimatedVisibility(
visible = item.visible,
exit = fadeOut(
animationSpec = TweenSpec(20000, 0, FastOutLinearInEasing)
)
) {
ItemContent(...)
}
}
}
}
}
Currently when an item is removed from the list the database is updated to set the items visibility to false. So the viewModel.items list is changed to no longer contain the item. Is this why I am not seeing the item fade animation?ephemient
06/24/2023, 12:03 AM