mkrussel
01/05/2024, 3:36 PMrememberSaveable
to persist a generated value on device rotation. The problem I'm running into is that the path to get to the Composable function calling it changes based on the width size class of the device, which changes on rotation. This causes the machinery to think it is a new composable and calls the lambda passed to rememberSaveable
again. I do want the value to be recalculated if the navigate away from that location and navigate back.
My only thought is to pull the value all the way up to the part of the composable that knows whether the composable using rememberSavable
will be called or not and then pass it down, but that's at a level that shouldn't know about or care about this value.Zach Klippenstein (he/him) [MOD]
01/05/2024, 4:09 PMrememberSaveable
explicitly, or better yet use movableContentOf
to preserve all state.mkrussel
01/05/2024, 4:10 PMmoveableContentOf
. I'll look into it, but that sounds like what I want.Zach Klippenstein (he/him) [MOD]
01/05/2024, 4:11 PMZach Klippenstein (he/him) [MOD]
01/05/2024, 4:12 PMmkrussel
01/05/2024, 4:13 PM