mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-29 00:03:24 +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.R
|
||||||
import com.vitorpamplona.amethyst.ui.note.NoteCompose
|
import com.vitorpamplona.amethyst.ui.note.NoteCompose
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun FeedView(
|
fun FeedView(
|
||||||
@@ -96,6 +97,11 @@ private fun FeedLoaded(
|
|||||||
) {
|
) {
|
||||||
val listState = rememberLazyListState()
|
val listState = rememberLazyListState()
|
||||||
|
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
delay(500)
|
||||||
|
listState.animateScrollToItem(0)
|
||||||
|
}
|
||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
contentPadding = PaddingValues(
|
contentPadding = PaddingValues(
|
||||||
top = 10.dp,
|
top = 10.dp,
|
||||||
|
@@ -88,8 +88,6 @@ fun SearchScreen(accountViewModel: AccountViewModel, navController: NavControlle
|
|||||||
|
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
feedViewModel.invalidateData()
|
feedViewModel.invalidateData()
|
||||||
delay(500)
|
|
||||||
feedViewModel.invalidateData()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DisposableEffect(accountViewModel) {
|
DisposableEffect(accountViewModel) {
|
||||||
|
Reference in New Issue
Block a user