C - The Container instance this Presenter controls.ActivityComponent - The ActivityComponent.public interface Presenter<C extends Container,ActivityComponent>
Presenter retrieves data from the
Model, and formats it so the View (Container) can present it.
The lifecycle of a Presenter consists of two methods:
acquire(Container, Object)
releaseContainer(Container)
Control over the Container instance starts at acquire(Container, Object),
and ends at releaseContainer(Container).
There are no guarantees on the order of calls to these two methods.
Presenters survive configuration changes, making it easy to manage data and
asynchronous calls.
| Modifier and Type | Method and Description |
|---|---|
void |
acquire(C container,
ActivityComponent activityComponent)
Binds the
Container this BasePresenter controls. |
void |
releaseContainer(C container)
Tells this Presenter to release the
Container instance. |
@MainThread
void acquire(@NonNull
C container,
@NonNull
ActivityComponent activityComponent)
Container this BasePresenter controls.
From this point on, the Presenter may manipulate given Container instance,
until releaseContainer(Container) is called.container - The Container to gain control over.@MainThread
void releaseContainer(@NonNull
C container)
Container instance.
From this point on, the Presenter is not allowed to manipulate
the Container instance supplied to acquire(Container, Object) anymore.