Нажатие на препятствие RelativeLayout содержит Recyclerview.
Я обновляю код, реализующий RecyclerView, но у меня возникла проблема.
Я использую только для просмотра. Меня не волнует нажатие на элемент.
Хотелось бы использовать родительский относительный клик.
Это даже не влияет на прямой клик CardView.
Пожалуйста, заблокируйте его с помощью кода.
Как я могу решить спасибо.
XML-код
<!--"cardview" -->
<android.support.v7.widget.CardView
android:id="@+id/corsi_card"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="12dp"
android:layout_marginTop="12dp"
android:layout_marginRight="12dp"
android:layout_marginBottom="18dp"
app:cardCornerRadius="4dp"
app:cardElevation="4dp">
<LinearLayout
android:id="@+id/btn_card_corsi"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/_card_corsi"
android:clickable="true"
android:focusable="true"
android:foreground="?
android:attr/selectableItemBackground"
android:orientation="vertical">
<!--"box head" -->
<LinearLayout
android:id="@+id/box_head_corsi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="6dp"
android:layout_marginRight="6dp"
android:gravity="center"
android:orientation="horizontal"
android:visibility="gone">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal"
android:padding="2dp">
<LinearLayout
android:layout_width="5dp"
android:layout_height="5dp"
android:orientation="vertical"></LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_alignParentLeft="false"
android:layout_alignParentTop="false"
android:layout_marginTop="6dp"
android:layout_marginRight="6dp"
android:layout_marginBottom="6dp"
android:adjustViewBounds="true"
android:background="@color/card_corsi"
android:scaleType="centerCrop"
android:src="@drawable/menu_corsi_white" />
<TextView
android:id="@+id/label_corsi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left|center"
android:text="CORSI"
android:textColor="@color/primary_text_color"
android:textSize="16dp" />
</LinearLayout>
<!--"box ms" -->
<LinearLayout
android:id="@+id/box_ms_corsi"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="12dp"
android:layout_marginRight="6dp"
android:layout_marginBottom="6dp"
android:orientation="horizontal"
android:visibility="gone">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal"
android:padding="2dp">
<LinearLayout
android:layout_width="5dp"
android:layout_height="5dp"
android:orientation="vertical"></LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/text_ms_corsi"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:textColor="@color/primary_sub_text_color"
android:textSize="14dp" />
</LinearLayout>
</LinearLayout>
<!--"box rv" -->
<RelativeLayout
android:id="@+id/box_rv_corsi"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="14dp"
android:layout_marginRight="6dp"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_corsi_mini"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
<!--"separator" -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="8dp"
android:background="@color/grey"
android:orientation="vertical"
android:padding="4dp"
android:visibility="gone">
</LinearLayout>
<!--"box btn" -->
<LinearLayout
android:id="@+id/btn_corsi"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginLeft="12dp"
android:orientation="horizontal"
android:visibility="gone">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="6dp"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:gravity="center"
android:orientation="horizontal"
android:padding="2dp">
<LinearLayout
android:layout_width="5dp"
android:layout_height="5dp"
android:orientation="vertical"></LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/text_btn_corsi"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="6dp"
android:layout_marginRight="6dp"
android:layout_marginBottom="6dp"
android:gravity="left|center"
android:text="VISUALIZZA CORSI"
android:textColor="@color/secondary_text_color"
android:textSize="12dp" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>