TerminalApp: Fixes for RTL
This includes two fixes:
- Ensure gap between assigned size text and max size text
- Prevent RTL flip between data unit and value.
Bug: 391768650
Test: Apply the strings.xml change to values-iw, and verify manually.
Change-Id: I868e94114eea9e050bdd29bef439f495222e836c
diff --git a/android/TerminalApp/res/layout/settings_disk_resize.xml b/android/TerminalApp/res/layout/settings_disk_resize.xml
index 55fb7af..0052e04 100644
--- a/android/TerminalApp/res/layout/settings_disk_resize.xml
+++ b/android/TerminalApp/res/layout/settings_disk_resize.xml
@@ -36,25 +36,30 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
+ <!-- Hardcode LTR to have some gap between assigned size and max size
+ and also match texts with slider -->
<TextView
android:id="@+id/settings_disk_resize_resize_gb_assigned"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:textSize="14sp"
android:singleLine="false"
+ android:gravity="left"
app:layout_constraintWidth_percent="0.5"
- app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toTopOf="@+id/settings_disk_resize_disk_size_slider"/>
+ <!-- Hardcode LTR to have some gap between assigned size and max size
+ and also match texts with slider -->
<TextView
android:id="@+id/settings_disk_resize_resize_gb_max"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:textSize="14sp"
android:singleLine="false"
- android:gravity="end"
+ android:gravity="right"
app:layout_constraintWidth_percent="0.5"
- app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toTopOf="@+id/settings_disk_resize_disk_size_slider"/>
<SeekBar
diff --git a/android/TerminalApp/res/values/strings.xml b/android/TerminalApp/res/values/strings.xml
index 44009c3..228700c 100644
--- a/android/TerminalApp/res/values/strings.xml
+++ b/android/TerminalApp/res/values/strings.xml
@@ -32,7 +32,7 @@
<!-- Installer activity title [CHAR LIMIT=none] -->
<string name="installer_title_text">Install Linux terminal</string>
<!-- Installer activity description format [CHAR LIMIT=none] -->
- <string name="installer_desc_text_format">To launch Linux terminal, you need to download roughly <xliff:g id="expected_size" example="350GB">%1$s</xliff:g> of data over the network.\nWould you like to proceed?</string>
+ <string name="installer_desc_text_format">To launch Linux terminal, you need to download roughly <xliff:g id="expected_size" example="350GB">\u200E%1$s\u200E</xliff:g> of data over the network.\nWould you like to proceed?</string>
<!-- Checkbox at the installer activity to download when Wi-Fi is available to prevent from paying network traffic [CHAR LIMIT=none] -->
<string name="installer_wait_for_wifi_checkbox_text">Download using Wi-Fi only</string>
<!-- Button at the installer activity to confirm installation [CHAR LIMIT=16] -->
@@ -72,9 +72,9 @@
<!-- Toast message after new disk size is set. [CHAR LIMIT=none] -->
<string name="settings_disk_resize_resize_message">Disk size set</string>
<!-- Settings menu option description format of the current disk size. [CHAR LIMIT=none] -->
- <string name="settings_disk_resize_resize_gb_assigned_format"><xliff:g id="assigned_size" example="10GB">%1$s</xliff:g> assigned</string>
+ <string name="settings_disk_resize_resize_gb_assigned_format"><xliff:g id="assigned_size" example="10GB">\u200E%1$s\u200E</xliff:g> assigned</string>
<!-- Settings menu option description format of the maximum resizable disk size. [CHAR LIMIT=none] -->
- <string name="settings_disk_resize_resize_gb_max_format"><xliff:g id="max_size" example="256GB">%1$s</xliff:g> max</string>
+ <string name="settings_disk_resize_resize_gb_max_format"><xliff:g id="max_size" example="256GB">\u200E%1$s\u200E</xliff:g> max</string>
<!-- Settings menu button to cancel disk resize. [CHAR LIMIT=16] -->
<string name="settings_disk_resize_resize_cancel">Cancel</string>
<!-- Settings menu button to apply change Terminal app. This will launch a confirmation dialog [CHAR LIMIT=16] -->