android:gravity="start" not working on TextViews on RTL locales

Author: richardjbsCreated Aug 4, 2016Updated Apr 11, 2024

It seems the lib is making TextViews to ignore (or have inverted) the setting android:gravity="end/start" when RTL is used (by choosing hebrew as the device language for example).

If you set the device in Hebrew and have a TextView:

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="start" 
    android:text="hello world" />

Current result: the text appears aligned to the left (which is wrong) because the devices is currently RTL.

Expected result: the text should appear aligned to the right.