I have a layout, which supports RTL. It looks fine in preview in Android studio and on device in default locale, but is broken in Arabic locale. There is an image on start, button on end and two texts in between.
Here's how it is designed and looks like in preview:
For some reason both button and image are placed at the end in Arabic locale. So, texts have no room and are not displayed, but view height is much larger than expected.
Here's how it looks like in LayoutInspector
What can be wrong with it? I use databinding, if it does matter. This layout is placed in separate file and included with include tag
Here's the layout:
android:layout_width="match_parent" android:layout_height="match_parent"
android:padding="@dimen/spacing_med"
>
android:id="@+id/avatar"
android:layout_width="32dp"
android:layout_height="32dp"
tools:layout_constraintStart_toStartOf="parent"
tools:layout_constraintTop_toTopOf="parent"
/>
android:id="@+id/call"
android:text="@string/call"
android:drawableStart="@drawable/ic_phone_pink"
android:paddingLeft="@dimen/spacing_med"
android:paddingRight="@dimen/spacing_med"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:minWidth="70dp"
/>
android:id="@+id/name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_med"
android:layout_marginEnd="@dimen/spacing_med"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@id/call"
app:layout_constraintStart_toEndOf="@id/avatar"
/>
android:id="@+id/phone"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_med"
android:layout_marginEnd="@dimen/spacing_med"
app:layout_constraintTop_toBottomOf="@id/name"
app:layout_constraintEnd_toStartOf="@id/call"
app:layout_constraintStart_toEndOf="@id/avatar"
/>