public class

BrowseFragment.MainFragmentAdapter<T extends Fragment>

extends java.lang.Object

 java.lang.Object

↳androidx.leanback.app.BrowseFragment.MainFragmentAdapter<T>

Subclasses:

RowsFragment.MainFragmentAdapter

Overview

Interface that defines the interaction between BrowseFragment and its main content fragment. The key method is BrowseFragment.MainFragmentAdapter.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 BrowseFragment.MainFragmentAdapterRegistry which will be responsible for providing implementations of BrowseFragment.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 - RowsFragment.MainFragmentAdapter.

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

Summary

Constructors
publicMainFragmentAdapter(Fragment fragment)

Methods
public final FragmentgetFragment()

public final BrowseFragment.FragmentHostgetFragmentHost()

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

public booleanisScalingEnabled()

Returns whether row scaling is enabled.

public booleanisScrolling()

Returns whether its scrolling.

public voidonTransitionEnd()

Callback indicating transition end.

public booleanonTransitionPrepare()

Callback indicating transition prepare start.

public voidonTransitionStart()

Callback indicating transition start.

public voidsetAlignment(int windowAlignOffsetFromTop)

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

public voidsetEntranceTransitionState(boolean state)

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

public voidsetExpand(boolean expand)

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

public voidsetScalingEnabled(boolean scalingEnabled)

Sets the row scaling property.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public MainFragmentAdapter(Fragment fragment)

Methods

public final Fragment getFragment()

public boolean isScrolling()

Returns whether its scrolling.

public void setExpand(boolean expand)

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

public 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.

public void setAlignment(int windowAlignOffsetFromTop)

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

public boolean onTransitionPrepare()

Callback indicating transition prepare start.

public void onTransitionStart()

Callback indicating transition start.

public void onTransitionEnd()

Callback indicating transition end.

public boolean isScalingEnabled()

Returns whether row scaling is enabled.

public void setScalingEnabled(boolean scalingEnabled)

Sets the row scaling property.

public final BrowseFragment.FragmentHost getFragmentHost()

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