Skip to content

Releases: Zhuinden/simple-stack

Simple-Stack 2.1.1

26 Sep 15:43
Compare
Choose a tag to compare

Simple Stack 2.1.1 (2019-09-26)

  • FIX: Make findScopesForKey work consistently even if a key is not a ScopeKey.

  • FIX: Add missing @NonNull on Context argument on some methods of Navigator.

Simple-Stack 2.1.0

25 Sep 20:41
Compare
Choose a tag to compare

Simple Stack 2.1.0 (2019-09-25)


  • FIX: Ensure that while navigation is in progress, lookupService() (and other service lookup methods) can access all currently built scopes, rather than only the latest navigation history currently being navigated to.

This fix is crucial when lookupService is used inside onFinishInflate method of views inflated by ViewPager adapters; and returning from process death, navigation to a different screen is immediate (f.ex. deep-linking via notifications).

Simple-Stack 2.0.3

20 May 21:14
Compare
Choose a tag to compare

Simple Stack 2.0.3 (2019-05-20)

  • ADDED: ServiceBinder.addAlias() to allow adding an alias to an added service: available for look-up, but without getting callbacks by this registration (thus avoiding unnecessary toBundle() calls for a multi-registered service).

Simple-Stack 2.0.0

30 Apr 15:36
Compare
Choose a tag to compare

Simple Stack 2.0.0 (2019-04-30)

MAJOR API BREAKING CHANGES! To create better consistency and naming, certain core APIs were renamed, moved around, restructured, etc.

This means that 1.x and 2.x shouldn't be used in a project at the same time, because they're not compatible.

  • BREAKING CHANGE: BackstackManager is now Backstack.

What was called Backstack is now called NavigationCore and is an internal class (not part of public API).

(!) This also means that the new Backstack(List<?>) constructor is replaced with new Backstack(); backstack.setup(List<?>).

All sane public APIs of NavigationCore were moved over to the new Backstack (think navigation-related ones).

This means that wherever you used to receive a Backstack, now you still receive a "Backstack", but it has additional functionality (such as lookupService).

As a result, the following methods no longer exist:

  • BackstackDelegate.getManager() is removed

  • Navigator.getManager() is removed

  • ServiceBinder.getManager() is removed

With that, StateChange.getBackstack() now returns what was previously the BackstackManager, allowing access to scope-related functions.

  • BREAKING CHANGE: ScopedServices.Scoped is removed, and completely replaced with ScopedServices.Registered.

  • BREAKING CHANGE: ScopedServices.Activated behavior change, now only called once rather than multiple times if the service is in an active explicit parent chain.

    • onScopeActive()/onScopeInactive() -> onServiceActive()/onServiceInactive().

Previously, you could get multiple callbacks to onScopeActive per each activated scope the service was in, now it is tracked per service instead and only called for 0->1 and 1->0.

  • BREAKING CHANGE: setShouldPersistContainerChild(true) was the default, now it is default to false. It's only true by default if the DefaultStateChanger is used.

If you use a custom-view-based setup and a custom state changer, please make sure to set Navigator.configure().setShouldPersistContainerChild(true).install(...).

  • BREAKING CHANGE: ScopedServices.ServiceBinder is now moved to top-level, now accessible as ServiceBinder.

  • BREAKING CHANGE: ViewChangeHandler.CompletionCallback renamed to ViewChangeHandler.ViewChangeCallback.

  • BREAKING CHANGE: StateKey is renamed to DefaultViewKey.

  • BREAKING CHANGE: HistoryBuilder is now History.Builder. The deprecated HistoryBuilder factory methods were removed.

  • BREAKING CHANGE:

    • StateChange.getPreviousState() -> StateChange.getPreviousKeys()
    • StateChange.getNewState() -> StateChange.getNewKeys()
    • StateChange.topPreviousState() -> StateChange.topPreviousKey()
    • StateChange.topNewState() -> StateChange.topNewKey()
    • StateChange.isTopNewStateEqualToPrevious() -> StateChange.isTopNewKeyEqualToPrevious()
  • BREAKING CHANGE: StateChange.backstack() -> StateChange.getBackstack().

  • BREAKING CHANGE: ServiceBinder method renaming for sake of consistency.

    • ServiceBinder.add() -> ServiceBinder.addService()
    • ServiceBinder.has() -> ServiceBinder.hasService()
    • ServiceBinder.get() -> ServiceBinder.getService()
    • ServiceBinder.canFind() -> ServiceBinder.canFindService()
    • ServiceBinder.lookup() -> ServiceBinder.lookupService()
    • ServiceBinder.canFindFrom() -> ServiceBinder.canFindFromScope()
    • ServiceBinder.lookUpFrom() -> ServiceBinder.lookupFromScope()
  • CHANGE/FIX: Added missing @NonNull annotation on KeyContextWrapper.getKey(). Now throws exception if the key is not found (previously returned null).

Simple Stack 1.14.1

26 Apr 16:44
Compare
Choose a tag to compare

Simple-Stack 1.14.1 (2019-04-26)

  • FIX: onServiceUnregistered() was called multiple times if the service was being unregistered from a scope where it was registered multiple times.

  • SAMPLE UPDATE: Safer version of the FragmentStateChanger that handles re-entrancy of back and going to the same target as where we were (handle fragment.isRemoving).

  • SAMPLE UPDATE: MVP/MVVM samples have a better packaging structure.

Simple Stack 1.14.0

16 Mar 01:14
Compare
Choose a tag to compare

Simple-Stack 1.14.0 (2019-03-16)

  • ADD: ScopedServices.Registered to receive a service lifecycle callback when a service is added to a scope for the first time (it was not in any other scopes).

  • ADD: findScopesForKey(Object key, ScopeLookupMode mode) to retrieve the list of scopes accessible from a given key.

  • FIX: A service registered in multiple scopes would receive fromBundle(stateBundle) callback in each scope where it was registered and when that given scope was entered, restoring potentially outdated state on back navigation.

Now, a service will only receive fromBundle callback before its onServiceRegistered() callback, and not before each onEnterScope(scopeTag) callbacks.

  • FIX: during backstackManager.finalizeScopes(), onExitScope and onScopeInactive were dispatched in an incorrect order across nested explicit parents.

  • CHANGE: persistViewToState()/restoreViewFromState() now use a separate bundle from the one that's publicly visible on SavedState.

Simple Stack 1.13.4

10 Mar 01:04
Compare
Choose a tag to compare

Simple-Stack 1.13.4 (2019-03-10)

  • FIX: calling backstackManager.finalizeScopes() multiple times now results in consistent and defined behavior (namely, it gets ignored).

  • CHANGE: navigation that occurs after backstackManager.finalizeScopes() will now trigger reconstruction and proper callbacks of services in a consistent manner.

  • FIX: ScopedServices.Activated's onScopeInactive() during scope finalization was called in order from explicit parent to child, instead of child to explicit parent.

Simple-Stack 1.13.3

27 Feb 04:49
Compare
Choose a tag to compare

Simple-Stack 1.13.3 (2019-02-27)

  • FIX: NPE when canFindFromScope() was used on an uninitialized stack, instead of returning false.

  • ADD: ScopeLookupMode for canFindFromScope() and lookupFromScope() methods, which allows restricting the lookup only to the explicit parent chain).

  • ADD: setGlobalServices() to allow setting global services (that functions as the last parent of any parent chains).

Simple Stack 1.13.2

05 Feb 03:15
Compare
Choose a tag to compare

Simple-Stack 1.13.2 (2019-02-05)

  • FIX: Fix that a service registered multiple times in the same scope with different tags would receive service lifecycle callbacks as many times as it was registered.

  • ADD: Convenience method stateChange.isTopNewStateEqualToPrevious() to replace stateChange.topNewState<Any>() == stateChange.topPreviousState() condition check. It does the same thing, but maybe it's a bit easier to read.

  • FIX: Fix a typo which resulted in not throwing if the provided service tag was null (whoops.)

  • UPDATE: Backstack now checks if altering methods are called from the thread where the backstack was created.

Simple Stack 1.13.1

25 Nov 02:15
3bb349c
Compare
Choose a tag to compare

Simple Stack 1.13.1 (2018-11-25)

  • UPDATE: Added simple-stack-example-scoping to showcase the usage of ScopeKey.Child, with Fragments and Navigator.

  • ADDED: lookupFromScope() and canFindFromScope() methods that begin the lookup from the specified scope, instead of the active-most one. This is to allow safer look-ups when the same service tag is used in different scopes.

  • UPDATE: Better error message if the scope does not exist for lookup (also provides the currently accessed scopes).