Skip to content

Most visited

Recently visited

navigation
added in version 22.1.0
belongs to Maven artifact com.android.support:leanback-v17:27.0.0

VerticalGridFragment

public class VerticalGridFragment
extends BaseFragment

java.lang.Object
   ↳ android.app.Fragment
     ↳ android.support.v17.leanback.app.BrandedFragment
       ↳ android.support.v17.leanback.app.BaseFragment
         ↳ android.support.v17.leanback.app.VerticalGridFragment


A fragment for creating leanback vertical grids.

Renders a vertical grid of objects given a VerticalGridPresenter and an ObjectAdapter.

Summary

Inherited constants

From interface android.content.ComponentCallbacks2

Public constructors

VerticalGridFragment()

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)
void onDestroyView()
void onStart()
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.BaseFragment
From class android.support.v17.leanback.app.BrandedFragment
From class android.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.view.View.OnCreateContextMenuListener
From interface android.content.ComponentCallbacks

Public constructors

VerticalGridFragment

added in version 22.1.0
VerticalGridFragment ()

Public methods

getAdapter

added in version 22.1.0
ObjectAdapter getAdapter ()

Returns the object adapter.

Returns
ObjectAdapter

getGridPresenter

added in version 22.1.0
VerticalGridPresenter getGridPresenter ()

Returns the grid presenter.

Returns
VerticalGridPresenter

getOnItemViewClickedListener

added in version 22.1.0
OnItemViewClickedListener getOnItemViewClickedListener ()

Returns the item clicked listener.

Returns
OnItemViewClickedListener

onCreateView

View onCreateView (LayoutInflater inflater, 
                ViewGroup container, 
                Bundle savedInstanceState)

Parameters
inflater LayoutInflater

container ViewGroup

savedInstanceState Bundle

Returns
View

onDestroyView

added in version 23.1.1
void onDestroyView ()

onStart

added in version 23.1.1
void onStart ()

setAdapter

added in version 22.1.0
void setAdapter (ObjectAdapter adapter)

Sets the object adapter for the fragment.

Parameters
adapter ObjectAdapter

setGridPresenter

added in version 22.1.0
void setGridPresenter (VerticalGridPresenter gridPresenter)

Sets the grid presenter.

Parameters
gridPresenter VerticalGridPresenter

setOnItemViewClickedListener

added in version 22.1.0
void setOnItemViewClickedListener (OnItemViewClickedListener listener)

Sets an item clicked listener.

Parameters
listener OnItemViewClickedListener

setOnItemViewSelectedListener

added in version 22.1.0
void setOnItemViewSelectedListener (OnItemViewSelectedListener listener)

Sets an item selection listener.

Parameters
listener OnItemViewSelectedListener

setSelectedPosition

added in version 22.1.0
void setSelectedPosition (int position)

Sets the selected item position.

Parameters
position int

Protected methods

createEntranceTransition

added in version 24.1.0
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

added in version 24.1.0
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

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)