Skip to content

Commit a9dba17

Browse files
committed
InstallerActivity: Mention image can be installed from sdcard
1 parent f85c8ca commit a9dba17

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

android/TerminalApp/java/com/android/virtualization/terminal/InstallerActivity.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public class InstallerActivity : BaseActivity() {
6464

6565
setContentView(R.layout.activity_installer)
6666
updateSizeEstimation(ESTIMATED_IMG_SIZE_BYTES)
67+
sdcardLocation(fromSdCard().getPath())
6768
measureImageSizeAndUpdateDescription()
6869

6970
waitForWifiCheckbox = findViewById<CheckBox>(R.id.installer_wait_for_wifi_checkbox)
@@ -78,6 +79,15 @@ public class InstallerActivity : BaseActivity() {
7879
}
7980
}
8081

82+
private fun sdcardLocation(dst: String) {
83+
val desc =
84+
getString(R.string.installer_sdcard_info_text_format, dst)
85+
runOnUiThread {
86+
val view = findViewById<TextView>(R.id.installer_sdcard_info)
87+
view.text = desc
88+
}
89+
}
90+
8191
private fun updateSizeEstimation(est: Long) {
8292
val desc =
8393
getString(R.string.installer_desc_text_format, Formatter.formatShortFileSize(this, est))

android/TerminalApp/res/layout/activity_installer.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@
6363
android:layout_marginHorizontal="32dp"
6464
android:textSize="16sp" />
6565

66+
<TextView
67+
android:id="@+id/installer_sdcard_info"
68+
android:layout_width="match_parent"
69+
android:layout_height="wrap_content"
70+
android:singleLine="false"
71+
android:layout_below="@id/installer_desc"
72+
android:lineSpacingExtra="5dp"
73+
android:layout_marginTop="24dp"
74+
android:layout_marginHorizontal="32dp"
75+
android:textSize="16sp" />
76+
6677
<CheckBox
6778
android:id="@+id/installer_wait_for_wifi_checkbox"
6879
android:layout_width="wrap_content"

android/TerminalApp/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
<string name="installer_title_text">Install Linux terminal</string>
3434
<!-- Installer activity description format [CHAR LIMIT=none] -->
3535
<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>
36+
<!-- Installer activity extra description [CHAR LIMIT=none] -->
37+
<string name="installer_sdcard_info_text_format">Alternatively, if you want to provide your own custom image, you can place it under <xliff:g id="sdcard_loc">%1$s</xliff:g> using adb or the Files app</string>
3638
<!-- Checkbox at the installer activity to download when Wi-Fi is available to prevent from paying network traffic [CHAR LIMIT=none] -->
3739
<string name="installer_wait_for_wifi_checkbox_text">Download using Wi-Fi only</string>
3840
<!-- Button at the installer activity to confirm installation [CHAR LIMIT=16] -->

0 commit comments

Comments
 (0)