Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
Android 0.0.0 Developer Preview
belongs to Maven artifact androidx.leanback:leanback:1.1.0-alpha01
Deprecated since version 0.0.0

VerticalGridFragment

public class VerticalGridFragment
extends BaseFragment

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


This class was deprecated in API level 0.0.0.
use VerticalGridSupportFragment

A fragment for creating leanback vertical grids.

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

Summary

Inherited constants

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

Public constructors

VerticalGridFragment

public VerticalGridFragment ()

Public methods

getAdapter

public ObjectAdapter getAdapter ()

Returns the object adapter.

Returns
ObjectAdapter

getGridPresenter

public VerticalGridPresenter getGridPresenter ()

Returns the grid presenter.

Returns
VerticalGridPresenter

getOnItemViewClickedListener

public OnItemViewClickedListener getOnItemViewClickedListener ()

Returns the item clicked listener.

Returns
OnItemViewClickedListener

onCreateView

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

Parameters
inflater LayoutInflater

container ViewGroup

savedInstanceState Bundle

Returns
View

onDestroyView

public void onDestroyView ()

onStart

public void onStart ()

setAdapter

public void setAdapter (ObjectAdapter adapter)

Sets the object adapter for the fragment.

Parameters
adapter ObjectAdapter

setGridPresenter

public void setGridPresenter (VerticalGridPresenter gridPresenter)

Sets the grid presenter.

Parameters
gridPresenter VerticalGridPresenter

setOnItemViewClickedListener

public void setOnItemViewClickedListener (OnItemViewClickedListener listener)

Sets an item clicked listener.

Parameters
listener OnItemViewClickedListener

setOnItemViewSelectedListener

public void setOnItemViewSelectedListener (OnItemViewSelectedListener listener)

Sets an item selection listener.

Parameters
listener OnItemViewSelectedListener

setSelectedPosition

public void setSelectedPosition (int position)

Sets the selected item position.

Parameters
position int

Protected methods

createEntranceTransition

protected 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

protected 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