Как проверить видимость элемента списка в Jetpack ComposeAndroid

Форум для тех, кто программирует под Android
Anonymous
Как проверить видимость элемента списка в Jetpack Compose

Сообщение Anonymous »


FlatList of React Nativehas a property viewabilityConfigCallbackPairs where you can set:

viewabilityConfig: { itemVisiblePercentThreshold: 50, waitForInteraction: true, } to detect visible items of the list with threshold of 50% and after interaction or scroll.

Does Jetpack Compose also have something similar to this?

There is LazyListState with some layout info. But I wonder if there is anything built-in component/property for this use case.

Edit

I have a list of cardviews and I want to detect which card items (at least 50% of card is visible) are visible on display. But it needs to be detected only when the card is clicked or list is scrolled by user.


Источник: https://stackoverflow.com/questions/692 ... ck-compose

Вернуться в «Android»