added in version 24.1.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1

BrowseSupportFragment.MainFragmentAdapter

public static class BrowseSupportFragment.MainFragmentAdapter
extends Object

java.lang.Object
   ↳ android.support.v17.leanback.app.BrowseSupportFragment.MainFragmentAdapter<T extends android.support.v4.app.Fragment>
Known Direct Subclasses


Interface that defines the interaction between BrowseSupportFragment 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 BrowseSupportFragment by overriding the necessary methods.

Clients are expected to provide an instance of BrowseSupportFragment.MainFragmentAdapterRegistry which will be responsible for providing implementations of BrowseSupportFragment.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 - RowsSupportFragment.MainFragmentAdapter.

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

Summary

Public constructors

BrowseSupportFragment.MainFragmentAdapter(T fragment)

Public methods

final T getFragment()
final BrowseSupportFragment.FragmentHost getFragmentHost()

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

boolean isScalingEnabled()

Returns whether row scaling is enabled.

boolean isScrolling()

Returns whether its scrolling.

void onTransitionEnd()

Callback indicating transition end.

boolean onTransitionPrepare()

Callback indicating transition prepare start.

void onTransitionStart()

Callback indicating transition start.

void setAlignment(int windowAlignOffsetFromTop)

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

void setEntranceTransitionState(boolean state)

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

void setExpand(boolean expand)

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

void setScalingEnabled(boolean scalingEnabled)

Sets the row scaling property.

Inherited methods

From class java.lang.Object

Public constructors

BrowseSupportFragment.MainFragmentAdapter

added in version 24.1.0
BrowseSupportFragment.MainFragmentAdapter (T fragment)

Parameters
fragment T

Public methods

getFragment

added in version 24.1.0
T getFragment ()

Returns
T

getFragmentHost

added in version 24.1.0
BrowseSupportFragment.FragmentHost getFragmentHost ()

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

Returns
BrowseSupportFragment.FragmentHost

isScalingEnabled

added in version 24.1.0
boolean isScalingEnabled ()

Returns whether row scaling is enabled.

Returns
boolean

isScrolling

added in version 24.1.0
boolean isScrolling ()

Returns whether its scrolling.

Returns
boolean

onTransitionEnd

added in version 24.1.0
void onTransitionEnd ()

Callback indicating transition end.

onTransitionPrepare

added in version 24.1.0
boolean onTransitionPrepare ()

Callback indicating transition prepare start.

Returns
boolean

onTransitionStart

added in version 24.1.0
void onTransitionStart ()

Callback indicating transition start.

setAlignment

added in version 24.1.0
void setAlignment (int windowAlignOffsetFromTop)

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

Parameters
windowAlignOffsetFromTop int

setEntranceTransitionState

added in version 24.1.0
void setEntranceTransitionState (boolean state)

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

Parameters
state boolean

setExpand

added in version 24.1.0
void setExpand (boolean expand)

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

Parameters
expand boolean

setScalingEnabled

added in version 24.1.0
void setScalingEnabled (boolean scalingEnabled)

Sets the row scaling property.

Parameters
scalingEnabled boolean