BrowseFragment.MainFragmentAdapter

Added in 1.1.0
Deprecated in 1.1.0

class BrowseFragment.MainFragmentAdapter<T : Fragment?>


Interface that defines the interaction between BrowseFragment and its main content fragment. The key method is getFragment, it will be used to get the fragment to be shown in the content section. Clients can provide any implementation of fragment and customize its interaction with BrowseFragment by overriding the necessary methods.

Clients are expected to provide an instance of MainFragmentAdapterRegistry which will be responsible for providing implementations of MainFragmentAdapter for given content types. Currently we support different types of content - ListRow, PageRow or any subtype of Row. We provide an out of the box adapter implementation for any rows other than PageRow - androidx.leanback.app.RowsFragment.MainFragmentAdapter.

PageRow is intended to give full flexibility to developers in terms of Fragment design. Users will have to provide an implementation of MainFragmentAdapter and provide that through MainFragmentAdapterRegistry. MainFragmentAdapter implementation can supply any fragment and override just those interactions that makes sense.

Summary

Public constructors

MainFragmentAdapter(fragment: T!)

Public functions

T!
BrowseFragment.FragmentHost!

Returns the current host interface so that main fragment can interact with BrowseFragment.

Boolean

Returns whether row scaling is enabled.

Boolean

Returns whether its scrolling.

Unit

Callback indicating transition end.

Boolean

Callback indicating transition prepare start.

Unit

Callback indicating transition start.

Unit
setAlignment(windowAlignOffsetFromTop: Int)

Sets the window alignment and also the pivots for scale operation.

Unit

For rows that willing to participate entrance transition, this function hide views if afterTransition is true, show views if afterTransition is false.

Unit
setExpand(expand: Boolean)

Set the visibility of titles/hover card of browse rows.

Unit
setScalingEnabled(scalingEnabled: Boolean)

Sets the row scaling property.

Public constructors

MainFragmentAdapter

Added in 1.1.0
Deprecated in 1.1.0
MainFragmentAdapter(fragment: T!)

Public functions

getFragment

Added in 1.1.0
Deprecated in 1.1.0
fun getFragment(): T!

getFragmentHost

Added in 1.1.0
Deprecated in 1.1.0
fun getFragmentHost(): BrowseFragment.FragmentHost!

Returns the current host interface so that main fragment can interact with BrowseFragment.

isScalingEnabled

Added in 1.1.0
Deprecated in 1.1.0
fun isScalingEnabled(): Boolean

Returns whether row scaling is enabled.

isScrolling

Added in 1.1.0
Deprecated in 1.1.0
fun isScrolling(): Boolean

Returns whether its scrolling.

onTransitionEnd

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

Callback indicating transition end.

onTransitionPrepare

Added in 1.1.0
Deprecated in 1.1.0
fun onTransitionPrepare(): Boolean

Callback indicating transition prepare start.

onTransitionStart

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

Callback indicating transition start.

setAlignment

Added in 1.1.0
Deprecated in 1.1.0
fun setAlignment(windowAlignOffsetFromTop: Int): Unit

Sets the window alignment and also the pivots for scale operation.

setEntranceTransitionState

Added in 1.1.0
Deprecated in 1.1.0
fun setEntranceTransitionState(state: Boolean): Unit

For rows that willing to participate entrance transition, this function hide views if afterTransition is true, show views if afterTransition is false.

setExpand

Added in 1.1.0
Deprecated in 1.1.0
fun setExpand(expand: Boolean): Unit

Set the visibility of titles/hover card of browse rows.

setScalingEnabled

Added in 1.1.0
Deprecated in 1.1.0
fun setScalingEnabled(scalingEnabled: Boolean): Unit

Sets the row scaling property.