Skip to content

Commit

Permalink
Fix misdisplaying mobile numbers in RTL mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi-git committed Aug 20, 2021
1 parent 4a0e552 commit 881df4a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion presentation/src/main/res/layout/blocked_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
app:textSize="primary"
tools:text="@tools:sample/full_names" />
tools:text="@tools:sample/full_names"
android:textDirection="ltr" />

<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/date"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="24dp"
tools:text="(123) 456-7890" />
tools:text="(123) 456-7890"
android:textDirection="ltr" />

<ImageView
android:id="@+id/unblock"
Expand Down
3 changes: 2 additions & 1 deletion presentation/src/main/res/layout/chip_input_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
android:privateImeOptions="nm"
android:textColor="?android:attr/textColorPrimary"
android:textColorHint="?android:attr/textColorTertiary"
app:textSize="primary" />
app:textSize="primary"
android:textDirection="ltr" />
3 changes: 2 additions & 1 deletion presentation/src/main/res/layout/compose_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@
android:id="@+id/toolbarTitle"
style="@style/ToolbarText"
android:layout_height="wrap_content"
tools:text="Moez Bhatti" />
tools:text="Moez Bhatti"
android:textDirection="ltr" />

<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/toolbarSubtitle"
Expand Down
3 changes: 2 additions & 1 deletion presentation/src/main/res/layout/contact_chip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:textSize="secondary"
tools:text="Moez Bhatti" />
tools:text="Moez Bhatti"
android:textDirection="ltr" />

</LinearLayout>

Expand Down
3 changes: 2 additions & 1 deletion presentation/src/main/res/layout/contact_chip_detailed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
app:layout_constraintTop_toBottomOf="@id/name"
app:textSize="secondary"
tools:text="(123) 456-7890"
tools:textColor="@color/textTertiaryDark" />
tools:textColor="@color/textTertiaryDark"
android:textDirection="ltr" />

<ImageView
android:id="@+id/delete"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
android:gravity="center_vertical"
android:textColor="?android:attr/textColorTertiary"
app:textSize="secondary"
tools:text="(123) 456-7890" />
tools:text="(123) 456-7890"
android:textDirection="ltr" />

</LinearLayout>
3 changes: 2 additions & 1 deletion presentation/src/main/res/layout/contacts_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar"
tools:listitem="@layout/contact_list_item" />
tools:listitem="@layout/contact_list_item"
android:textDirection="ltr" />

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
android:clipChildren="false"
android:clipToPadding="false"
android:paddingTop="8dp"
android:paddingBottom="8dp" />
android:paddingBottom="8dp"
android:textDirection="ltr" />
3 changes: 2 additions & 1 deletion presentation/src/main/res/layout/conversation_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
app:layout_constraintStart_toEndOf="@id/avatars"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="@tools:sample/full_names" />
tools:text="@tools:sample/full_names"
android:textDirection="ltr" />

<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/snippet"
Expand Down

1 comment on commit 881df4a

@Mehdi-git
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For more readability, the mobile numbers in views are shown separately based on country code. When phone language changes to RTL (right to left) languages like Persian or Arabic, the separated numbers will be falsely displayed reversed. I have found 10 views which show mobile numbers and fixed them in order to stay in LTR (left to right) mode.

Please sign in to comment.