public class FeatureContainerAdapter extends java.lang.Object implements FeatureContainer
FeatureContainerAdapter
provides an adapter class for implementing
FeatureContainer
s.Constructor and Description |
---|
FeatureContainerAdapter(FeatureContainerProvider provider) |
FeatureContainerAdapter(FeatureContainerProvider provider,
int containerViewId) |
Modifier and Type | Method and Description |
---|---|
boolean |
canCommitFragment()
Tests if a
Fragment can be committed. |
boolean |
canGoBack()
Tests if the previous
FeatureView can be popped from the back stack. |
boolean |
canShowView(FeatureView view)
Tests if the given
FeatureView can be shown by this FeatureTransitionManager . |
void |
clearBackStack(java.util.HashMap<java.lang.String,FeatureView> backStackViews)
Clears
FeatureView s of contained Feature from the back stack. |
static FeatureContainerAdapter |
create(FeatureContainerProvider provider,
int containerViewId) |
int |
getContainerViewId()
Gets the container
ViewGroup ID for this FeatureContainer . |
android.content.Context |
getContext()
Gets the
Context available for FeatureCompatFragment s |
android.content.res.Resources |
getResources()
Gets the
Resources available for FeatureCompatFragment s |
java.lang.String |
goBack()
Pops the previous
FeatureView from the back stack. |
void |
removeView(FeatureView featureView,
boolean addedToBackstack,
java.lang.String fragmentTag)
Removes the given
FeatureView from its container. |
void |
showView(FeatureView featureView,
boolean addToBackStack,
java.lang.String fragmentTag)
Shows the given
FeatureView . |
public FeatureContainerAdapter(FeatureContainerProvider provider)
public FeatureContainerAdapter(FeatureContainerProvider provider, int containerViewId)
public static FeatureContainerAdapter create(FeatureContainerProvider provider, int containerViewId)
public android.content.Context getContext()
FeatureContainer
Context
available for FeatureCompatFragment
sgetContext
in interface FeatureContainer
Context
.public int getContainerViewId()
FeatureContainer
ViewGroup
ID for this FeatureContainer
.getContainerViewId
in interface FeatureContainer
int
constant.public android.content.res.Resources getResources()
FeatureContainer
Resources
available for FeatureCompatFragment
sgetResources
in interface FeatureContainer
Resources
.public boolean canCommitFragment()
FeatureContainer
Fragment
can be committed. A Fragment
cannot be committed
using FragmentTransaction.commit()
after method Activity.onSaveInstanceState(Bundle)
has been invoked.canCommitFragment
in interface FeatureContainer
boolean
value.public void clearBackStack(java.util.HashMap<java.lang.String,FeatureView> backStackViews)
FeatureContainer
FeatureView
s of contained Feature
from the back stack.clearBackStack
in interface FeatureContainer
backStackViews
- A HashMap
containing the backpublic boolean canGoBack()
FeatureContainer
FeatureView
can be popped from the back stack.canGoBack
in interface FeatureContainer
boolean
value.public java.lang.String goBack()
FeatureContainer
FeatureView
from the back stack.goBack
in interface FeatureContainer
FeatureView
. May return null
.public boolean canShowView(FeatureView view)
FeatureTransitionManager
FeatureView
can be shown by this FeatureTransitionManager
.canShowView
in interface FeatureTransitionManager
view
- A FeatureView
.boolean
.public void showView(FeatureView featureView, boolean addToBackStack, java.lang.String fragmentTag)
FeatureTransitionManager
FeatureView
. If parameter fragmentTag
is given null
value, implementation of this method should use the View.getViewTag()
method
to obtain the tag.showView
in interface FeatureTransitionManager
featureView
- A FeatureView
. May not be null
.addToBackStack
- A boolean
value specifying if the FeatureView
is added
to back stack.fragmentTag
- A tag for the Fragment
. May be null
.public void removeView(FeatureView featureView, boolean addedToBackstack, java.lang.String fragmentTag)
FeatureTransitionManager
FeatureView
from its container.removeView
in interface FeatureTransitionManager
featureView
- A FeatureView
. May not be null
.addedToBackstack
- A boolean
value specifying if the FeatureView
was
added to back stack.fragmentTag
- The tag that was used in adding the Fragment
. May be null
,
if no tag was given when adding the Fragment
.