Thanks for the suggestion. I tried, with the code below. The layout looks good. But the animation is faulty, i.e. after remove Worst, the space at the end is too wide as per GIF below

Image for post
Image for post
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="4dp"
android:animateLayoutChanges="true"
android:background="#0ff"
android:orientation="horizontal">

<TextView
android:id="@+id/txt_good"
style="@style/MyStyle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/text_good"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@+id/txt_intermediate"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />

<TextView
android:id="@+id/txt_intermediate"
style="@style/MyStyle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/text_ok"
app:layout_constraintStart_toEndOf="@+id/txt_good"
app:layout_constraintEnd_toStartOf="@+id/txt_bad"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />

<TextView
android:id="@+id/txt_bad"
style="@style/MyStyle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/text_bad"
app:layout_constraintStart_toEndOf="@+id/txt_intermediate"
app:layout_constraintEnd_toStartOf="@+id/txt_worst"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />

<TextView
android:id="@+id/txt_worst"
style="@style/MyStyle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/text_worst"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/txt_bad"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />

</android.support.constraint.ConstraintLayout>

Passionate about learning, and sharing mobile development and others https://twitter.com/elye_project https://www.facebook.com/elye.proj

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store