Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 1.0.0
belongs to Maven artifact androidx.recyclerview:recyclerview-selection:1.0.0-rc01

FocusDelegate

public abstract class FocusDelegate
extends Object

java.lang.Object
   ↳ androidx.recyclerview.selection.FocusDelegate<K>


Override methods in this class to provide application specific behaviors related to focusing item.

Summary

Public constructors

FocusDelegate()

Public methods

abstract void clearFocus()

If the environment supports focus and something is focused, unfocus it.

abstract void focusItem(ItemDetails<K> item)

If environment supports focus, focus item.

abstract int getFocusedPosition()
abstract boolean hasFocusedItem()

Inherited methods

Public constructors

FocusDelegate

added in version 1.0.0
public FocusDelegate ()

Public methods

clearFocus

added in version 1.0.0
public abstract void clearFocus ()

If the environment supports focus and something is focused, unfocus it.

focusItem

added in version 1.0.0
public abstract void focusItem (ItemDetails<K> item)

If environment supports focus, focus item.

Parameters
item ItemDetails

getFocusedPosition

added in version 1.0.0
public abstract int getFocusedPosition ()

Returns
int the position of the currently focused item, if any.

hasFocusedItem

added in version 1.0.0
public abstract boolean hasFocusedItem ()

Returns
boolean true if there is a focused item.