I was wondering if you can control input on an EditText to move from right to left? The EditText would have to support insert/delete etc. from right to left as well. Is th
The right way is to use:
android:textAlignment="viewStart"
As it will automatically work for LTR and RTL.
Add this to your editText
android:textDirection="rtl"
try the below code
AutoCompleteTextView autoCompleteTextView = findViewById(R.id.main_searchBar);
autoCompleteTextView.setGravity(Gravity.RIGHT);
There is the manual way to do it by using the following code :
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_MENU) {
// Each time click Menu button on the bar
// Set the cursor to the first index
mEtEmail.setSelection(0); // YOUR EDIT TEXT
}
return super.onKeyUp(keyCode, event);
}
p/s : Or you can change
KeyEvent.KEYCODE_MENU
follow your wishes,
Or you can try with Bidi.
Thanks,