BrowseFragment

public class BrowseFragment
extends BaseFragment

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


This class is deprecated.
use BrowseSupportFragment

A fragment for creating Leanback browse screens. It is composed of a RowsFragment and a HeadersFragment.

A BrowseFragment renders the elements of its ObjectAdapter as a set of rows in a vertical list. The elements in this adapter must be subclasses of Row.

The HeadersFragment can be set to be either shown or hidden by default, or may be disabled entirely. See setHeadersState(int) for details.

By default the BrowseFragment includes support for returning to the headers when the user presses Back. For Activities that customize Activity.onBackPressed(), you must disable this default Back key support by calling setHeadersTransitionOnBackEnabled(boolean) with false and use BrowseFragment.BrowseTransitionListener and startHeadersTransition(boolean).

The recommended theme to use with a BrowseFragment is R.style.Theme_Leanback_Browse.

Summary

Nested classes

class BrowseFragment.BrowseTransitionListener

This class is deprecated. use BrowseSupportFragment  

class BrowseFragment.FragmentFactory<T extends Fragment>

This class is deprecated. use BrowseSupportFragment  

interface BrowseFragment.FragmentHost

This interface is deprecated. use BrowseSupportFragment  

class BrowseFragment.ListRowFragmentFactory

This class is deprecated. use BrowseSupportFragment  

class BrowseFragment.MainFragmentAdapter<T extends Fragment>

This class is deprecated. use BrowseSupportFragment  

interface BrowseFragment.MainFragmentAdapterProvider

This interface is deprecated. use BrowseSupportFragment  

class BrowseFragment.MainFragmentAdapterRegistry

This class is deprecated. use BrowseSupportFragment  

class BrowseFragment.MainFragmentRowsAdapter<T extends Fragment>

This class is deprecated. use BrowseSupportFragment  

interface BrowseFragment.MainFragmentRowsAdapterProvider

This interface is deprecated. use BrowseSupportFragment  

Constants

int HEADERS_DISABLED

The headers fragment is disabled and will never be shown.

int HEADERS_ENABLED

The headers fragment is enabled and shown by default.

int HEADERS_HIDDEN

The headers fragment is enabled and hidden by default.

Inherited constants

Public constructors

BrowseFragment()

Public methods

static Bundle createArgs(Bundle args, String title, int headersState)

Creates arguments for a browse fragment.

void enableMainFragmentScaling(boolean enable)

Enables scaling of main fragment when headers are present.

void enableRowScaling(boolean enable)

This method is deprecated. use enableMainFragmentScaling(boolean) instead.

ObjectAdapter getAdapter()

Returns the adapter containing the rows for the fragment.

int getBrandColor()

Returns the brand color for the browse fragment.

HeadersFragment getHeadersFragment()

Get currently bound HeadersFragment or null if HeadersFragment has not been created yet.

int getHeadersState()

Returns the state of the headers column in the browse fragment.

Fragment getMainFragment()
final