DetailsSupportFragment

public class DetailsSupportFragment
extends BaseSupportFragment

java.lang.Object
   ↳ androidx.fragment.app.Fragment
     ↳ androidx.leanback.app.BrandedSupportFragment
       ↳ androidx.leanback.app.BaseSupportFragment
         ↳ androidx.leanback.app.DetailsSupportFragment


A fragment for creating Leanback details screens.

A DetailsSupportFragment 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, DetailsSupportFragment will setup default behavior of the DetailsOverviewRow:

The recommended activity themes to use with a DetailsSupportFragment are

DetailsSupportFragment can use DetailsSupportFragmentBackgroundController to add a parallax drawable background and embedded video playing fragment.

Summary

Public constructors

DetailsSupportFragment()

Public methods

ObjectAdapter getAdapter()

Returns the list of rows.

BaseOnItemViewClickedListener getOnItemViewClickedListener()

Returns the item clicked listener.

DetailsParallax getParallax()

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

RowsSupportFragment getRowsSupportFragment()

Gets embedded RowsSupportFragment showing multiple rows for DetailsSupportFragment.

void onCreate(Bundle savedInstanceState)

Called to do initial creation of a fragment.

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 onCreateView(LayoutInflater, ViewGroup, Bundle) has been detached from the fragment.

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

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

void onStart()

Called when the Fragment is visible to the user.

void onStop()

Called when the Fragment is no longer started.

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.

void onEntranceTransitionStart()

Callback when entrance transition is started.

void onSetDetailsOverviewRowStatus(FullWidthDetailsOverviewRowPresenter presenter, FullWidthDetailsOverviewRowPresenter.ViewHolder viewHolder, int adapterPosition, int selectedPosition, int selectedSubPosition)

Called to change DetailsOverviewRow view status when current selected row position or selected sub position changed.

void onSetRowStatus(RowPresenter presenter, RowPresenter.ViewHolder viewHolder, int adapterPosition, int selectedPosition, int selectedSubPosition)

Called on every visible row to change view status when current selected row position or selected sub position changed.

void runEntranceTransition(Object entranceTransition)

Run entrance transition.

void setupDetailsOverviewRowPresenter(FullWidthDetailsOverviewRowPresenter presenter)

Called to setup FullWidthDetailsOverviewRowPresenter.

void setupPresenter(Presenter rowPresenter)

Called to setup each Presenter of Adapter passed in setAdapter(ObjectAdapter).Note that setup should only change the Presenter behavior that is meaningful in DetailsSupportFragment.

Inherited methods