app/src/main/res/layout/item_donation.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp">
<com.google.android.material.button.MaterialButton
android:id="@+id/priceTextView"
style="@style/Widget.Material3.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="100 USD" />
<ImageView
android:id="@+id/purchasedTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/purchased"
android:src="@drawable/ic_check_circle"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@color/green"
tools:text="100 USD" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/endBarrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="start"
app:constraint_referenced_ids="priceTextView,purchasedTextView" />
<TextView
android:id="@+id/titleTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:textAppearance="?textAppearanceBodyLarge"
app:layout_constraintEnd_toStartOf="@id/endBarrier"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Ice Cream" />
<TextView
android:id="@+id/summaryTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:textAppearance="?textAppearanceBodyMedium"
app:layout_constraintEnd_toStartOf="@id/endBarrier"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/titleTextView"
tools:text="Ice Cream" />
</androidx.constraintlayout.widget.ConstraintLayout>