public static class BrowseSupportFragment.MainFragmentAdapter<T extends Fragment> extends Object
BrowseSupportFragment
and it's main
content fragment. The key method is getFragment()
,
it will be used to get the fragment to be shown in the content section. Clients can
provide any implementation of fragment and customize it's interaction with
BrowseSupportFragment
by overriding the necessary methods.
Clients are expected to provide
an instance of BrowseSupportFragment.MainFragmentAdapterRegistry
which will be responsible for providing
implementations of BrowseSupportFragment.MainFragmentAdapter
for given content types. Currently
we support different types of content - ListRow
, PageRow
or any subtype
of Row
. We provide an out of the box adapter implementation for any rows other than
PageRow
- RowsSupportFragment.MainFragmentAdapter
.
PageRow
is intended to give full flexibility to developers in terms of Fragment
design. Users will have to provide an implementation of BrowseSupportFragment.MainFragmentAdapter
and provide that through BrowseSupportFragment.MainFragmentAdapterRegistry
.
BrowseSupportFragment.MainFragmentAdapter
implementation can supply any fragment and override
just those interactions that makes sense.
Constructor and Description |
---|
MainFragmentAdapter(T fragment) |
Modifier and Type | Method and Description |
---|---|
T |
getFragment() |
BrowseSupportFragment.FragmentHost |
getFragmentHost()
Returns the current host interface so that main fragment can interact with
BrowseSupportFragment . |
boolean |
isScalingEnabled()
Returns whether row scaling is enabled.
|
boolean |
isScrolling()
Returns whether its scrolling.
|
void |
onTransitionEnd()
Callback indicating transition end.
|
boolean |
onTransitionPrepare()
Callback indicating transition prepare start.
|
void |
onTransitionStart()
Callback indicating transition start.
|
void |
setAlignment(int windowAlignOffsetFromTop)
Sets the window alignment and also the pivots for scale operation.
|
void |
setEntranceTransitionState(boolean state)
For rows that willing to participate entrance transition, this function
hide views if afterTransition is true, show views if afterTransition is false.
|
void |
setExpand(boolean expand)
Set the visibility of titles/hovercard of browse rows.
|
void |
setScalingEnabled(boolean scalingEnabled)
Sets the row scaling property.
|
public MainFragmentAdapter(T fragment)
public final T getFragment()
public boolean isScrolling()
public void setExpand(boolean expand)
public void setEntranceTransitionState(boolean state)
public void setAlignment(int windowAlignOffsetFromTop)
public boolean onTransitionPrepare()
public void onTransitionStart()
public void onTransitionEnd()
public boolean isScalingEnabled()
public void setScalingEnabled(boolean scalingEnabled)
public final BrowseSupportFragment.FragmentHost getFragmentHost()
BrowseSupportFragment
.