diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedView.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedView.kt index 50de40d7c..3df1af741 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedView.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedView.kt @@ -183,10 +183,6 @@ private fun FeedLoaded( accountViewModel: AccountViewModel, nav: (String) -> Unit ) { - val baseModifier = remember { - Modifier - } - LazyColumn( contentPadding = FeedPadding, state = listState @@ -201,7 +197,7 @@ private fun FeedLoaded( NoteCompose( item, routeForLastRead = routeForLastRead, - modifier = baseModifier, + modifier = Modifier, isBoostedNote = false, showHidden = state.showHidden.value, accountViewModel = accountViewModel, diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/VideoScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/VideoScreen.kt index 2aecf621a..a9b30fb01 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/VideoScreen.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/VideoScreen.kt @@ -4,7 +4,6 @@ import androidx.compose.animation.Crossfade import androidx.compose.animation.core.tween import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.FlowRow @@ -104,16 +103,12 @@ fun VideoScreen( } Column(Modifier.fillMaxHeight()) { - Column( - modifier = Modifier.padding(vertical = 0.dp) - ) { - SaveableFeedState( - videoFeedView = videoFeedView, - accountViewModel = accountViewModel, - nav = nav, - scrollStateKey = ScrollStateKeys.VIDEO_SCREEN - ) - } + RenderPage( + videoFeedView = videoFeedView, + pagerStateKey = ScrollStateKeys.VIDEO_SCREEN, + accountViewModel = accountViewModel, + nav = nav + ) } } @@ -127,16 +122,6 @@ fun WatchAccountForVideoScreen(videoFeedView: NostrVideoFeedViewModel, accountVi } } -@Composable -private fun SaveableFeedState( - videoFeedView: NostrVideoFeedViewModel, - accountViewModel: AccountViewModel, - nav: (String) -> Unit, - scrollStateKey: String? = null -) { - RenderPage(videoFeedView, accountViewModel, scrollStateKey, nav) -} - @OptIn(ExperimentalFoundationApi::class) @Composable public fun WatchScrollToTop( @@ -153,39 +138,35 @@ public fun WatchScrollToTop( } } -@OptIn(ExperimentalFoundationApi::class) @Composable fun RenderPage( videoFeedView: NostrVideoFeedViewModel, - accountViewModel: AccountViewModel, pagerStateKey: String?, + accountViewModel: AccountViewModel, nav: (String) -> Unit ) { val feedState by videoFeedView.feedContent.collectAsStateWithLifecycle() - Box() { - Column { - Crossfade( - targetState = feedState, - animationSpec = tween(durationMillis = 100) - ) { state -> - when (state) { - is FeedState.Empty -> { - FeedEmpty {} - } + Crossfade( + targetState = feedState, + animationSpec = tween(durationMillis = 100), + label = "RenderPage" + ) { state -> + when (state) { + is FeedState.Empty -> { + FeedEmpty {} + } - is FeedState.FeedError -> { - FeedError(state.errorMessage) {} - } + is FeedState.FeedError -> { + FeedError(state.errorMessage) {} + } - is FeedState.Loaded -> { - LoadedState(state, pagerStateKey, videoFeedView, accountViewModel, nav) - } + is FeedState.Loaded -> { + LoadedState(state, pagerStateKey, videoFeedView, accountViewModel, nav) + } - is FeedState.Loading -> { - LoadingFeed() - } - } + is FeedState.Loading -> { + LoadingFeed() } } }