У меня есть макет с textviews.Всякий раз, когда я использую левый-правый языковой стандарт ИЛИ , удаляю элементы android: hint, он работает правильно.Однако в RTL (локаль на иврите) со значением LTR (текст на английском языке) и gravity = "start" или "end" он просто толкает текст в текстовое представление размером с подсказку в неправильном направлении.Может быть, это будет понятнее с примерами:
Локаль LTR и текст:
Локализация RTL и текст LTR с подсказками - здесьПоле «Данные» с гравитационным «концом» толкает его вправо, а не влево, потому что оно на английском языке.«Данные B» имеют гравитацию «начало», поэтому это тот же случай, только в обратном порядке:
подсказки являются важной проблемой, потому что при удаленииих, тогда wrap_content сократит представление, и ограничения макета сделают свою работу, и это правильно отображается даже в RTL
Вот тот же пример с android: удаленные подсказки:
Редактор макетов LTR:
В основном мой вопрос заключается в том, как заставить гравитацию текстового представления всегда работать в конце или в начале локали, ине язык текста
<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>