-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Description
I'm using the library in an Android TV app, so navigation with D-pad is a requirement for me. When I press down in a list, the focusing works correctly until I reach the last displayed row. Pressing down from there does nothing, and onFocusSearchFailed()
is called in the layout manager.
I've worked around this by subclassing the layout manager and scrolling a little when the focus search fails:
override fun onFocusSearchFailed(focused: View, focusDirection: Int,
recycler: RecyclerView.Recycler, state: RecyclerView.State): View? {
// Need to be called in order to layout new row
scrollVerticallyBy(when (focusDirection) {
View.FOCUS_DOWN -> 10
View.FOCUS_UP -> -10
else -> 0
}, recycler, state)
return super.onFocusSearchFailed(focused, focusDirection, recycler, state)
}
But there is probably a better way to do this.
Thanks for the nice library!
Metadata
Metadata
Assignees
Labels
No labels