From 3c7e48565921e5e5acb04dfb417d4e725ad4f75a Mon Sep 17 00:00:00 2001 From: Rodrigo Dias Ferreira Date: Mon, 12 Aug 2024 09:31:32 -0300 Subject: [PATCH] Returning the function name: interpolateIndex to the original name: interpolateFirstItemIndex --- .../component/scrollbar/LazyScrollbarUtilities.kt | 2 +- .../core/designsystem/component/scrollbar/ScrollbarExt.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/LazyScrollbarUtilities.kt b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/LazyScrollbarUtilities.kt index 9326613b7..b7e610695 100644 --- a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/LazyScrollbarUtilities.kt +++ b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/LazyScrollbarUtilities.kt @@ -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.interpolateIndex( +internal inline fun LazyState.interpolateFirstItemIndex( visibleItems: List, crossinline itemSize: LazyState.(LazyStateItem) -> Int, crossinline offset: LazyState.(LazyStateItem) -> Int, diff --git a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/ScrollbarExt.kt b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/ScrollbarExt.kt index 946b8a3b1..051c8b5ab 100644 --- a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/ScrollbarExt.kt +++ b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/ScrollbarExt.kt @@ -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) },