Recommendations in ConstraintLayout support RTL

Are there any recommendations to ConstraintLayoutsupport RTL? I create Viewone that has a profile picture and user information on the right. I want the image to occupy 30% of the width and the username and data to be 70%. Is this a reasonable use case for the Guide? I know about other implementations, but I was wondering if recommendations could be used here. The problem I am facing is that the manual remains in this position on the left after changing the device language to RTL.

screenshot

Here is the xml:

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:background="@color/colorPrimary"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/textView5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="24sp"
        tools:text="Full Name"
        app:layout_constraintTop_toTopOf="@+id/imageView"
        app:layout_constraintStart_toEndOf="@+id/guideline2" />

    <TextView
        android:id="@+id/textView6"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="14sp"
        tools:text="Android Developer"
        app:layout_constraintBottom_toBottomOf="@+id/imageView"
        app:layout_constraintStart_toEndOf="@+id/guideline2" />

    <android.support.constraint.Guideline
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/guideline2"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.30" />


</android.support.constraint.ConstraintLayout>
+6
source share
1

** ** Google. ** END UPDATE **

, Android .

.

, RTL, /dimens.xml, :

<resources>
     <item name="my_percent" format="float" type="dimen">0.3</item>
</resources>

100-mypercent values-ldrtl/dimens.xml.

<resources>
     <item name="my_percent" format="float" type="dimen">0.7</item>
</resources>

:

<android.support.constraint.Guideline
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/guideline2"
    android:orientation="vertical"
    app:layout_constraintGuide_percent="@dimen/my_percent" />
  • RTL, layout-ldrtl/ RTL.
+7

All Articles