Android Studio 3.6
в моем макете xml:
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/feedbackContainer"
android:layout_width="0dp"
android:layout_height="174dp"
app:layout_constraintEnd_toEndOf="@+id/checkContainer"
app:layout_constraintStart_toStartOf="@+id/checkContainer"
app:layout_constraintTop_toBottomOf="@+id/checkContainer">
<ImageView
android:id="@+id/feedbackViewCircle"
android:layout_width="124dp"
android:layout_height="124dp"
android:background="@drawable/circle_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/heartOutlineNotMadeContainer"
android:layout_width="56dp"
android:layout_height="56dp"
android:background="@drawable/feedback_outline_bg"
app:layout_constraintBottom_toBottomOf="@+id/feedbackViewCircle"
app:layout_constraintEnd_toEndOf="@+id/feedbackViewCircle"
app:layout_constraintStart_toStartOf="@+id/feedbackViewCircle"
app:layout_constraintTop_toTopOf="@+id/feedbackViewCircle" />
<TextView
android:id="@+id/feedbackTextView"
style="@style/defaultTextStyle2"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center"
android:text="@string/feedback"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/feedbackViewCircle" />
</androidx.constraintlayout.widget.ConstraintLayout>
/ circle_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/circle_paint_dark" android:state_enabled="false" />
<item android:drawable="@drawable/circle_paint" />
</selector>
/ feedback_outline_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_heartoutlinemade" android:state_enabled="false" />
<item android:drawable="@drawable/ic_heartoutlinenotmade" />
</selector>
здесь background / feedbackViewCircle.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/circle_paint_dark" android:state_enabled="false" />
<item android:drawable="@drawable/circle_paint" />
</selector>
И вот результат:
OK. Это работа.
Но мне нужен эффект "нажатия". Smt как это: