Chris Johnson
02/15/2022, 11:11 PMLazyListMeasure
but wanted to confirm this may be expected functionality before filing it. I currently need to observe the indexes of LazyListItemInfo
from my LazyListState and use them to key off of. When entering my screen for the first time, I would expect that that list would hold the list of visible items except their indexes are off. The first position of the list returned has index 1
when I think it should be 0
. If I scroll up at all (it doesn't change the scroll visibly but I assume it causes measure to hit again and then add index of 0) Is this expected functionality? Line #s in 🧵Chris Johnson
02/15/2022, 11:12 PMmeasureLazyList
function lines 138-153 (Currently on 1.1.0-beta02)
// then composing visible items forward until we fill the whole viewport
while (mainAxisUsed <= maxMainAxis && index.value < itemsCount) {
val measuredItem = itemProvider.getAndMeasure(index)
mainAxisUsed += measuredItem.sizeWithSpacings
if (mainAxisUsed <= minOffset) {
// this item is offscreen and will not be placed. advance firstVisibleItemIndex
currentFirstItemIndex = index + 1
currentFirstItemScrollOffset -= measuredItem.sizeWithSpacings
} else {
maxCrossAxis = maxOf(maxCrossAxis, measuredItem.crossAxisSize)
visibleItems.add(measuredItem)
}
index++
}
Chris Johnson
02/15/2022, 11:14 PMAndrey Kulikov
02/16/2022, 1:05 PMChris Johnson
02/16/2022, 7:29 PM