1
votes

I have a login screen that consists of two EditText views. enter image description here When using an arabic locale the password input field gets right aligned and starting to work according to RTL language rules. enter image description here The username input field is not affected in any way. The layout XML for my two input fields looks like this:

<!-- Username input. -->
<EditText
    android:id="@+id/login_edittext_username_input"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="10dp"
    android:paddingRight="10dp"
    android:layout_marginBottom="0.66667dp"
    android:background="@drawable/general_inputfield_normal"
    android:singleLine="true"
    android:imeOptions="actionNext"
    android:inputType="textEmailAddress"
    android:hint="@string/login_input_username_hint"
    android:textColorHint="@color/edit_text_hint" />

<!-- Password input. -->
<EditText
    android:id="@+id/login_edittext_password_input"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="10dp"
    android:paddingRight="10dp"
    android:layout_marginBottom="0.66667dp"
    android:background="@drawable/general_inputfield_normal"
    android:singleLine="true"
    android:inputType="textPassword"
    android:imeOptions="actionDone"
    android:hint="@string/login_input_password_hint"
    android:textColorHint="@color/edit_text_hint" />

I've tried to align the two and found out that android:inputType="textPassword" is the cause. Is there a way to make the password input field behave like the username input field, i.e. left aligned and left-to-right input, but still with the textPassword capabilities?

3
Note: running the app on a Galaxy Nexus with Android 4.1.1TofferJ
You've used pre Edittext for the username and a custom EditText for the password..com.hm.widget.TrueTypeEditText, so it is not because of textPassword it is because of custom viewPragnani
Sorry about that. :) It's got nothing to do with the custom EditText. First thing I did was to test with the android.widget.EditText instead, and the problem is still there.TofferJ

3 Answers

1
votes

using this it will be help you

  android:textAlignment="viewStart"
-1
votes

try with android:gravity="right" alignments , hope this helps

-1
votes

This may help:

android:gravity="start" 
android:textAlignment="viewStart"