Returning the function name: interpolateIndex to the original name: interpolateFirstItemIndex

pull/1553/head
Rodrigo Dias Ferreira 1 year ago
parent 32514c1b68
commit 3c7e485659

@ -33,7 +33,7 @@ import kotlin.math.abs
* @return a [Float] in the range [firstItemPosition..nextItemPosition) where nextItemPosition
* is the index of the consecutive item along the major axis.
* */
internal inline fun <LazyState : ScrollableState, LazyStateItem> LazyState.interpolateIndex(
internal inline fun <LazyState : ScrollableState, LazyStateItem> LazyState.interpolateFirstItemIndex(
visibleItems: List<LazyStateItem>,
crossinline itemSize: LazyState.(LazyStateItem) -> Int,
crossinline offset: LazyState.(LazyStateItem) -> Int,

@ -51,7 +51,7 @@ fun LazyListState.scrollbarState(
if (visibleItemsInfo.isEmpty()) return@snapshotFlow null
val firstIndex = min(
a = interpolateIndex(
a = interpolateFirstItemIndex(
visibleItems = visibleItemsInfo,
itemSize = { it.size },
offset = { it.offset },
@ -114,7 +114,7 @@ fun LazyGridState.scrollbarState(
if (visibleItemsInfo.isEmpty()) return@snapshotFlow null
val firstIndex = min(
a = interpolateIndex(
a = interpolateFirstItemIndex(
visibleItems = when (layoutInfo.orientation) {
Orientation.Vertical -> layoutInfo.visibleItemsInfo.filter { it.row == 0 }
Orientation.Horizontal -> layoutInfo.visibleItemsInfo.filter { it.column == 0 }
@ -191,7 +191,7 @@ fun LazyStaggeredGridState.scrollbarState(
if (visibleItemsInfo.isEmpty()) return@snapshotFlow null
val firstIndex = min(
a = interpolateIndex(
a = interpolateFirstItemIndex(
visibleItems = layoutInfo.visibleItemsInfo.filter { it.lane == 0 },
itemSize = { layoutInfo.orientation.valueOf(it.size) },
offset = { layoutInfo.orientation.valueOf(it.offset) },

Loading…
Cancel
Save