mirror of
https://github.com/PranshulGG/WeatherMaster.git
synced 2026-10-22 02:52:37 -05:00
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:
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()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user