0

Trying to find a way to differentiate between selecting an item in the recyclerview and touching it because of scrolling the scrollview.

The hierarchy of the UI elements is

<ConstraintLayout>
  <ScrollView>
   <ConstraintLayout>
     <LinearLayout> ----> here is the recyclerview
     <LinearLayout> ----> includes single checkbox

The problem is that items in the recyclerview are checkboxes. So if the single checkbox is selected and I scrolled down the interceptionTouchEvent will be triggered and that will deselect my choice. However, I need to preserve the right to select any checkbox in the recyclerview.

Looking for a way to differentiate between touching any item in the recyclerview because of the scrolling fact and thus that touch event needs to be ignored/skipped and between selecting any item in the recyclerview and thus that touch event needs to be consumed.

Alma
  • 75
  • 1
  • 6

1 Answers1

0

NestedScrollView help me in this case

  • I tried to use NestedScrollView and I set isNestedScrollingEnabled to false but that didn't solve the problem. – Alma Jul 14 '23 at 15:14