In my android project i am using nested recyclerview when i click on item the click is not working.I think it is focusing on the second.
What i tried is
- Disabled the 2nd recyclerview
- Made it not clickable
- Made it not focusable
My xml code is
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_action_search"
android:elevation="1dp"
android:layout_marginBottom="@dimen/half_padding"
android:layout_marginTop="@dimen/half_padding"
android:layout_marginHorizontal="@dimen/single_padding"
android:id="@+id/layout_CAS"
android:minHeight="66dp"
>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/double_padding"
android:textColor="@color/black"
android:text="Don't check the Enable new Logcat tool window at the end."
android:fontFamily="@font/polly_rounded_bold"
android:textSize="12sp"
android:id="@+id/head_CAS"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/single_padding"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/tick_CAS"
/>
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="24dp"
android:layout_height="24dp"
app:layout_constraintTop_toTopOf="@id/head_CAS"
app:layout_constraintEnd_toEndOf="parent"
android:id="@+id/tick_CAS"
android:src="@drawable/ic_action_tick"
android:layout_marginEnd="@dimen/single_padding"
/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/head_CAS"
android:layout_marginTop="@dimen/single_padding"
android:layout_marginHorizontal="@dimen/double_padding"
android:id="@+id/actionTypeRV_FPAA"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
What my references are
Nested RecyclerView onClickListener not working Nested RecyclerView onClick not triggered How to implement onClick listener on nested recyclerview clicklistener not working in recyclerview