Hey I am working on constraint layout in android. I am trying to fit my text view and image view in same row, and my image is bigger in size.
The problem is I want to give proper constraint. After setting the proper constraint it will look like this.
activity.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:paddingStart="10dp"
android:paddingTop="12dp"
tools:ignore="RtlSymmetry">
<TextView
android:id="@+id/testName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/description"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="blah blah blah" />
<TextView
android:id="@+id/description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/testIcon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/testName"
tools:text="blah blah blah blah blah blah blah blah blah blah blah blah" />
<ImageView
android:id="@+id/testIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/image_pills"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/description"
app:layout_constraintTop_toBottomOf="@+id/testName"
tools:ignore="ContentDescription" />
</androidx.constraintlayout.widget.ConstraintLayout>
Can someone guide me How to set proper constraint.