Skip to content

Commit cf29ddc

Browse files
ADFA-4910 fix(wizard): put extract % on its own fixed line
On the Extract screen the % and the current file name shared one centered line, so the number danced left/right as the file name grew/shrank -- hard to follow. Move the % to its own fixed line right under the bar (always the same spot) and leave the file name on the line below, free to change without moving the number. The "Extracting System" legend stays static on top; reading sub-phase unchanged.
1 parent 413dcee commit cf29ddc

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

‎controller/app/src/main/java/org/iiab/controller/redesign/LibraryActivity.java‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class LibraryActivity extends AppCompatActivity implements ServerControll
5555

5656
private LottieAnimationView bootGate;
5757
private View installProgress;
58-
private android.widget.TextView installStatus, installDetail;
58+
private android.widget.TextView installStatus, installDetail, installPercent;
5959
private android.widget.ProgressBar installBar;
6060
private boolean gateDismissed = false;
6161
private boolean closing = false;
@@ -106,6 +106,7 @@ protected void onCreate(Bundle savedInstanceState) {
106106
installStatus = findViewById(R.id.k2go_install_status);
107107
installBar = findViewById(R.id.k2go_install_bar);
108108
installDetail = findViewById(R.id.k2go_install_detail);
109+
installPercent = findViewById(R.id.k2go_install_percent);
109110
// ADFA-4915: extract detail is one middle-ellipsized line so long file names never overlap.
110111
installDetail.setMaxLines(1);
111112
installDetail.setEllipsize(android.text.TextUtils.TruncateAt.MIDDLE);
@@ -213,6 +214,7 @@ private void showInstallProgress(InstallState st) {
213214
stopBootEllipsis(); // ADFA-4837: an install owns the status line; stop the boot animation
214215
installProgress.setVisibility(View.VISIBLE);
215216
if (installBar != null) installBar.setVisibility(View.VISIBLE); // ADFA-4837: boot/shutdown hide it
217+
if (installPercent != null) installPercent.setVisibility(View.GONE); // ADFA-4910: only the determinate extract shows it
216218
if (st.phase == InstallState.Phase.DOWNLOADING) {
217219
installStatus.setText(getString(R.string.k2go_downloading_library));
218220
installBar.setIndeterminate(false);
@@ -233,8 +235,13 @@ private void showInstallProgress(InstallState st) {
233235
// (no internal path, no counter): one ellipsized line that never overlaps.
234236
installBar.setIndeterminate(false);
235237
installBar.setProgress(st.percent);
236-
String name = org.iiab.controller.deploy.domain.ExtractProgress.fileLabel(st.message);
237-
installDetail.setText(name.isEmpty() ? (st.percent + "%") : (st.percent + "% · " + name));
238+
// ADFA-4910: the % lives on its own fixed line (always the same spot); the file
239+
// name gets the line below, so it can grow/shrink without moving the number.
240+
if (installPercent != null) {
241+
installPercent.setVisibility(View.VISIBLE);
242+
installPercent.setText(st.percent + "%");
243+
}
244+
installDetail.setText(org.iiab.controller.deploy.domain.ExtractProgress.fileLabel(st.message));
238245
}
239246
} else {
240247
installStatus.setText(st.message.isEmpty() ? getString(R.string.k2go_setting_up_library) : st.message);

‎controller/app/src/main/res/layout/activity_library.xml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@
9898
android:progressTint="@color/k2go_teal"
9999
android:progressBackgroundTint="@color/k2go_hairline" />
100100

101+
<!-- ADFA-4910: extract % on its own fixed line (below the bar, above the changing
102+
file name) so the number never dances as the file name grows/shrinks. -->
103+
<TextView
104+
android:id="@+id/k2go_install_percent"
105+
android:layout_width="match_parent"
106+
android:layout_height="wrap_content"
107+
android:layout_marginTop="10dp"
108+
android:gravity="center"
109+
android:textAppearance="?attr/textAppearanceTitleMedium"
110+
android:textColor="@color/k2go_boot_ink"
111+
android:visibility="gone" />
112+
101113
<TextView
102114
android:id="@+id/k2go_install_detail"
103115
android:layout_width="match_parent"

0 commit comments

Comments
 (0)