Есть CardView, который находится в RecyclerView:
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
card_view:cardBackgroundColor="@android:color/white"
card_view:cardCornerRadius="10dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
card_view:cardElevation="10dp"
card_view:cardUseCompatPadding="true"
android:id="@+id/DutyID">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:clickable="false">
<TextView
android:id="@+id/nameText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:fontFamily="@font/roboto"
android:textColor="#000"
android:clickable="false"
android:gravity="center"
android:text="услуга 1"
card_view:layout_constraintEnd_toEndOf="parent"
card_view:layout_constraintStart_toStartOf="parent"
card_view:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="88dp"
android:layout_height="21dp"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:clickable="false"
android:foregroundGravity="center"
card_view:layout_constraintBottom_toBottomOf="parent"
card_view:layout_constraintEnd_toEndOf="parent"
card_view:layout_constraintHorizontal_bias="0.0"
card_view:layout_constraintStart_toStartOf="parent"
card_view:layout_constraintTop_toBottomOf="@+id/nameText"
card_view:layout_constraintVertical_bias="0.0">
<TextView
android:id="@+id/priceText"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="40dp"
android:layout_marginEnd="60dp"
android:clickable="false"
android:textColor="#000"
android:gravity="center|end"
android:text="100"
android:fontFamily="@font/roboto"
card_view:layout_constraintBottom_toBottomOf="parent"
card_view:layout_constraintEnd_toEndOf="parent"
card_view:layout_constraintStart_toStartOf="parent"
card_view:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/priceImageView"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginStart="4dp"
android:backgroundTint="#383838"
android:clickable="false"
card_view:layout_constraintBottom_toBottomOf="parent"
card_view:layout_constraintStart_toEndOf="@+id/priceText"
card_view:layout_constraintTop_toTopOf="parent"
card_view:srcCompat="@drawable/ruble" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity=""
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:clickable="false"
card_view:layout_constraintBottom_toBottomOf="parent"
card_view:layout_constraintEnd_toEndOf="parent"
card_view:layout_constraintStart_toStartOf="parent">
<ImageView
android:id="@+id/moreImageView"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="10dp"
android:backgroundTintMode="add"
android:clickable="false"
card_view:layout_constraintBottom_toBottomOf="parent"
card_view:layout_constraintEnd_toEndOf="parent"
card_view:layout_constraintHorizontal_bias="0.0"
card_view:layout_constraintStart_toStartOf="parent"
card_view:layout_constraintTop_toTopOf="parent"
card_view:layout_constraintVertical_bias="0.0"
card_view:srcCompat="@drawable/sas" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
При нажатии на него происходит событие и устанавливается значение в Background:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<solid android:color="#FFF"/>
<stroke android:width="1dip" android:color="@color/colorPrimary" />
<corners android:radius="10dp" />
</shape>
Как сделать что бы тень тоже меняла цвет при нажатии?
P.S. @color/colorPrimary=#FF6634