public
class
HeadersSupportFragment
extends Fragment
java.lang.Object | ||
↳ | android.support.v4.app.Fragment | |
↳ | android.support.v17.leanback.app.HeadersSupportFragment |
An internal fragment containing a list of row headers.
Nested classes | |
---|---|
interface |
HeadersSupportFragment.OnHeaderClickedListener
Interface definition for a callback to be invoked when a header item is clicked. |
interface |
HeadersSupportFragment.OnHeaderViewSelectedListener
Interface definition for a callback to be invoked when a header item is selected. |
Public constructors | |
---|---|
HeadersSupportFragment()
|
Public methods | |
---|---|
final
ObjectAdapter
|
getAdapter()
Returns the list of rows. |
final
PresenterSelector
|
getPresenterSelector()
Get the presenter selector used to create and bind views. |
int
|
getSelectedPosition()
Gets position of currently selected row. |
boolean
|
isScrolling()
|
View
|
onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Called to have the fragment instantiate its user interface view. |
void
|
onDestroyView()
Called when the view previously created by |
void
|
onSaveInstanceState(Bundle outState)
Called to ask the fragment to save its current dynamic state, so it can later be reconstructed in a new instance of its process is restarted. |
void
|
onTransitionEnd()
|
boolean
|
onTransitionPrepare()
|
void
|
onTransitionStart()
|
void
|
onViewCreated(View view, Bundle savedInstanceState)
Called immediately after |
final
void
|
setAdapter(ObjectAdapter rowsAdapter)
Sets the adapter for the fragment. |
void
|
setAlignment(int windowAlignOffsetTop)
|
void
|
setOnHeaderClickedListener(HeadersSupportFragment.OnHeaderClickedListener listener)
|
void
|
setOnHeaderViewSelectedListener(HeadersSupportFragment.OnHeaderViewSelectedListener listener)
|
final
void
|
setPresenterSelector(PresenterSelector presenterSelector)
Set the presenter selector used to create and bind views. |
void
|
setSelectedPosition(int position)
Sets the selected row position with smooth animation. |
void
|
setSelectedPosition(int position, boolean smooth)
Sets the selected row position. |
Inherited methods | |
---|---|
From
class
android.support.v4.app.Fragment
| |
From
class
java.lang.Object
| |
From
interface
android.content.ComponentCallbacks
| |
From
interface
android.view.View.OnCreateContextMenuListener
|
HeadersSupportFragment ()
PresenterSelector getPresenterSelector ()
Get the presenter selector used to create and bind views.
Returns | |
---|---|
PresenterSelector |
int getSelectedPosition ()
Gets position of currently selected row.
Returns | |
---|---|
int |
Position of currently selected row. |
boolean isScrolling ()
Returns | |
---|---|
boolean |
View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Called to have the fragment instantiate its user interface view.
This is optional, and non-graphical fragments can return null (which
is the default implementation). This will be called between
onCreate(Bundle)
and onActivityCreated(Bundle)
.
If you return a View from here, you will later be called in
onDestroyView()
when the view is being released.
Parameters | |
---|---|
inflater |
LayoutInflater :
The LayoutInflater object that can be used to inflate
any views in the fragment, |
container |
ViewGroup :
If non-null, this is the parent view that the fragment's
UI should be attached to. The fragment should not add the view itself,
but this can be used to generate the LayoutParams of the view. |
savedInstanceState |
Bundle :
If non-null, this fragment is being re-constructed
from a previous saved state as given here. |
Returns | |
---|---|
View |
Return the View for the fragment's UI, or null. |
void onDestroyView ()
Called when the view previously created by onCreateView(LayoutInflater, ViewGroup, Bundle)
has
been detached from the fragment. The next time the fragment needs
to be displayed, a new view will be created. This is called
after onStop()
and before onDestroy()
. It is called
regardless of whether onCreateView(LayoutInflater, ViewGroup, Bundle)
returned a
non-null view. Internally it is called after the view's state has
been saved but before it has been removed from its parent.
void onSaveInstanceState (Bundle outState)
Called to ask the fragment to save its current dynamic state, so it
can later be reconstructed in a new instance of its process is
restarted. If a new instance of the fragment later needs to be
created, the data you place in the Bundle here will be available
in the Bundle given to onCreate(Bundle)
,
onCreateView(LayoutInflater, ViewGroup, Bundle)
, and
onActivityCreated(Bundle)
.
This corresponds to Activity.onSaveInstanceState(Bundle)
and most of the discussion there
applies here as well. Note however: this method may be called
at any time before onDestroy()
. There are many situations
where a fragment may be mostly torn down (such as when placed on the
back stack with no UI showing), but its state will not be saved until
its owning activity actually needs to save its state.
Parameters | |
---|---|
outState |
Bundle :
Bundle in which to place your saved state.
|
void onTransitionEnd ()
boolean onTransitionPrepare ()
Returns | |
---|---|
boolean |
void onTransitionStart ()
void onViewCreated (View view, Bundle savedInstanceState)
Called immediately after onCreateView(LayoutInflater, ViewGroup, Bundle)
has returned, but before any saved state has been restored in to the view.
This gives subclasses a chance to initialize themselves once
they know their view hierarchy has been completely created. The fragment's
view hierarchy is not however attached to its parent at this point.
Parameters | |
---|---|
view |
View :
The View returned by onCreateView(LayoutInflater, ViewGroup, Bundle) . |
savedInstanceState |
Bundle :
If non-null, this fragment is being re-constructed
from a previous saved state as given here.
|
void setAdapter (ObjectAdapter rowsAdapter)
Sets the adapter for the fragment.
Parameters | |
---|---|
rowsAdapter |
ObjectAdapter
|
void setAlignment (int windowAlignOffsetTop)
Parameters | |
---|---|
windowAlignOffsetTop |
int
|
void setOnHeaderClickedListener (HeadersSupportFragment.OnHeaderClickedListener listener)
Parameters | |
---|---|
listener |
HeadersSupportFragment.OnHeaderClickedListener
|
void setOnHeaderViewSelectedListener (HeadersSupportFragment.OnHeaderViewSelectedListener listener)
Parameters | |
---|---|
listener |
HeadersSupportFragment.OnHeaderViewSelectedListener
|
void setPresenterSelector (PresenterSelector presenterSelector)
Set the presenter selector used to create and bind views.
Parameters | |
---|---|
presenterSelector |
PresenterSelector
|
void setSelectedPosition (int position)
Sets the selected row position with smooth animation.
Parameters | |
---|---|
position |
int
|
void setSelectedPosition (int position, boolean smooth)
Sets the selected row position.
Parameters | |
---|---|
position |
int
|
smooth |
boolean
|