BrowseSupportFragment
open class BrowseSupportFragment : BaseSupportFragment
kotlin.Any | ||||
↳ | androidx.fragment.app.Fragment | |||
↳ | androidx.leanback.app.BrandedSupportFragment | |||
↳ | androidx.leanback.app.BaseSupportFragment | |||
↳ | androidx.leanback.app.BrowseSupportFragment |
A fragment for creating Leanback browse screens. It is composed of a RowsSupportFragment and a HeadersSupportFragment.
A BrowseSupportFragment 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 HeadersSupportFragment can be set to be either shown or hidden by default, or may be disabled entirely. See setHeadersState
for details.
By default the BrowseSupportFragment 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 BrowseSupportFragment.BrowseTransitionListener
and startHeadersTransition(boolean)
.
The recommended theme to use with a BrowseSupportFragment 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 Int |
Returns the state of the headers column in the browse fragment. |
open HeadersSupportFragment! |
Get currently bound HeadersSupportFragment or null if HeadersSupportFragment has not been created yet. |
open Fragment! | |
BrowseSupportFragment.MainFragmentAdapterRegistry! | |
open OnItemViewClickedListener! |
Returns the item Clicked listener. |
open OnItemViewSelectedListener! |
Returns an item selection listener. |
open RowsSupportFragment! |
Get RowsSupportFragment if it's bound to BrowseSupportFragment or null if either BrowseSupportFragment 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 HeadersSupportFragment! |
Creates a new |
open View? |
onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?) |
open Unit | |
open Unit | |
open Unit |
onSaveInstanceState(outState: |