From c9b5e06753e32cc3dff8525d40d02e6f5ed68d14 Mon Sep 17 00:00:00 2001 From: aeghn Date: Tue, 17 Oct 2023 18:30:22 +0800 Subject: [PATCH] remeber feed pages position --- .../java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt index 94ef8d916..bdc6699f9 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt @@ -1,11 +1,13 @@ package me.ash.reader.ui.page.home.feeds +import android.util.Log import androidx.activity.compose.BackHandler import androidx.compose.animation.core.* import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.itemsIndexed +import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.KeyboardArrowRight import androidx.compose.material.icons.outlined.Settings @@ -81,6 +83,7 @@ fun FeedsPage( val newVersion = LocalNewVersionNumber.current val skipVersion = LocalSkipVersionNumber.current val currentVersion = remember { context.getCurrentVersion() } + val listState = if (groupWithFeedList.isNotEmpty()) feedsUiState.listState else rememberLazyListState() val owner = LocalLifecycleOwner.current var isSyncing by remember { mutableStateOf(false) } @@ -157,7 +160,9 @@ fun FeedsPage( } }, content = { - LazyColumn { + LazyColumn ( + state = listState + ) { item { DisplayText( modifier = Modifier