Bug fixes
Fix issue #104: isInitializing
returns wrong value when used with REPLACE
Maintenance release, removes some outdated class files that were accidentally included in the aar
API breaks
- Change
Screenplay#go
toScreenplay#transition
- Change
Screenplay#isTransitioning
to return a boolean - Remove
Stage.java
,MutableStage.java
andImmutableStage.java
- Rename
Scene.java
toStage.java
to avoid conflicting with the Android Scene class - Rename
Scene#isStacking
toStage#isModal
- Rename
Scene.Transformer
toStage.Rigger
to avoid conflicting with various other class names - Rename
Scene.Component
toStage.Component
- Various components removed from the library project, such as the
MortarPresenterComponent
- Mortar sample project removed
- Package structure changed
- Flow-specific concerns moved to a plugin
Other changes
- Move various parts of the README to a wiki
Fix bug in which the initial scene's tearDown
method was never being called (issue #91)
- throw an exception when trying to add a scene to the backstack twice (issue #56)
- add support for methods that add or remove multiple:
Flow#forward
,Flow#backward
andFlow#resetTo
now work correctly (issue #84) - add workaround for
Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference
crash (issue #88)
Bug fixes
Fix issue where not all views were being removed when replaceTo
was called with a stacking scene
showing.
New features
Helper methods
Added two helper methods, Screenplay.isSceneAttached
and Screenplay.isSceneInBackstack
, for
querying whether a scene is already in the backstack.
Bug fixes
Scene.tearDown
and Component.tearDown
will now be called on scenes that remain in the backstack
when the activity is destroyed (see item #2, below)
API breaks
- The
Director
object is now calledStage
. There is aMutableStage
class and anImmutableStage
. TheMutableStage
can be bound to a new activity but theImmutableStage
cannot -- its fields are final. TheImmutableStage
is intended to be used with DI frameworks such as Dagger 2 which can recreate the object graph and its dependencies when the main Activity is destroyed. - A new method,
Screenplay.exit
, has been added. This must be called inActivity.onDestroy
. It triggers teardown callbacks on scenes that remain on the backstack.
New features
Support for multiple stacked scenes
If there are multiple stacked views (dialogs, drawers, etc.) in a scene, the Screenplay will now "remember" the state when you navigate to a different scene and restore the state correctly when you navigate back.
Persistent scopes
The ScopedScene
now has a persistent scope that is only destroyed when it is popped off of the
stack.
Better handling of configuration changes
Scenes now have a Scene.teardownOnConfigurationChanges
method (true by default). If true, the
Scene's tearDown
and setUp
methods will be called when a configuration change occurs. This is
useful if you want to load a different XML resource on configuration changes.
API breaks
- The
Rigger
class has been removed. It has been replaced with a boolean flag,Scene.isStacking
. - The
ScopedScene
now creates a scope in the constructor, instead of inScene.setUp
. This avoids the need to do 'late injection` on the Scene. Injected fields are available immediately and use the scene's scope, not the parent scope. - The
Scene.setUp
method now takes aFlow.Direction
as a parameter. This is intended to support tearing down theScopedScene
when it is popped off of the stack. - The
afterSetUp
andbeforeTearDown
callbacks on theComponent
no longer take a View as an argument as this was redundant. Access the view withScene.getView
. - The
Scene.tearDown
andComponent.beforeTearDown
methods now have a boolean parameter,isFinishing
. This istrue
if the scene is being popped off of the stack,false
otherwise. - The
Scene.setUp
andComponent.afterSetUp
methods now have a boolean parameter,isInitializing
. This istrue
if the scene is being pushed onto the stack,false
otherwise. - Components are no longer passed through the scene's constructor. use the
addComponents()
method instead. - Components no longer pass a context argument. Use
Scene.getView.getContext
instead. ScopedScene
changed toMortarScopedScene
- Begin version tracking