From 10ac2820e1373eb1bb62405460efa3e54fd68ead Mon Sep 17 00:00:00 2001 From: shamim-emon Date: Wed, 11 Sep 2024 21:53:32 +0600 Subject: [PATCH 1/2] issue-fix-3492 --- .../main/java/com/ivy/piechart/PieChartStatisticScreen.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticScreen.kt b/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticScreen.kt index 31d1a21e18..b82ededabf 100644 --- a/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticScreen.kt +++ b/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticScreen.kt @@ -61,6 +61,7 @@ import com.ivy.navigation.TransactionsScreen import com.ivy.navigation.navigation import com.ivy.navigation.screenScopedViewModel import com.ivy.ui.R +import com.ivy.ui.rememberScrollPositionListState import com.ivy.wallet.ui.theme.GradientGreen import com.ivy.wallet.ui.theme.Gray import com.ivy.wallet.ui.theme.Green @@ -84,6 +85,7 @@ import com.ivy.wallet.ui.theme.pureBlur import com.ivy.wallet.ui.theme.toComposeColor import com.ivy.wallet.ui.theme.wallet.AmountCurrencyB1Row import kotlinx.collections.immutable.persistentListOf +import timber.log.Timber import java.util.UUID @ExperimentalFoundationApi @@ -111,7 +113,9 @@ private fun BoxWithConstraintsScope.UI( onEvent: (PieChartStatisticEvent) -> Unit = {} ) { val nav = navigation() - val lazyState = rememberLazyListState() + val lazyState = rememberScrollPositionListState( + key = "item_pie_chart_lazy_column" + ) val expanded = lazyState.firstVisibleItemIndex < 1 val percentExpanded by animateFloatAsState( targetValue = if (expanded) 1f else 0f, From 5f319f664b60e340dea0bbc79e44c25d99490e69 Mon Sep 17 00:00:00 2001 From: shamim-emon Date: Wed, 11 Sep 2024 21:54:28 +0600 Subject: [PATCH 2/2] issue-fix-3492 --- .../src/main/java/com/ivy/piechart/PieChartStatisticScreen.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticScreen.kt b/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticScreen.kt index b82ededabf..02fe62665e 100644 --- a/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticScreen.kt +++ b/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticScreen.kt @@ -18,7 +18,6 @@ import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.itemsIndexed -import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -85,7 +84,6 @@ import com.ivy.wallet.ui.theme.pureBlur import com.ivy.wallet.ui.theme.toComposeColor import com.ivy.wallet.ui.theme.wallet.AmountCurrencyB1Row import kotlinx.collections.immutable.persistentListOf -import timber.log.Timber import java.util.UUID @ExperimentalFoundationApi