Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

FocusDelegate

abstract class FocusDelegate<K : Any!>
kotlin.Any
   ↳ androidx.recyclerview.selection.FocusDelegate

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

Summary

Public constructors

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

Public methods

abstract Unit

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

abstract Unit

If environment supports focus, focus item.

abstract Int

abstract Boolean

Public constructors

<init>

FocusDelegate()

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

Public methods

clearFocus

abstract fun clearFocus(): Unit

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

focusItem

abstract fun focusItem(@NonNull item: ItemDetailsLookup.ItemDetails<K>): Unit

If environment supports focus, focus item.

getFocusedPosition

abstract fun getFocusedPosition(): Int
Return
Int: the position of the currently focused item, if any.

hasFocusedItem

abstract fun hasFocusedItem(): Boolean
Return
Boolean: true if there is a focused item.