public abstract class PresenterSwitcher extends Object
PresenterSelector
. A subclass should implement insertView(View)
to define
how to add the view in parent, and may optionally override onViewSelected(View)
.Constructor and Description |
---|
PresenterSwitcher() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Destroys created views.
|
ViewGroup |
getParentViewGroup()
Returns the parent.
|
void |
init(ViewGroup parent,
PresenterSelector presenterSelector)
Initializes the switcher with a parent view to insert view into and a
PresenterSelector for choosing a Presenter for a given object. |
protected abstract void |
insertView(View view) |
protected void |
onViewSelected(View view)
Called when a view is bound to the object of
select(Object) . |
void |
select(Object object)
Selects a view based on the given object and shows that view.
|
protected void |
showView(View view,
boolean visible) |
void |
unselect()
Hides the view.
|
public void init(ViewGroup parent, PresenterSelector presenterSelector)
PresenterSelector
for choosing a Presenter
for a given object.
This will destroy any existing views.public void select(Object object)
public void unselect()
public final ViewGroup getParentViewGroup()
protected abstract void insertView(View view)
protected void onViewSelected(View view)
select(Object)
.protected void showView(View view, boolean visible)
public void clear()