You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
overridefunonFocusSearchFailed(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->10View.FOCUS_UP->-10else->0
}, recycler, state)
returnsuper.onFocusSearchFailed(focused, focusDirection, recycler, state)
}
But there is probably a better way to do this.
Thanks for the nice library!
The text was updated successfully, but these errors were encountered:
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:
But there is probably a better way to do this.
Thanks for the nice library!
The text was updated successfully, but these errors were encountered: