public class DetailsFragment
extends BaseFragment


This class is deprecated.
use DetailsSupportFragment

A fragment for creating Leanback details screens.

A DetailsFragment renders the elements of its ObjectAdapter as a set of rows in a vertical list.The Adapter's PresenterSelector must maintain subclasses of RowPresenter.

When FullWidthDetailsOverviewRowPresenter is found in adapter, DetailsFragment will setup default behavior of the DetailsOverviewRow:

The recommended activity themes to use with a DetailsFragment are

DetailsFragment can use DetailsFragmentBackgroundController to add a parallax drawable background and embedded video playing fragment.


Inherited constants

Public constructors


Public methods

ObjectAdapter getAdapter()

Returns the list of rows.

BaseOnItemViewClickedListener getOnItemViewClickedListener()

Returns the item clicked listener.

DetailsParallax getParallax()

Returns the DetailsParallax instance used by DetailsFragmentBackgroundController to configure parallax effect of background and control embedded video playback.

RowsFragment getRowsFragment()

Gets embedded RowsFragment showing multiple rows for DetailsFragment.

void onCreate(Bundle savedInstanceState)
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void onDestroyView()
View onInflateTitleView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState)

Called by installTitleView(LayoutInflater, ViewGroup, Bundle) to inflate title view.

void onStart()
void onStop()
void setAdapter(ObjectAdapter adapter)

Sets the list of rows for the fragment.

void setOnItemViewClickedListener(BaseOnItemViewClickedListener listener)

Sets an item clicked listener.

void setOnItemViewSelectedListener(BaseOnItemViewSelectedListener listener)

Sets an item selection listener.

void setSelectedPosition(int position)

Sets the selected row position with smooth animation.

void setSelectedPosition(int position, boolean smooth)

Sets the selected row position.

Protected methods

Object createEntranceTransition()

Create entrance transition.

View inflateTitle(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState)

This method is deprecated. override onInflateTitleView(LayoutInflater, ViewGroup, Bundle) instead.

void onEntranceTransitionEnd()

Callback when entrance transition is ended.

void onEntranceTransitionPrepare()

Callback when entrance transition is prepared.