DetailsFragment

Added in 1.1.0
Deprecated in 1.1.0

class DetailsFragment : BaseFragment


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 recommended activity themes to use with a DetailsFragment are

DetailsFragment can use DetailsFragmentBackgroundController to add a parallax drawable background and embedded video playing fragment.

Summary

Public constructors

This function is deprecated. Deprecated in Java

Public functions

ObjectAdapter!

This function is deprecated. Deprecated in Java

BaseOnItemViewClickedListener!

This function is deprecated. Deprecated in Java

DetailsParallax!

This function is deprecated. Deprecated in Java

RowsFragment!

This function is deprecated. Deprecated in Java

Unit
onCreate(savedInstanceState: Bundle!)

This function is deprecated.

View?
onCreateView(
    inflater: LayoutInflater!,
    container: ViewGroup?,
    savedInstanceState: Bundle!
)

This function is deprecated.

Unit

This function is deprecated.

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

This function is deprecated. Deprecated in Java

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
setSelectedPosition(position: Int, smooth: Boolean)

This function is deprecated. Deprecated in Java

Protected functions

Any!

This function is deprecated. Deprecated in Java

View!
inflateTitle(
    inflater: LayoutInflater!,
    parent: ViewGroup!,
    savedInstanceState: Bundle!
)

This function is deprecated.

override onInflateTitleView instead.

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
onSetDetailsOverviewRowStatus(
    presenter: FullWidthDetailsOverviewRowPresenter!,
    viewHolder: FullWidthDetailsOverviewRowPresenter.ViewHolder!,
    adapterPosition: Int,
    selectedPosition: Int,
    selectedSubPosition: Int
)

This function is deprecated. Deprecated in Java

Unit
onSetRowStatus(
    presenter: RowPresenter!,
    viewHolder: RowPresenter.ViewHolder!,
    adapterPosition: Int,
    selectedPosition: Int,
    selectedSubPosition: Int
)

This function is deprecated. Deprecated in Java

Unit
runEntranceTransition(entranceTransition: Any!)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
setupPresenter(rowPresenter: Presenter!)

This function is deprecated. Deprecated in Java

Inherited Constants

From android.content.ComponentCallbacks2
const Int

This property is deprecated. Deprecated in Java

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated. Deprecated in Java

Inherited functions

From androidx.leanback.app.BaseFragment
ProgressBarManager!

This function is deprecated. Deprecated in Java

Unit
onViewCreated(view: View, savedInstanceState: Bundle?)

This function is deprecated.

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

From androidx.leanback.app.BrandedFragment
Drawable?

This function is deprecated. Deprecated in Java

Int

This function is deprecated. Deprecated in Java

SearchOrbView.Colors?

This function is deprecated. Deprecated in Java

CharSequence?

This function is deprecated. Deprecated in Java

View?

This function is deprecated. Deprecated in Java

TitleViewAdapter?

This function is deprecated. Deprecated in Java

Unit
installTitleView(
    inflater: LayoutInflater,
    parent: ViewGroup,
    savedInstanceState: Bundle?
)

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
setTitleView(titleView: View?)

This function is deprecated. Deprecated in Java

Unit
showTitle(flags: Int)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

From android.app.Fragment
Unit
dump(
    prefix: String!,
    fd: FileDescriptor!,
    writer: PrintWriter!,
    args: Array<String!>!
)

This function is deprecated.

Boolean
equals(o: Any!)

This function is deprecated.

Activity!

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Bundle!

This function is deprecated.

FragmentManager!

This function is deprecated.

Context!

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

FragmentManager!

This function is deprecated.

Any!

This function is deprecated.

Int

This function is deprecated.

LayoutInflater!

This function is deprecated.

LoaderManager!

This function is deprecated.

Fragment!

This function is deprecated.

Transition!

This function is deprecated.

Resources!

This function is deprecated.

Boolean

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

String!
getString(resId: Int)

This function is deprecated.

String!

This function is deprecated.

Fragment!

This function is deprecated.

Int

This function is deprecated.

CharSequence!
getText(resId: Int)

This function is deprecated.

Boolean

This function is deprecated.

View!

This function is deprecated.

Int

This function is deprecated.

java-static Fragment!
instantiate(context: Context!, fname: String!)

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Unit
onActivityCreated(savedInstanceState: Bundle!)

This function is deprecated.

Unit
onActivityResult(requestCode: Int, resultCode: Int, data: Intent!)

This function is deprecated.

Unit
onAttach(activity: Activity!)

This function is deprecated.

Unit
onAttachFragment(childFragment: Fragment!)

This function is deprecated.

Unit

This function is deprecated.

Boolean

This function is deprecated.

Unit
onCreate(savedInstanceState: Bundle!)

This function is deprecated.

Animator!
onCreateAnimator(transit: Int, enter: Boolean, nextAnim: Int)

This function is deprecated.

Unit
onCreateContextMenu(
    menu: ContextMenu!,
    v: View!,
    menuInfo: ContextMenu.ContextMenuInfo!
)

This function is deprecated.

Unit
onCreateOptionsMenu(menu: Menu!, inflater: MenuInflater!)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

LayoutInflater!
onGetLayoutInflater(savedInstanceState: Bundle!)

This function is deprecated.

Unit

This function is deprecated.

Unit
onInflate(
    activity: Activity!,
    attrs: AttributeSet!,
    savedInstanceState: Bundle!
)

This function is deprecated.

Unit

This function is deprecated.

Unit
onMultiWindowModeChanged(isInMultiWindowMode: Boolean)

This function is deprecated.

Boolean

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean)

This function is deprecated.

Unit

This function is deprecated.

Unit
onRequestPermissionsResult(
    requestCode: Int,
    permissions: Array<String!>!,
    grantResults: IntArray<Int>!
)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
onTrimMemory(level: Int)

This function is deprecated.

Unit
onViewCreated(view: View!, savedInstanceState: Bundle!)

This function is deprecated.

Unit
onViewStateRestored(savedInstanceState: Bundle!)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
requestPermissions(permissions: Array<String!>!, requestCode: Int)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
setMenuVisibility(menuVisible: Boolean)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
setTargetFragment(fragment: Fragment!, requestCode: Int)

This function is deprecated.

Unit
setUserVisibleHint(isVisibleToUser: Boolean)

This function is deprecated.

Boolean

This function is deprecated.

Unit

This function is deprecated.

Unit
startActivityForResult(intent: Intent!, requestCode: Int)

This function is deprecated.

Unit
startIntentSenderForResult(
    intent: IntentSender!,
    requestCode: Int,
    fillInIntent: Intent!,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int,
    options: Bundle!
)

This function is deprecated.

Unit

This function is deprecated.

String!

This function is deprecated.

Unit

This function is deprecated.

Public constructors

DetailsFragment

Added in 1.1.0
Deprecated in 1.1.0
DetailsFragment()

Public functions

getAdapter

Added in 1.1.0
Deprecated in 1.1.0
fun getAdapter(): ObjectAdapter!

Returns the list of rows.

getOnItemViewClickedListener

Added in 1.1.0
Deprecated in 1.1.0
fun getOnItemViewClickedListener(): BaseOnItemViewClickedListener!

Returns the item clicked listener.

getParallax

Added in 1.1.0
Deprecated in 1.1.0
fun getParallax(): DetailsParallax!

Returns the DetailsParallax instance used by DetailsFragmentBackgroundController to configure parallax effect of background and control embedded video playback. App usually does not use this method directly. App may use this method for other custom parallax tasks.

Returns
DetailsParallax!

The DetailsParallax instance attached to the DetailsFragment.

getRowsFragment

Added in 1.1.0
Deprecated in 1.1.0
fun getRowsFragment(): RowsFragment!

Gets embedded RowsFragment showing multiple rows for DetailsFragment. If view of DetailsFragment is not created, the method returns null.

Returns
RowsFragment!

Embedded RowsFragment showing multiple rows for DetailsFragment.

onCreate

fun onCreate(savedInstanceState: Bundle!): Unit

onCreateView

Added in 1.1.0
Deprecated in 1.1.0
fun onCreateView(
    inflater: LayoutInflater!,
    container: ViewGroup?,
    savedInstanceState: Bundle!
): View?

onDestroyView

fun onDestroyView(): Unit

onInflateTitleView

fun onInflateTitleView(
    inflater: LayoutInflater,
    parent: ViewGroup?,
    savedInstanceState: Bundle?
): View

Called by installTitleView to inflate title view. Default implementation uses layout file lb_browse_title. Subclass may override and use its own layout, the layout must have a descendant with id browse_title_group that implements TitleViewAdapter.Provider. Subclass may return null if no title is needed.

Parameters
inflater: LayoutInflater

The LayoutInflater object that can be used to inflate any views in the fragment,

parent: ViewGroup?

Parent of title view.

savedInstanceState: Bundle?

If non-null, this fragment is being re-constructed from a previous saved state as given here.

Returns
View

Title view which must have a descendant with id browse_title_group that implements TitleViewAdapter.Provider, or null for no title view.

onStart

fun onStart(): Unit

onStop

Added in 1.1.0
Deprecated in 1.1.0
fun onStop(): Unit

setAdapter

Added in 1.1.0
Deprecated in 1.1.0
fun setAdapter(adapter: ObjectAdapter!): Unit

Sets the list of rows for the fragment.

setOnItemViewClickedListener

Added in 1.1.0
Deprecated in 1.1.0
fun setOnItemViewClickedListener(listener: BaseOnItemViewClickedListener!): Unit

Sets an item clicked listener.

setOnItemViewSelectedListener

Added in 1.1.0
Deprecated in 1.1.0
fun setOnItemViewSelectedListener(listener: BaseOnItemViewSelectedListener!): Unit

Sets an item selection listener.

setSelectedPosition

Added in 1.1.0
Deprecated in 1.1.0
fun setSelectedPosition(position: Int): Unit

Sets the selected row position with smooth animation.

setSelectedPosition

Added in 1.1.0
Deprecated in 1.1.0
fun setSelectedPosition(position: Int, smooth: Boolean): Unit

Sets the selected row position.

Protected functions

createEntranceTransition

protected fun createEntranceTransition(): Any!

Create entrance transition. Subclass can override to load transition from resource or construct manually. Typically app does not need to override the default transition that browse and details provides.

inflateTitle

Added in 1.1.0
Deprecated in 1.1.0
protected fun inflateTitle(
    inflater: LayoutInflater!,
    parent: ViewGroup!,
    savedInstanceState: Bundle!
): View!

onEntranceTransitionEnd

protected fun onEntranceTransitionEnd(): Unit

Callback when entrance transition is ended.

onEntranceTransitionPrepare

protected fun onEntranceTransitionPrepare(): Unit

Callback when entrance transition is prepared. This is when fragment should stop user input and animations.

onEntranceTransitionStart

protected fun onEntranceTransitionStart(): Unit

Callback when entrance transition is started. This is when fragment should stop processing layout.

onSetDetailsOverviewRowStatus

Added in 1.1.0
Deprecated in 1.1.0
protected fun onSetDetailsOverviewRowStatus(
    presenter: FullWidthDetailsOverviewRowPresenter!,
    viewHolder: FullWidthDetailsOverviewRowPresenter.ViewHolder!,
    adapterPosition: Int,
    selectedPosition: Int,
    selectedSubPosition: Int
): Unit

Called to change DetailsOverviewRow view status when current selected row position or selected sub position changed. Subclass may override. The default implementation switches between three states based on the positions: STATE_HALF, STATE_FULL and STATE_SMALL.

Parameters
presenter: FullWidthDetailsOverviewRowPresenter!

The presenter used to create row ViewHolder.

viewHolder: FullWidthDetailsOverviewRowPresenter.ViewHolder!

The visible (attached) row ViewHolder, note that it may or may not be selected.

adapterPosition: Int

The adapter position of viewHolder inside adapter.

selectedPosition: Int

The adapter position of currently selected row.

selectedSubPosition: Int

The sub position within currently selected row. This is used When a row has multiple alignment positions.

onSetRowStatus

Added in 1.1.0
Deprecated in 1.1.0
protected fun onSetRowStatus(
    presenter: RowPresenter!,
    viewHolder: RowPresenter.ViewHolder!,
    adapterPosition: Int,
    selectedPosition: Int,
    selectedSubPosition: Int
): Unit

Called on every visible row to change view status when current selected row position or selected sub position changed. Subclass may override. The default implementation calls onSetDetailsOverviewRowStatus if presenter is instance of FullWidthDetailsOverviewRowPresenter.

Parameters
presenter: RowPresenter!

The presenter used to create row ViewHolder.

viewHolder: RowPresenter.ViewHolder!

The visible (attached) row ViewHolder, note that it may or may not be selected.

adapterPosition: Int

The adapter position of viewHolder inside adapter.

selectedPosition: Int

The adapter position of currently selected row.

selectedSubPosition: Int

The sub position within currently selected row. This is used When a row has multiple alignment positions.

runEntranceTransition

protected fun runEntranceTransition(entranceTransition: Any!): Unit

Run entrance transition. Subclass may use TransitionManager to perform go(Scene) or beginDelayedTransition(). App should not override the default implementation of browse and details fragment.

setupDetailsOverviewRowPresenter

Added in 1.1.0
Deprecated in 1.1.0
protected fun setupDetailsOverviewRowPresenter(
    presenter: FullWidthDetailsOverviewRowPresenter!
): Unit

Called to setup FullWidthDetailsOverviewRowPresenter. The default implementation adds two alignment positions(ItemAlignmentFacet) for ViewHolder of FullWidthDetailsOverviewRowPresenter to align in fragment.

setupPresenter

Added in 1.1.0
Deprecated in 1.1.0
protected fun setupPresenter(rowPresenter: Presenter!): Unit

Called to setup each Presenter of Adapter passed in setAdapter.Note that setup should only change the Presenter behavior that is meaningful in DetailsFragment. For example how a row is aligned in details Fragment. The default implementation invokes setupDetailsOverviewRowPresenter