Q:

Seekbar in recyclerview also moves recyclerview

Basically i have implemented recyclerview in nested scroll view which contains the arc seek bar in each item of recyclerview. So when i move seekbar recyclerview is also scrolling.
I tried using nestedscrollview and focusableInTouchMode option but did not worked.
device_list.apply {
            device_list.layoutManager = GridLayoutManager(this@RoomActivity, 2)
            device_list.adapter = DeviceAdapter()
        }

<androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="?android:attr/actionBarSize"
        android:background="@color/colorWhite">

<androidx.recyclerview.widget.RecyclerView
                android:id="@+id/device_list"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/marginSemiGlobal"
                android:layout_marginBottom="@dimen/marginSemiGlobal"
                android:overScrollMode="never"
                android:nestedScrollingEnabled="false"
                android:scrollbars="none" />

 </androidx.core.widget.NestedScrollView>

<com.marcinmoskala.arcseekbar.ArcSeekBar
            app:roundEdges="true"
            android:layout_width="match_parent"
            android:layout_below="@+id/top_layout"
            app:progressBackgroundColor="@color/colorProgressBackground"
            app:progressBackgroundWidth="8dp"
            app:progressColor="@color/colorProgress"
            android:id="@+id/dimmer"
            app:progressWidth="8dp"
            android:layout_height="100dp"
            app:thumb="@drawable/ic_progress_thumb"
            android:layout_centerHorizontal="true" />

I tried setting setNestedScrollview to ViewCompact and also used focus in touch mode but output was same.

A:

I faced a similar problem when I used WebView inside a RecyclerView. I solved using the following code. Try adding setOnTouchListener for your ArcSeekBar
holder.tipContent.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            int action = event.getAction();
            switch (action) {
                case MotionEvent.ACTION_DOWN:
                   // Disallow ScrollView to intercept touch events.
                    v.getParent().requestDisallowInterceptTouchEvent(true);
                    break;
                case MotionEvent.ACTION_UP:
                    //Allow ScrollView to intercept touch events once again.
                    v.getParent().requestDisallowInterceptTouchEvent(true);
                    break;
            }
             // Handle RecyclerView touch events.
            v.onTouchEvent(event);
            return true;
        }
    });

hope it helps.

