codelab-constraint-layout icon indicating copy to clipboard operation
codelab-constraint-layout copied to clipboard

2.0.0-beta4 - Inconsistent paddingStart/paddingEnd behaviour in RTL

Open cjami opened this issue 5 years ago • 0 comments

Given a simple constraint layout with padding:

<?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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingStart="10dp">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="THIS IS A TEST"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>

In Left-To-Right, the layout behaves as expected: Screenshot 2020-05-07 at 11 50 54

However in Right-To-Left, the layout handles paddingStart differently and clips the view: Screenshot 2020-05-07 at 11 50 40

The same thing occurs with paddingEnd given a parent end constraint.

It is expected that padding behaviour would be consistent between LTR and RTL versions of the layout.

cjami avatar May 07 '20 11:05 cjami