onFocusSearchFailed

open fun onFocusSearchFailed(focused: View, direction: Int, recycler: RecyclerView.Recycler, state: RecyclerView.State): View(source)

Called when searching for a focusable view in the given direction has failed for the current content of the RecyclerView.

This is the LayoutManager's opportunity to populate views in the given direction to fulfill the request if it can. The LayoutManager should attach and return the view to be focused, if a focusable view in the given direction is found. Otherwise, if all the existing (or the newly populated views) are unfocusable, it returns the next unfocusable view to become visible on the screen. This unfocusable view is typically the first view that's either partially or fully out of RV's padded bounded area in the given direction. The default implementation returns null.

Return

The chosen view to be focused if a focusable view is found, otherwise an unfocusable view to become visible onto the screen, else null.

Parameters

focused

The currently focused view

direction
recycler

The recycler to use for obtaining views for currently offscreen items

state

Transient state of RecyclerView