Skip to content

Commit 5084e15

Browse files
committed
InstallerActivity: Mention image can be installed from sdcard
1 parent 83ded96 commit 5084e15

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
@@ -61,6 +61,7 @@ public class InstallerActivity : BaseActivity() {
6161

6262
setContentView(R.layout.activity_installer)
6363
updateSizeEstimation(ESTIMATED_IMG_SIZE_BYTES)
64+
sdcardLocation(fromSdCard().getPath())
6465
measureImageSizeAndUpdateDescription()
6566

6667
waitForWifiCheckbox = findViewById<CheckBox>(R.id.installer_wait_for_wifi_checkbox)
@@ -75,6 +76,15 @@ public class InstallerActivity : BaseActivity() {
7576
}
7677
}
7778

79+
private fun sdcardLocation(dst: String) {
80+
val desc =
81+
getString(R.string.installer_sdcard_info_text_format, dst)
82+
runOnUiThread {
83+
val view = findViewById<TextView>(R.id.installer_sdcard_info)
84+
view.text = desc
85+
}
86+
}
87+
7888
private fun updateSizeEstimation(est: Long) {
7989
val desc =
8090
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)