У меня есть макет, состоящий из 2 текстовых представлений, выровненных по горизонтали. Правое текстовое представление должно всегда отображать весь текст, а левое должно расширяться, чтобы занимать все необходимое пространство, с многоточием, если оно не помещается. Когда оба вида соответствуют друг другу, они должны занимать только минимальное пространство.
Эти изображения иллюстрируют то, что я ищу:
Когда подходит весь текст:
![enter image description here](https://i.stack.imgur.com/GLejh.png)
Когда левый текст слишком длинный:
![enter image description here](https://i.stack.imgur.com/q52Q8.png)
У меня есть этот начальный макет, но я не могу заставить его работать для обоих сценариев одновременно.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:ellipsize="end"
android:lines="1"
android:textSize="24sp"
app:layout_constraintHorizontal_chainStyle="packed"
android:text="Left text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:text="Right text"
android:textSize="24sp"
app:layout_constraintStart_toEndOf="@+id/left"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>