added in version 1.0.0
belongs to Maven artifact androidx.leanback:leanback:1.0.0-beta01

FocusHighlightHelper

public class FocusHighlightHelper
extends Object

java.lang.Object
   ↳ androidx.leanback.widget.FocusHighlightHelper


Sets up the highlighting behavior when an item gains focus.

Summary

Public constructors

FocusHighlightHelper()

This constructor was deprecated in API level 1.0.0. This type should not be instantiated as it contains only static methods.

Public methods

static void setupBrowseItemFocusHighlight(ItemBridgeAdapter adapter, int zoomIndex, boolean useDimmer)

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

static void setupHeaderItemFocusHighlight(VerticalGridView gridView, boolean scaleEnabled)

This method was deprecated in API level 1.0.0. Use setupHeaderItemFocusHighlight(ItemBridgeAdapter, boolean)

static void setupHeaderItemFocusHighlight(ItemBridgeAdapter adapter)

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

static void setupHeaderItemFocusHighlight(VerticalGridView gridView)

This method was deprecated in API level 1.0.0. Use setupHeaderItemFocusHighlight(ItemBridgeAdapter)

static void setupHeaderItemFocusHighlight(ItemBridgeAdapter adapter, boolean scaleEnabled)

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

Inherited methods

Public constructors

FocusHighlightHelper

added in version 1.0.0
public FocusHighlightHelper ()

This constructor was deprecated in API level 1.0.0.
This type should not be instantiated as it contains only static methods.

Public methods

setupBrowseItemFocusHighlight

added in version 1.0.0
public static void setupBrowseItemFocusHighlight (ItemBridgeAdapter adapter, 
                int zoomIndex, 
                boolean useDimmer)

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
adapter ItemBridgeAdapter: adapter of the list row.

zoomIndex int: One of FocusHighlight.ZOOM_FACTOR_SMALL FocusHighlight.ZOOM_FACTOR_XSMALL FocusHighlight.ZOOM_FACTOR_MEDIUM FocusHighlight.ZOOM_FACTOR_LARGE FocusHighlight.ZOOM_FACTOR_NONE.

useDimmer boolean: Allow dimming browse item when unselected.

setupHeaderItemFocusHighlight

added in version 1.0.0
public static void setupHeaderItemFocusHighlight (VerticalGridView gridView, 
                boolean scaleEnabled)

This method was deprecated in API level 1.0.0.
Use setupHeaderItemFocusHighlight(ItemBridgeAdapter, boolean)

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

Parameters
gridView VerticalGridView: The header list.

scaleEnabled boolean: True if scale the item when focused, false otherwise. Note that RowHeaderPresenter.onSelectLevelChanged(RowHeaderPresenter.ViewHolder) will always be called regardless value of scaleEnabled.

setupHeaderItemFocusHighlight

added in version 1.0.0
public static void setupHeaderItemFocusHighlight (ItemBridgeAdapter adapter)

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

added in version 1.0.0
public static void setupHeaderItemFocusHighlight (VerticalGridView gridView)

This method was deprecated in API level 1.0.0.
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

added in version 1.0.0
public static void setupHeaderItemFocusHighlight (ItemBridgeAdapter adapter, 
                boolean scaleEnabled)

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

Parameters
adapter ItemBridgeAdapter: The adapter of HeadersFragment.

scaleEnabled boolean: True if scale the item when focused, false otherwise. Note that RowHeaderPresenter.onSelectLevelChanged(RowHeaderPresenter.ViewHolder) will always be called regardless value of scaleEnabled.