From 58c886997f333f4c13944f5a16304de6e5bff736 Mon Sep 17 00:00:00 2001 From: LeoMe Date: Wed, 25 Oct 2023 12:57:11 +0700 Subject: [PATCH 1/2] Quick fix using the LazyListState index instead of the previously used manual index not changed when just scrolling. --- .../groceriesstore/presentation/shop/composables/Carousel.kt | 3 ++- local.properties | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/hieuwu/groceriesstore/presentation/shop/composables/Carousel.kt b/app/src/main/java/com/hieuwu/groceriesstore/presentation/shop/composables/Carousel.kt index 2e7c6e21..2fefe2b8 100644 --- a/app/src/main/java/com/hieuwu/groceriesstore/presentation/shop/composables/Carousel.kt +++ b/app/src/main/java/com/hieuwu/groceriesstore/presentation/shop/composables/Carousel.kt @@ -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) } } } diff --git a/local.properties b/local.properties index 2da2edd7..66414d55 100644 --- a/local.properties +++ b/local.properties @@ -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 From 216a108d73e4ba3c53874399168dc76583924c39 Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Tue, 31 Oct 2023 21:07:58 +0700 Subject: [PATCH 2/2] Update local.properties --- local.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/local.properties b/local.properties index 66414d55..2da2edd7 100644 --- a/local.properties +++ b/local.properties @@ -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. -#Wed Oct 25 12:39:30 ICT 2023 +#Tue Oct 10 04:51:12 IST 2023 API_KEY=YOUR_SUPABASE_KEY SECRET=YOUR_SUPABASE_SECRET SUPABASE_URL=YOUR_SUPABASE_URL -sdk.dir=/Users/leoncio/Library/Android/sdk +sdk.dir=/Users/hieuvu/Library/Android/sdk