Is there Event about when composable is visible on...
# compose
k
Is there Event about when composable is visible on screen or not on-screen, i have scenario in which i have to perform certain action only when Composable is *on-screen*(it is inside scrollable Column)
t
There is this DisposableEffect which you can use to track the livecycle of the composable. For LazyLists this matches also more or less visibility. But for scrollable column it does not match. As far as i know there is no event for visibility.
s
LazyListState
provides
firstVisibleItemIndex
property which you can use to detect if certain item is visible or not based on their index.
z
onGloballyPositioned + asking the layout for trimmed bounds in window should do it