Skip to content

Commit

Permalink
Quick fix using the LazyListState index instead of the previously use…
Browse files Browse the repository at this point in the history
…d manual index not changed when just scrolling.
  • Loading branch information
elekiwi committed Oct 25, 2023
1 parent 7cbf581 commit 58c8869
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ fun Carousel(modifier: Modifier = Modifier) {
horizontalArrangement = Arrangement.Center,
) {
itemsIndexed(bannerImages) { curentIndex, image ->
IndicatorDot(isSelected = currentVisibleIndex.value == curentIndex)
val currentlyVisibleIndex = (sectionItemListState.layoutInfo.visibleItemsInfo.firstOrNull()?.index ?: 0)
IndicatorDot(isSelected = currentlyVisibleIndex== curentIndex)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Tue Oct 10 04:51:12 IST 2023
#Wed Oct 25 12:39:30 ICT 2023
API_KEY=YOUR_SUPABASE_KEY
SECRET=YOUR_SUPABASE_SECRET
SUPABASE_URL=YOUR_SUPABASE_URL
sdk.dir=/Users/hieuvu/Library/Android/sdk
sdk.dir=/Users/leoncio/Library/Android/sdk

0 comments on commit 58c8869

Please sign in to comment.