mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-29 11:11:44 +01:00
Fixes jumpy thread view
This commit is contained in:
parent
4a43a87a79
commit
d1b4f81083
@ -21,7 +21,11 @@
|
||||
package com.vitorpamplona.amethyst.ui.screen
|
||||
|
||||
import android.util.Log
|
||||
import androidx.compose.foundation.lazy.LazyListState
|
||||
import androidx.compose.runtime.Stable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.viewModelScope
|
||||
@ -268,6 +272,8 @@ abstract class FeedViewModel(
|
||||
|
||||
override fun invalidateData(ignoreIfDoing: Boolean) = feedState.invalidateData(ignoreIfDoing)
|
||||
|
||||
var llState: LazyListState by mutableStateOf(LazyListState(0, 0))
|
||||
|
||||
private var collectorJob: Job? = null
|
||||
|
||||
init {
|
||||
|
@ -35,7 +35,6 @@ import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.LazyListState
|
||||
import androidx.compose.foundation.lazy.itemsIndexed
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Icon
|
||||
@ -210,17 +209,15 @@ fun ThreadFeedView(
|
||||
accountViewModel: AccountViewModel,
|
||||
nav: INav,
|
||||
) {
|
||||
val listState = rememberLazyListState()
|
||||
|
||||
RefresheableBox(viewModel) {
|
||||
RenderFeedState(
|
||||
viewModel = viewModel,
|
||||
accountViewModel = accountViewModel,
|
||||
listState = listState,
|
||||
listState = viewModel.llState,
|
||||
nav = nav,
|
||||
routeForLastRead = null,
|
||||
onLoaded = {
|
||||
RenderThreadFeed(noteId, it, listState, accountViewModel, nav)
|
||||
RenderThreadFeed(noteId, it, viewModel.llState, accountViewModel, nav)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user