Skip to content

Commit

Permalink
Merge pull request #228 from eleonsio/fix/indicatordot_selection
Browse files Browse the repository at this point in the history
IndicatorDot switching on scroll.
  • Loading branch information
hieuwu authored Oct 31, 2023
2 parents f5eb2b6 + 216a108 commit ba50323
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit ba50323

Please sign in to comment.