rjrjr / compose-backstack

Simple composable for rendering transitions between backstacks.
Other
504 stars 23 forks source link

[DNM] Experimenting with RestorableStateHolder shouldSave API #42

Closed zach-klippenstein closed 3 years ago

zach-klippenstein commented 4 years ago

This PR has 3 commits:

  1. The first brings in the proposed RestorableStateHolder from the Compose CL.
  2. The second removes the requirement that the key type T be bundlable by using the compound key hash as the saver key instead (as I proposed in comments on that CL).
  3. The third adds the shouldSave API proposed by Andrey Kulikov, and uses it to drop screens' states when navigating backwards.

This PR should not be merged as-is. It proves that these changes work, and serves as a test bed to see how they integrate with this library (spoiler: very cleanly).

The CI build will fail, but I manually verified that the sample app works as expected.