added in version 22.1.0
belongs to Maven artifact
Deprecated since version 27.1.0


public class DetailsFragment
extends BaseFragment


This class was deprecated in API level 27.1.0.
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 alignment of FullWidthDetailsOverviewRowPresenter is setup in setupDetailsOverviewRowPresenter(FullWidthDetailsOverviewRowPresenter).
  • The view status switching of FullWidthDetailsOverviewRowPresenter is done in onSetDetailsOverviewRowStatus(FullWidthDetailsOverviewRowPresenter, FullWidthDetailsOverviewRowPresenter.ViewHolder, int, int, int).
  • The recommended activity themes to use with a DetailsFragment are

  • Theme_Leanback_Details with activity shared element transition for FullWidthDetailsOverviewRowPresenter.
  • Theme_Leanback_Details_NoSharedElementTransition if shared element transition is not needed, for example if first row is not rendered by FullWidthDetailsOverviewRowPresenter.
  • DetailsFragment can use DetailsFragmentBackgroundController to add a parallax drawable background and embedded video playing fragment.


    Inherited constants

    From interface android.content.ComponentCallbacks2

    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)