mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 04:36:55 +02:00
Trying move the cursor to the first item when the list updates immediately after being first drawn
This commit is contained in:
@@ -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,
|
||||
|
@@ -88,8 +88,6 @@ fun SearchScreen(accountViewModel: AccountViewModel, navController: NavControlle
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
feedViewModel.invalidateData()
|
||||
delay(500)
|
||||
feedViewModel.invalidateData()
|
||||
}
|
||||
|
||||
DisposableEffect(accountViewModel) {
|
||||
|
Reference in New Issue
Block a user