Merge pull request #1049 from reveler-hub/fix/weather-screen-crossfade-jitter

Fix a visible stutter/flash on every weather refresh
This commit is contained in:
Pranshul authored and GitHub committed 2026-08-20 09:47:13 +05:30
commit 282d3ba501
1 file changed
+6
@@ -134,6 +134,12 @@ fun MainScreenScaffold(
) {
AnimatedContent(
targetState = weather,
// Keyed on the location, not the whole Weather object: a plain data
// refresh produces a new Weather instance (different lastUpdatedInMilli
// etc.) even when nothing visually changed, which made every refresh
// full-screen crossfade instead of just recomposing the changed values -
// only an actual location switch should get the transition.
contentKey = { it?.location?.id },
transitionSpec = {
fadeIn() togetherWith fadeOut()
}