Sudhir Singh Khanger
10/22/2022, 4:25 PMLazyColumn
item becomes visible for only once. It shouldn't trigger if a user moves up and down the list.
The problem I am facing is that irrespective of which side effect I use any time a Composable from down the list becomes visible, it seems, starts a new composition which means the side effect gets triggered when a user moves up or down the list. Is there a way to avoid this situation? I had asked my question here on SO.
So far, the only way to handle this situation for me would be holding a variable in the data class (isSeen: Boolean
).Jhonatan Sabadi
10/23/2022, 6:41 PMval isVisibleAtFirts by remember { mutableStateOf(false)
You can use LazyListLayoutInfo to get item visibility on screen, and when item is visible, just set variable to true