By explicit about the firstStrong text direction on UGC (#3328)

`activity_account` sets the root text direction to `anyRtl`.

This is OK for UI elements, but can be a problem for user generated content
(UGC) that may contain bidirectional text.

Fix this by explicitly restoring the default behaviour, `firstStrong`, on
views in `activity_account` that can show UGC.

Fixes https://github.com/tuskyapp/Tusky/issues/3294
This commit is contained in:
Nik Clayton 2023-03-02 18:30:26 +01:00 committed by GitHub
parent a792d2c0d6
commit 7261fa0b18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -201,7 +201,8 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/account_note_hint" /> android:hint="@string/account_note_hint"
android:textDirection="firstStrong" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -225,6 +226,7 @@
android:textColor="?android:textColorTertiary" android:textColor="?android:textColorTertiary"
android:textIsSelectable="true" android:textIsSelectable="true"
android:textSize="?attr/status_text_medium" android:textSize="?attr/status_text_medium"
android:textDirection="firstStrong"
app:layout_constraintTop_toBottomOf="@id/saveNoteInfo" app:layout_constraintTop_toBottomOf="@id/saveNoteInfo"
tools:text="This is a test description. Descriptions can be quite looooong." /> tools:text="This is a test description. Descriptions can be quite looooong." />

View file

@ -16,6 +16,7 @@
android:lineSpacingMultiplier="1.1" android:lineSpacingMultiplier="1.1"
android:textColor="?android:textColorPrimary" android:textColor="?android:textColorPrimary"
android:textSize="?attr/status_text_medium" android:textSize="?attr/status_text_medium"
android:textDirection="firstStrong"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent=".3" app:layout_constraintWidth_percent=".3"
@ -31,6 +32,7 @@
android:lineSpacingMultiplier="1.1" android:lineSpacingMultiplier="1.1"
android:textIsSelectable="true" android:textIsSelectable="true"
android:textSize="?attr/status_text_medium" android:textSize="?attr/status_text_medium"
android:textDirection="firstStrong"
app:layout_constrainedWidth="true" app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/accountFieldName" app:layout_constraintStart_toEndOf="@+id/accountFieldName"