1

How to change OutlinedBox hint and text RTL (support Persian and Arabic):

<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/phoneNumberLayout"
    style="@style/textInputOutlinedLayoutTheme"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_margin="16dp">

<com.google.android.material.textfield.TextInputEditText
    android:id="@+id/phoneNumberEditText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:digits="-0123456789۱۲۳۴۵۶۷۸۹۰"
    android:hint="شماره تلفن همراه"
    android:textAlignment="textEnd"
    android:inputType="phone" />

</com.google.android.material.textfield.TextInputLayout>

1 Answers1

1

Hint : as a best practice, you should set android:hint in the TextInputLayout instead of on the TextInputEditText.

Text : for text RTL you can use android:textAlignment="textEnd".