HorizontalHoverCardSwitcher


public final class HorizontalHoverCardSwitcher extends PresenterSwitcher


A helper class for showing a hover card view below a HorizontalGridView. The hover card is aligned to the starting edge of the selected child view. If there is no space when scrolling to the end, the ending edge of the hover card will be aligned to the ending edge of the parent view, excluding padding.

Summary

Public constructors

Public methods

void
select(HorizontalGridView gridView, View childView, Object object)

Select a childView inside a grid view and create/bind a corresponding hover card view for the object.

Protected methods

void
void

Called when a view is bound to the object of select.

Inherited methods

From androidx.leanback.widget.PresenterSwitcher
void

Destroys created views.

final ViewGroup

Returns the parent.

void
init(ViewGroup parent, PresenterSelector presenterSelector)

Initializes the switcher with a parent view to insert view into and a PresenterSelector for choosing a Presenter for a given object.

void
select(Object object)

Selects a view based on the given object and shows that view.

void
showView(View view, boolean visible)
void

Hides the view.

Public constructors

HorizontalHoverCardSwitcher

Added in 1.1.0
public HorizontalHoverCardSwitcher()

Public methods

select

Added in 1.1.0
public void select(HorizontalGridView gridView, View childView, Object object)

Select a childView inside a grid view and create/bind a corresponding hover card view for the object.

Protected methods

insertView

Added in 1.2.0-alpha04
protected void insertView(View view)

onViewSelected

protected void onViewSelected(View view)

Called when a view is bound to the object of select.