onRequestChildFocus

Called when a descendant view of the RecyclerView requests focus.

A LayoutManager wishing to keep focused views aligned in a specific portion of the view may implement that behavior in an override of this method.

If the LayoutManager executes different behavior that should override the default behavior of scrolling the focused child on screen instead of running alongside it, this method should return true.

Return

true if the default scroll behavior should be suppressed

Parameters

parent

The RecyclerView hosting this LayoutManager

state

Current state of RecyclerView

child

Direct child of the RecyclerView containing the newly focused view

focused

The newly focused view. This may be the same view as child or it may be null


open fun onRequestChildFocus(@NonNull parent: RecyclerView, @NonNull child: View, @Nullable focused: View): Boolean(source)

Deprecated

Use onRequestChildFocus