Skip to content

Simple-Stack 2.2.0

Choose a tag to compare

@Zhuinden Zhuinden released this 30 Dec 15:37
· 165 commits to master since this release

Simple-Stack 2.2.0 (2019-12-30)

  • ADDED: ScopedService.HandlesBack.

When a service implements HandlesBack, then when Backstack.goBack() is called, it is first dispatched across the current active explicit scope chain.

This allows handling "back", without having to dispatch it through the active view hierarchy (in order to get access to it in scoped services).

  • FIX: Backstack.moveToTop() did not re-order the scope hierarchy according to the new active keys (as the scope order depended on construction order, but existing scopes were not recreated).

This could have been a problem if services used the same name across multiple scopes, and the keys were re-ordered in place (not add/remove).

  • ADDED: Backstack.setGlobalServices(GlobalServices.Factory) and its BackstackDelegate/Navigator equivalent.

This allows delaying the instantiation of services when the global scope is actually being created, rather than providing them immediately.

Please note that providing a GlobalServices.Factory will override whatever GlobalServices was previously set.

Also note that the GlobalServices.Factory should not be an anonymous inner class / lambda / inner class, as it is kept for configuration changes.

  • DEPRECATED: BackstackDelegate.

With the renaming of BackstackManager to Backstack in 2.0.x, it's become easier to use Backstack directly than juggling the BackstackDelegate.

Also, using Navigator with Fragments seems to have no side-effects, therefore this is now the preferred approach (since setting a non-default state changer calls setShouldPersistContainerChild(false), also since 2.0.x).

Therefore, using Navigator is now preferred over BackstackDelegate.

  • FIX: Backstack.forceClear() now calls finalizeScopes() first to ensure that scoped services are also properly reset.