wealthfront / magellan

The simplest navigation library for Android.
Apache License 2.0
677 stars 70 forks source link

Expose callback for completed transitions #253

Closed cmathew closed 1 year ago

cmathew commented 1 year ago

we have navigationPropagator.afterNavigation but it fires as the (animated) transition is beginning. Currently the only way to await the end of a transition is transitionFinished at the individual Navigable level

this new callback probably belongs at the navigator level. But something global would be useful too, for elements that don't have access to each navigator (e.g. we want to change Toolbar UI whenever a navigation finishes "somewhere")

cmathew commented 1 year ago

two options to achieve this. 1.) use a static, global event system similar to how currentScreen works today or 2.) look into scoping it per-navigator i.e. described in: https://github.com/wealthfront/magellan/issues/254 for currentNavigable