android:layout_tostartof,layout_constraintStart_toStartOf=“parent” is broken in RTL

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: d1324e00a54a4677211d102bd1c4a673.png

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.

c1732afa4d0d420680e5ec28c3777b5f.png

Here's how it looks like in LayoutInspector

a62f19c4b014c504661a6c554ff010ff.png

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"

/>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值