From 7261fa0b18a818338b543fe84db6dec2914a4fba Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Thu, 2 Mar 2023 18:30:26 +0100 Subject: [PATCH] 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 --- app/src/main/res/layout/activity_account.xml | 4 +++- app/src/main/res/layout/item_account_field.xml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml index d794d4e5d..bf011c0b4 100644 --- a/app/src/main/res/layout/activity_account.xml +++ b/app/src/main/res/layout/activity_account.xml @@ -201,7 +201,8 @@ + android:hint="@string/account_note_hint" + android:textDirection="firstStrong" /> @@ -225,6 +226,7 @@ android:textColor="?android:textColorTertiary" android:textIsSelectable="true" android:textSize="?attr/status_text_medium" + android:textDirection="firstStrong" app:layout_constraintTop_toBottomOf="@id/saveNoteInfo" tools:text="This is a test description. Descriptions can be quite looooong." /> diff --git a/app/src/main/res/layout/item_account_field.xml b/app/src/main/res/layout/item_account_field.xml index 3d68e3df9..17ea0dbcf 100644 --- a/app/src/main/res/layout/item_account_field.xml +++ b/app/src/main/res/layout/item_account_field.xml @@ -16,6 +16,7 @@ android:lineSpacingMultiplier="1.1" android:textColor="?android:textColorPrimary" android:textSize="?attr/status_text_medium" + android:textDirection="firstStrong" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintWidth_percent=".3" @@ -31,10 +32,11 @@ android:lineSpacingMultiplier="1.1" android:textIsSelectable="true" android:textSize="?attr/status_text_medium" + android:textDirection="firstStrong" app:layout_constrainedWidth="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/accountFieldName" app:layout_constraintTop_toTopOf="parent" tools:text="Field content. This can contain links and custom emojis" /> - \ No newline at end of file +