fix: eliminate modern home expand-from-topleft glitch on initial load

- Use EnterTransition.None for first appearance instead of fadeIn(320ms)
- Initialize heroItem synchronously from carouselRows instead of null
- Subsequent navigations still use fadeIn + slideInVertically animation
This commit is contained in:
HALİL İBRAHİM ÖZDEMİR 2026-03-26 05:33:35 +03:00
parent 1efbe16e30
commit 115543161b
2 changed files with 6 additions and 2 deletions

View file

@ -1,6 +1,7 @@
package com.nuvio.tv.ui.screens.home
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.slideInVertically
@ -224,7 +225,7 @@ fun HomeScreen(
animationSpec = tween(320)
)
} else {
fadeIn(animationSpec = tween(320))
EnterTransition.None
}
) {
when (uiState.homeLayout) {

View file

@ -207,7 +207,10 @@ fun ModernHomeContent(
var pendingRowFocusKey by remember { mutableStateOf<String?>(null) }
var pendingRowFocusIndex by remember { mutableStateOf<Int?>(null) }
var pendingRowFocusNonce by remember { mutableIntStateOf(0) }
var heroItem by remember { mutableStateOf<HeroPreview?>(null) }
var heroItem by remember {
val initialHero = carouselRows.firstOrNull()?.items?.firstOrNull()?.heroPreview
mutableStateOf<HeroPreview?>(initialHero)
}
val heroTransitioningRef = remember { java.util.concurrent.atomic.AtomicBoolean(false) }
var restoredFromSavedState by remember { mutableStateOf(false) }
var optionsItem by remember { mutableStateOf<ContinueWatchingItem?>(null) }