Yingding Wang
12/30/2021, 9:43 PMlayoutInfo.visibleItemsInfo
and its offset
?
...
val listState = rememberScalingLazyListState()
Scaffold(
timeText = {
val itemInfoList = listState.layoutInfo.visibleItemsInfo
// the first element is scrolled up more than 15dp, deactivate the Time Text
if (itemInfoList.isNotEmpty()
&& itemInfoList[0].index == 0 // the first visible index is the first element
&& itemInfoList[0].offset >= -15 // the first element is scrolled up less than 15dp
) {
// show time text
TimeText()
}
},
Chris Sinco [G]
12/31/2021, 2:08 AMyschimke
12/31/2021, 8:52 AMJohn Nichol
12/31/2021, 11:10 AMYingding Wang
12/31/2021, 11:41 AM