Register now for Android Dev Summit 2019!

FocusHighlightHelper

open class FocusHighlightHelper
kotlin.Any
   ↳ androidx.leanback.widget.FocusHighlightHelper

Sets up the highlighting behavior when an item gains focus.

Summary

Public constructors

Public methods

open static Unit
setupBrowseItemFocusHighlight(adapter: ItemBridgeAdapter!, zoomIndex: Int, useDimmer: Boolean)

Sets up the focus highlight behavior of a focused item in browse list row.

open static Unit

Sets up default focus highlight behavior of a focused item in header list.

open static Unit

Sets up the focus highlight behavior of a focused item in header list.

open static Unit

Sets up default focus highlight behavior of a focused item in header list.

open static Unit

Sets up the focus highlight behavior of a focused item in header list.

Public constructors

<init>

FocusHighlightHelper()

Deprecated: This type should not be instantiated as it contains only static methods.

Public methods

setupBrowseItemFocusHighlight

open static fun setupBrowseItemFocusHighlight(adapter: ItemBridgeAdapter!, zoomIndex: Int, useDimmer: Boolean): Unit

Sets up the focus highlight behavior of a focused item in browse list row. App usually does not call this method, it uses ListRowPresenter#ListRowPresenter(int, boolean).

Parameters
zoomIndex ItemBridgeAdapter!: One of FocusHighlight#ZOOM_FACTOR_SMALL FocusHighlight#ZOOM_FACTOR_XSMALL FocusHighlight#ZOOM_FACTOR_MEDIUM FocusHighlight#ZOOM_FACTOR_LARGE FocusHighlight#ZOOM_FACTOR_NONE.
useDimmer ItemBridgeAdapter!: Allow dimming browse item when unselected.
adapter ItemBridgeAdapter!: adapter of the list row.

setupHeaderItemFocusHighlight

open static fun setupHeaderItemFocusHighlight(gridView: VerticalGridView!): Unit

Deprecated: Use setupHeaderItemFocusHighlight(ItemBridgeAdapter)

Sets up default focus highlight behavior of a focused item in header list. It would scale the focused item and update RowHeaderPresenter#onSelectLevelChanged(RowHeaderPresenter.ViewHolder). Equivalent to call setupHeaderItemFocusHighlight(gridView, true).

Parameters
gridView VerticalGridView!: The header list.

setupHeaderItemFocusHighlight

open static fun setupHeaderItemFocusHighlight(gridView: VerticalGridView!, scaleEnabled: Boolean): Unit

Deprecated: Use setupHeaderItemFocusHighlight(ItemBridgeAdapter, boolean)

Sets up the focus highlight behavior of a focused item in header list.

Parameters
gridView VerticalGridView!: The header list.
scaleEnabled VerticalGridView!: True if scale the item when focused, false otherwise. Note that RowHeaderPresenter#onSelectLevelChanged(RowHeaderPresenter.ViewHolder) will always be called regardless value of scaleEnabled.

setupHeaderItemFocusHighlight

open static fun setupHeaderItemFocusHighlight(adapter: ItemBridgeAdapter!): Unit

Sets up default focus highlight behavior of a focused item in header list. It would scale the focused item and update RowHeaderPresenter#onSelectLevelChanged(RowHeaderPresenter.ViewHolder). Equivalent to call setupHeaderItemFocusHighlight(itemBridgeAdapter, true).

Parameters
adapter ItemBridgeAdapter!: The adapter of HeadersFragment.

setupHeaderItemFocusHighlight

open static fun setupHeaderItemFocusHighlight(adapter: ItemBridgeAdapter!, scaleEnabled: Boolean): Unit

Sets up the focus highlight behavior of a focused item in header list.

Parameters
adapter ItemBridgeAdapter!: The adapter of HeadersFragment.
scaleEnabled ItemBridgeAdapter!: True if scale the item when focused, false otherwise. Note that RowHeaderPresenter#onSelectLevelChanged(RowHeaderPresenter.ViewHolder) will always be called regardless value of scaleEnabled.