kopia lustrzana https://github.com/vitorpamplona/amethyst
Trying move the cursor to the first item when the list updates immediately after being first drawn
rodzic
b95c013714
commit
65d4d59e77
|
@ -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) {
|
||||
|
|
Ładowanie…
Reference in New Issue