Trying move the cursor to the first item when the list updates immediately after being first drawn

pull/180/head
Vitor Pamplona 2023-03-02 09:35:43 -05:00
rodzic b95c013714
commit 65d4d59e77
2 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -30,6 +30,7 @@ import com.google.accompanist.swiperefresh.rememberSwipeRefreshState
import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.ui.note.NoteCompose
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
import kotlinx.coroutines.delay
@Composable
fun FeedView(
@ -96,6 +97,11 @@ private fun FeedLoaded(
) {
val listState = rememberLazyListState()
LaunchedEffect(Unit) {
delay(500)
listState.animateScrollToItem(0)
}
LazyColumn(
contentPadding = PaddingValues(
top = 10.dp,

Wyświetl plik

@ -88,8 +88,6 @@ fun SearchScreen(accountViewModel: AccountViewModel, navController: NavControlle
LaunchedEffect(Unit) {
feedViewModel.invalidateData()
delay(500)
feedViewModel.invalidateData()
}
DisposableEffect(accountViewModel) {