Releases: Zhuinden/simple-stack
Simple-Stack 2.1.1
Simple Stack 2.1.1 (2019-09-26)
-
FIX: Make
findScopesForKey
work consistently even if a key is not aScopeKey
. -
FIX: Add missing
@NonNull
on Context argument on some methods of Navigator.
Simple-Stack 2.1.0
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
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 unnecessarytoBundle()
calls for a multi-registered service).
Simple-Stack 2.0.0
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 nowBackstack
.
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 withScopedServices.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 tofalse
. It's onlytrue
by default if theDefaultStateChanger
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 asServiceBinder
. -
BREAKING CHANGE:
ViewChangeHandler.CompletionCallback
renamed toViewChangeHandler.ViewChangeCallback
. -
BREAKING CHANGE:
StateKey
is renamed toDefaultViewKey
. -
BREAKING CHANGE:
HistoryBuilder
is nowHistory.Builder
. The deprecatedHistoryBuilder
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 onKeyContextWrapper.getKey()
. Now throws exception if the key is not found (previously returned null).
Simple Stack 1.14.1
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 (handlefragment.isRemoving
). -
SAMPLE UPDATE: MVP/MVVM samples have a better packaging structure.
Simple Stack 1.14.0
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
andonScopeInactive
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
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
'sonScopeInactive()
during scope finalization was called in order from explicit parent to child, instead of child to explicit parent.
Simple-Stack 1.13.3
Simple-Stack 1.13.3 (2019-02-27)
-
FIX: NPE when
canFindFromScope()
was used on an uninitialized stack, instead of returningfalse
. -
ADD:
ScopeLookupMode
forcanFindFromScope()
andlookupFromScope()
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
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 replacestateChange.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
Simple Stack 1.13.1 (2018-11-25)
-
UPDATE: Added
simple-stack-example-scoping
to showcase the usage ofScopeKey.Child
, with Fragments and Navigator. -
ADDED:
lookupFromScope()
andcanFindFromScope()
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).