belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
VerticalGridSupportFragment
public
class
VerticalGridSupportFragment
extends BaseSupportFragment
java.lang.Object | ||||
↳ | android.support.v4.app.Fragment | |||
↳ | android.support.v17.leanback.app.BrandedSupportFragment | |||
↳ | android.support.v17.leanback.app.BaseSupportFragment | |||
↳ | android.support.v17.leanback.app.VerticalGridSupportFragment |
A fragment for creating leanback vertical grids.
Renders a vertical grid of objects given a VerticalGridPresenter
and
an ObjectAdapter
.
Summary
Public constructors | |
---|---|
VerticalGridSupportFragment()
|
Public methods | |
---|---|
ObjectAdapter
|
getAdapter()
Returns the object adapter. |
VerticalGridPresenter
|
getGridPresenter()
Returns the grid presenter. |
OnItemViewClickedListener
|
getOnItemViewClickedListener()
Returns the item clicked listener. |
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
|
onStart()
Called when the Fragment is visible to the user. |
void
|
setAdapter(ObjectAdapter adapter)
Sets the object adapter for the fragment. |
void
|
setGridPresenter(VerticalGridPresenter gridPresenter)
Sets the grid presenter. |
void
|
setOnItemViewClickedListener(OnItemViewClickedListener listener)
Sets an item clicked listener. |
void
|
setOnItemViewSelectedListener(OnItemViewSelectedListener listener)
Sets an item selection listener. |
void
|
setSelectedPosition(int position)
Sets the selected item position. |
Protected methods | |
---|---|
Object
|
createEntranceTransition()
Create entrance transition. |
void
|
runEntranceTransition(Object entranceTransition)
Run entrance transition. |
Inherited methods | |
---|---|
From
class
android.support.v17.leanback.app.BaseSupportFragment
| |
From
class
android.support.v17.leanback.app.BrandedSupportFragment
| |
From
class
android.support.v4.app.Fragment
| |
From
class
java.lang.Object
| |
From
interface
android.content.ComponentCallbacks
| |
From
interface
android.view.View.OnCreateContextMenuListener
| |
From
interface
android.arch.lifecycle.LifecycleOwner
| |
From
interface
android.arch.lifecycle.ViewModelStoreOwner
|
Public constructors
Public methods
getAdapter
ObjectAdapter getAdapter ()
Returns the object adapter.
Returns | |
---|---|
ObjectAdapter |
getGridPresenter
VerticalGridPresenter getGridPresenter ()
Returns the grid presenter.
Returns | |
---|---|
VerticalGridPresenter |
getOnItemViewClickedListener
OnItemViewClickedListener getOnItemViewClickedListener ()
Returns the item clicked listener.
Returns | |
---|---|
OnItemViewClickedListener |
onCreateView
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. |
onDestroyView
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.
onStart
void onStart ()
Called when the Fragment is visible to the user. This is generally
tied to Activity.onStart
of the containing
Activity's lifecycle.
setAdapter
void setAdapter (ObjectAdapter adapter)
Sets the object adapter for the fragment.
Parameters | |
---|---|
adapter |
ObjectAdapter |
setGridPresenter
void setGridPresenter (VerticalGridPresenter gridPresenter)
Sets the grid presenter.
Parameters | |
---|---|
gridPresenter |
VerticalGridPresenter |
setOnItemViewClickedListener
void setOnItemViewClickedListener (OnItemViewClickedListener listener)
Sets an item clicked listener.
Parameters | |
---|---|
listener |
OnItemViewClickedListener |
setOnItemViewSelectedListener
void setOnItemViewSelectedListener (OnItemViewSelectedListener listener)
Sets an item selection listener.
Parameters | |
---|---|
listener |
OnItemViewSelectedListener |
setSelectedPosition
void setSelectedPosition (int position)
Sets the selected item position.
Parameters | |
---|---|
position |
int |
Protected methods
createEntranceTransition
Object createEntranceTransition ()
Create entrance transition. Subclass can override to load transition from resource or construct manually. Typically app does not need to override the default transition that browse and details provides.
Returns | |
---|---|
Object |
runEntranceTransition
void runEntranceTransition (Object entranceTransition)
Run entrance transition. Subclass may use TransitionManager to perform go(Scene) or beginDelayedTransition(). App should not override the default implementation of browse and details fragment.
Parameters | |
---|---|
entranceTransition |
Object |
Interfaces
- BrowseFragment.FragmentHost
- BrowseFragment.MainFragmentAdapterProvider
- BrowseFragment.MainFragmentRowsAdapterProvider
- BrowseSupportFragment.FragmentHost
- BrowseSupportFragment.MainFragmentAdapterProvider
- BrowseSupportFragment.MainFragmentRowsAdapterProvider
- HeadersFragment.OnHeaderClickedListener
- HeadersFragment.OnHeaderViewSelectedListener
- HeadersSupportFragment.OnHeaderClickedListener
- HeadersSupportFragment.OnHeaderViewSelectedListener
- SearchFragment.SearchResultProvider
- SearchSupportFragment.SearchResultProvider
Classes
- BackgroundManager
- BaseFragment
- BaseSupportFragment
- BrandedFragment
- BrandedSupportFragment
- BrowseFragment
- BrowseFragment.BrowseTransitionListener
- BrowseFragment.FragmentFactory
- BrowseFragment.ListRowFragmentFactory
- BrowseFragment.MainFragmentAdapter
- BrowseFragment.MainFragmentAdapterRegistry
- BrowseFragment.MainFragmentRowsAdapter
- BrowseSupportFragment
- BrowseSupportFragment.BrowseTransitionListener
- BrowseSupportFragment.FragmentFactory
- BrowseSupportFragment.ListRowFragmentFactory
- BrowseSupportFragment.MainFragmentAdapter
- BrowseSupportFragment.MainFragmentAdapterRegistry
- BrowseSupportFragment.MainFragmentRowsAdapter
- DetailsFragment
- DetailsFragmentBackgroundController
- DetailsSupportFragment
- DetailsSupportFragmentBackgroundController
- ErrorFragment
- ErrorSupportFragment
- GuidedStepFragment
- GuidedStepSupportFragment
- HeadersFragment
- HeadersSupportFragment
- OnboardingFragment
- OnboardingSupportFragment
- PlaybackFragment
- PlaybackFragmentGlueHost
- PlaybackSupportFragment
- PlaybackSupportFragmentGlueHost
- ProgressBarManager
- RowsFragment
- RowsFragment.MainFragmentAdapter
- RowsFragment.MainFragmentRowsAdapter
- RowsSupportFragment
- RowsSupportFragment.MainFragmentAdapter
- RowsSupportFragment.MainFragmentRowsAdapter
- SearchFragment
- SearchSupportFragment
- VerticalGridFragment
- VerticalGridSupportFragment
- VideoFragment
- VideoFragmentGlueHost
- VideoSupportFragment
- VideoSupportFragmentGlueHost