BrowseFragment
open classBrowseFragment: BaseFragment
kotlin.Any | ||||
↳ | android.app.Fragment | |||
↳ | androidx.leanback.app.BrandedFragment | |||
↳ | androidx.leanback.app.BaseFragment | |||
↳ | androidx.leanback.app.BrowseFragment |
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
for details.
By default the BrowseFragment includes support for returning to the headers when the user presses Back. For Activities that customize
, 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 androidx.leanback.R.style#Theme_Leanback_Browse
.
Summary
Nested classes | |
---|---|
open |
Listener for transitions between browse headers and rows. |
abstract |
Factory class responsible for creating fragment given the current item. |
abstract |
Possible set of actions that |
open |
FragmentFactory implementation for |
open |
Interface that defines the interaction between |
abstract |
Interface to be implemented by all fragments for providing an instance of |
Registry class maintaining the mapping of |
|
open |
This is used to pass information to |
abstract |
Interface to be implemented by |
Constants | |
---|---|
static Int |
The headers fragment is disabled and will never be shown. |
static Int |
The headers fragment is enabled and shown by default. |
static Int |
The headers fragment is enabled and hidden by default. |
Public constructors | |
---|---|
<init>() A fragment for creating Leanback browse screens. |
Public methods | |
---|---|
open static Bundle! |
createArgs(args: Bundle!, title: String!, headersState: Int) Creates arguments for a browse fragment. |
open Unit |
enableMainFragmentScaling(enable: Boolean) Enables scaling of main fragment when headers are present. |
open Unit |
enableRowScaling(enable: Boolean) |
open ObjectAdapter! |
Returns the adapter containing the rows for the fragment. |
open Int |
Returns the brand color for the browse fragment. |
open HeadersFragment! |
Get currently bound HeadersFragment or null if HeadersFragment has not been created yet. |
open Int |
Returns the state of the headers column in the browse fragment. |
open Fragment! | |
BrowseFragment.MainFragmentAdapterRegistry! | |
open OnItemViewClickedListener! |
Returns the item Clicked listener. |
open OnItemViewSelectedListener! |
Returns an item selection listener. |
open RowsFragment! |
Get RowsFragment if it's bound to BrowseFragment or null if either BrowseFragment has not been created yet or a different fragment is bound to it. |
open Int |
Gets position of currently selected row. |
open RowPresenter.ViewHolder! | |
Boolean |
Returns true if headers transition on back key support is enabled. |
open Boolean |
Returns true if the headers transition is currently running. |
open Boolean |
Returns true if headers are shown. |
open Unit | |
open HeadersFragment! |
Creates a new |
open View? |
onCreateView(inflater: LayoutInflater!, container: ViewGroup?, savedInstanceState: Bundle!) |
open Unit | |
open Unit |