Skip to content

0.5.0

Choose a tag to compare

@ryanmoelter ryanmoelter released this 03 Mar 02:05
· 475 commits to main since this release
40e8680

What's Changed

  • Create sample app by @ryanmoelter in #44
  • Pause navigables when they're transitioning out by @ryanmoelter in #123
  • Add Started lifecycle state by @ryanmoelter in #124
  • Update a bunch of dependencies, including compose bom 2024.02.01 and compose compiler to 1.5.10

Full Changelog: 0.4.1...0.5.0

Breaking change: Introducing the Started lifecycle state

Started replaces Shown and represents "being drawn to the screen with an active Activity and View" (though we don't really need to care about views in compose). This aligns with Android's use of the term "started". It's also worth noting that our ComposeStep.Content() is only active when Started or Resumed.

Shown is still around, though it now represents "on top of the backstack". show() and hide() are now effectively navigatedTo() and navigatedFrom() respectively.

This means that we now have a lifecycle state (and coroutine scope) in which to put work that we want to survive a rotation, but not navigating to another Step. In most cases, shownScope is where you want to put work happening in a screen, unless you want it to only run while focused (resumedScope) or while the view/activity is active (startedScope).

State On backstack Top of backstack View created +
Activity available +
Compose active
In focus
Destroyed
Created ✔ (roughly)
Shown (changed)
Started (new)
Resumed

Migration steps

  • Any work that requires an activity, view, or active composition should move to startedScope.
  • Any other work, especially anything you want to survive rotation, can stay in shownScope.