This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get info for the visible item at the given offset. | |
* Returns `null` if the offset does not correspond to an item. | |
*/ | |
fun LazyListState.getVisibleItemInfoAtOffset(offset: Int): LazyListItemInfo? { | |
if (offset < layoutInfo.viewportStartOffset || offset > layoutInfo.viewportEndOffset) { | |
return null | |
} | |
for (item in layoutInfo.visibleItemsInfo) { | |
if (offset >= item.offset && offset < item.offset + item.size) { |