2

I have a ScrollView with multiple horizontal RecyclerView. The problem is this:
When I scroll vertically to navigate into my app and I touch on a recyclerview to scroll horizontally, the focus remain on the scrollview and I can't scroll horizontally. I have to release the finger and touch again in order to scroll vertically.
I'd like to give proprity to the recyclerview, so I can scroll horizontally without stopping the vertical scroll.

I tried multiples solutions:

  • editing some parameters in the xml of the recyclerview and its container (focusable, focusableintouchmode, descendantFocusability,nestedscrollingenabled)

  • adding an ontouchlistener and intercepting the motionevent, both in scrollview and recyclerview

    This problem is present using both ScrollView and NestedScrollview and using both RecyclerView and ListView

    Thanks for your help

  • 1 Answers1

    5

    This problem because of recyclerView has default focus. Just Add this

    android:descendantFocusability="blocksDescendants"
    

    to your immediate layout of scrollView.

    Donald Duck
    • 8,409
    • 22
    • 75
    • 99
    Abhinav Suman
    • 940
    • 1
    • 9
    • 29