I have a layout with textviews. Whenever I use Left to Right locale OR remove the android:hint elements, it works properly. However, in RTL (Hebrew locale) with LTR value (English text) and gravity="start" or "end" it just pushes the text into a hint sized text view in the wrong direction. Maybe it will be clearer with examples:
LTR locale and text:
RTL locale and LTR text with hints - here the "Data A" field with gravity "end" pushes it to the right instead of left because it is English. "Data B" has gravity "start" so it is the same case, only reversed:
the hints are an important issue because when I remove them, then wrap_content will shrink the view and the layout constraints do their job and it shows up correctly even in RTL
Here is the same example with android:hints removed:
basically, my question is how to make the gravity of a textview always work towards the end or the start of the locale, and not the language of the text
<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"
style="@style/LogEntryListViewItemStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"><!--TODO-->
<ImageView
android:id="@+id/LogEntryListSelectedFieldField"
android:layout_width="wrap_content"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/Number"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:gravity="center"
android:paddingStart="10dp"
android:paddingEnd="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/LogEntryListSelectedFieldField"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/DataB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:gravity="start"
app:layout_constraintStart_toEndOf="@+id/Number"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/LogEntryListItemDateTimeField"
style="@style/LogEntryListItemDateStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:gravity="end"
app:layout_constraintEnd_toStartOf="@+id/LogEntryListSignedField"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/LogEntryListItemAircraftField"
style="@style/DataA"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start"
app:layout_constraintStart_toStartOf="@+id/DataB"
app:layout_constraintTop_toBottomOf="@+id/DataB" />
<TextView
android:id="@+id/DataA"
style="@style/LogEntryListItemAircraftNameStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
app:layout_constraintEnd_toEndOf="@+id/LogEntryListItemDateTimeField"
app:layout_constraintTop_toBottomOf="@+id/LogEntryListItemDateTimeField" />
<android.support.constraint.Barrier
android:id="@+id/barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="LogEntryListItemAircraftField, DataA" />
<TextView
android:id="@+id/LogEntryListItemNotesField"
style="@style/LogEntryListItemNotesStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:hint="(Notes)"
android:maxLines="2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/DataB"
app:layout_constraintEnd_toEndOf="@+id/LogEntryListItemDateTimeField"
app:layout_constraintTop_toBottomOf="@+id/barrier" />
<ImageView
android:id="@+id/LogEntryListSignedField"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:scaleType="center"
android:src="@drawable/ic_menu_edit"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>