diff --git a/controller/app/src/main/java/org/iiab/controller/install/domain/Eta.java b/controller/app/src/main/java/org/iiab/controller/install/domain/Eta.java new file mode 100644 index 000000000..473d806d1 --- /dev/null +++ b/controller/app/src/main/java/org/iiab/controller/install/domain/Eta.java @@ -0,0 +1,29 @@ +package org.iiab.controller.install.domain; + +/** + * ADFA-5228: a rounded, calm ETA for display. Pure — it carries the SHAPE (unknown / under a minute + * / N minutes), not the words, so the UI supplies localized strings and this stays JVM-testable. + * Rounding to whole minutes keeps the label from flickering second by second. + */ +public final class Eta { + + public enum Kind { UNKNOWN, UNDER_MINUTE, MINUTES } + + public final Kind kind; + /** Whole minutes; meaningful only when {@link #kind} is {@link Kind#MINUTES}. */ + public final int minutes; + + private Eta(Kind kind, int minutes) { + this.kind = kind; + this.minutes = minutes; + } + + /** @param seconds estimated seconds remaining, or negative for unknown. */ + public static Eta of(long seconds) { + if (seconds < 0L) return new Eta(Kind.UNKNOWN, 0); + if (seconds < 60L) return new Eta(Kind.UNDER_MINUTE, 0); + int mins = (int) Math.round(seconds / 60.0); + if (mins < 1) mins = 1; + return new Eta(Kind.MINUTES, mins); + } +} diff --git a/controller/app/src/main/java/org/iiab/controller/install/domain/RunroleEta.java b/controller/app/src/main/java/org/iiab/controller/install/domain/RunroleEta.java new file mode 100644 index 000000000..81a9a30a4 --- /dev/null +++ b/controller/app/src/main/java/org/iiab/controller/install/domain/RunroleEta.java @@ -0,0 +1,31 @@ +package org.iiab.controller.install.domain; + +/** + * ADFA-5228: estimate the seconds remaining for a running runrole. Pure JVM, unit-tested. + * + *

Prefers learned per-task durations (the sum of the remaining tasks' known times); when there + * is no history yet it falls back to the rate observed in THIS run (elapsed / tasks done, projected + * over the tasks left). No warm-up — a runrole is not a download, so the estimate shows as soon as + * there is anything to go on. + */ +public final class RunroleEta { + + private RunroleEta() {} + + /** + * @param remainingTasks tasks not yet reached (>= 0) + * @param knownRemainingSeconds sum of learned durations for the remaining tasks, or < 0 if unknown + * @param tasksDone tasks reached so far + * @param elapsedSeconds seconds since the run started + * @return estimated seconds remaining, or -1 when there is not enough information yet + */ + public static long secondsRemaining(int remainingTasks, long knownRemainingSeconds, + int tasksDone, long elapsedSeconds) { + if (remainingTasks <= 0) return 0L; + if (knownRemainingSeconds >= 0L) return knownRemainingSeconds; // learned estimate + if (tasksDone > 0 && elapsedSeconds > 0L) { // rate fallback (first run) + return Math.round((double) elapsedSeconds / tasksDone * remainingTasks); + } + return -1L; + } +} diff --git a/controller/app/src/main/java/org/iiab/controller/install/domain/RunroleProgress.java b/controller/app/src/main/java/org/iiab/controller/install/domain/RunroleProgress.java index a79925d29..55e25eea9 100644 --- a/controller/app/src/main/java/org/iiab/controller/install/domain/RunroleProgress.java +++ b/controller/app/src/main/java/org/iiab/controller/install/domain/RunroleProgress.java @@ -24,12 +24,17 @@ public final class RunroleProgress { public static final int LIFTOFF = 5; /** Ceiling while running: 95->100 is the finish, reached only via {@link #markComplete()}. */ public static final int CEIL = 95; + /** Warmup tasks (common/dependency tasks before the module's own) to reach {@link #LIFTOFF}. A + * heuristic, not derived from build logs (those run every role, so they don't model a single + * module's short warmup); the bar just needs to creep, not be exact. */ + public static final int WARMUP_TARGET = 10; private final Map indexByName; private final int total; private int furthest = -1; private boolean complete = false; private boolean sawMovement = false; + private int warmupTasks = 0; public RunroleProgress(List orderedTaskNames) { this.indexByName = new HashMap<>(); @@ -53,7 +58,11 @@ public void observe(String line) { String name = taskName(line); if (name == null) return; Integer idx = indexByName.get(name); - if (idx != null && idx > furthest) furthest = idx; + if (idx != null) { + if (idx > furthest) furthest = idx; + } else if (furthest < 0) { + warmupTasks++; // a pre-module (common/dependency) task: creep the liftoff + } } /** Mark the run finished (PLAY RECAP seen, or the process exited ok) so {@link #percent()} is 100. */ @@ -69,7 +78,11 @@ public int percent() { if (complete) return 100; if (total == 0) return 0; // no table -> caller stays indeterminate if (!sawMovement) return 0; // nothing has run yet - if (furthest < 0) return LIFTOFF; // moving, but no module task reached yet + if (furthest < 0) { // moving, but no module task reached yet: + // creep 1..LIFTOFF across the warmup so the bar isn't flat at the floor. + int p = (int) Math.round(LIFTOFF * Math.min(1.0, (double) warmupTasks / WARMUP_TARGET)); + return Math.max(1, Math.min(LIFTOFF, p)); + } int done = furthest + 1; // entering task i means i tasks have been reached int pct = LIFTOFF + (int) Math.round(done * (double) (CEIL - LIFTOFF) / total); if (pct < LIFTOFF) pct = LIFTOFF; @@ -83,13 +96,17 @@ public int percent() { /** Number of known tasks in the table (0 when none). */ public int total() { return total; } + /** How many known tasks have been reached so far (0..total) — the ETA uses this to know which + * tasks remain. */ + public int reached() { return furthest + 1; } + /** * Extract the task name from a {@code TASK [role : name] ***} line, or {@code null} if the line * isn't a task header. A role-less pre-task ({@code TASK [Gather facts] ***}) yields its bare * text, which simply won't be in any module table. Matches how the asset tables were extracted * (name = the text after {@code " : "}, up to the first {@code ']'}). */ - static String taskName(String line) { + public static String taskName(String line) { int open = line.indexOf("TASK ["); if (open < 0) return null; int start = open + 6; diff --git a/controller/app/src/main/java/org/iiab/controller/install/domain/RunroleTimings.java b/controller/app/src/main/java/org/iiab/controller/install/domain/RunroleTimings.java new file mode 100644 index 000000000..1d68fa357 --- /dev/null +++ b/controller/app/src/main/java/org/iiab/controller/install/domain/RunroleTimings.java @@ -0,0 +1,43 @@ +package org.iiab.controller.install.domain; + +import java.util.HashMap; +import java.util.Map; + +/** + * ADFA-5228: measures how long each runrole task takes on THIS device, so the ETA learns per-device + * instead of trusting build-log times (which vary by hardware). Pure JVM, unit-tested. + * + *

Fed one event per {@code TASK [role : name]} line: the previous task's duration is closed when + * the next task starts (a task lasts from its header to the next). Call {@link #finish(long)} when + * the run ends to close the last task. Durations are keyed by task name (matching the tables), and a + * repeated name keeps the last measurement. + */ +public final class RunroleTimings { + + private final Map durationMs = new HashMap<>(); + private String currentTask = null; + private long currentStartMs = 0L; + + /** A task header was seen at {@code nowMs}. Closes the previous task's duration. */ + public void onTask(String name, long nowMs) { + if (name == null) return; + if (currentTask != null) { + durationMs.put(currentTask, Math.max(0L, nowMs - currentStartMs)); + } + currentTask = name; + currentStartMs = nowMs; + } + + /** The run ended at {@code nowMs}. Closes the final task's duration. */ + public void finish(long nowMs) { + if (currentTask != null) { + durationMs.put(currentTask, Math.max(0L, nowMs - currentStartMs)); + currentTask = null; + } + } + + /** Measured durations (ms) for the tasks that completed this run, keyed by task name. */ + public Map durationsMs() { + return new HashMap<>(durationMs); + } +} diff --git a/controller/app/src/main/java/org/iiab/controller/install/presentation/EtaText.java b/controller/app/src/main/java/org/iiab/controller/install/presentation/EtaText.java new file mode 100644 index 000000000..c2547e6f2 --- /dev/null +++ b/controller/app/src/main/java/org/iiab/controller/install/presentation/EtaText.java @@ -0,0 +1,26 @@ +package org.iiab.controller.install.presentation; + +import android.content.Context; + +import org.iiab.controller.R; +import org.iiab.controller.install.domain.Eta; + +/** + * ADFA-5228: turns an ETA (seconds) into a short, localized, calm label for the progress caption. + * The rounding/shape decision is the pure {@link Eta}; this only maps it to strings, so both the + * module detail and the maps detail render the ETA the same way (no duplicated wording). + */ +public final class EtaText { + + private EtaText() {} + + /** "under a min" / "~N min" / "" (unknown). */ + public static String of(Context ctx, long etaSeconds) { + Eta e = Eta.of(etaSeconds); + switch (e.kind) { + case UNDER_MINUTE: return ctx.getString(R.string.k2go_eta_under_min); + case MINUTES: return ctx.getString(R.string.k2go_eta_minutes_fmt, e.minutes); + default: return ""; // UNKNOWN -> blank slot + } + } +} diff --git a/controller/app/src/main/java/org/iiab/controller/install/presentation/InstallService.java b/controller/app/src/main/java/org/iiab/controller/install/presentation/InstallService.java index 70a7fbdd0..5d74d73fe 100644 --- a/controller/app/src/main/java/org/iiab/controller/install/presentation/InstallService.java +++ b/controller/app/src/main/java/org/iiab/controller/install/presentation/InstallService.java @@ -913,8 +913,14 @@ private void installNextModule() { // module's ordered task names (assets/runrole/.txt); with no table the progress stays // indeterminate and the row keeps its spinner. remaining/lastPct are captured for the // worker-thread output callback below. + final java.util.List tasks = RunroleTables.tasksFor(this, roleName); final org.iiab.controller.install.domain.RunroleProgress progress = - new org.iiab.controller.install.domain.RunroleProgress(RunroleTables.tasksFor(this, roleName)); + new org.iiab.controller.install.domain.RunroleProgress(tasks); + // ADFA-5228: learned per-task durations for the ETA + a fresh timer for this run. + final java.util.Map learned = RunroleDurationStore.load(this, roleName); + final org.iiab.controller.install.domain.RunroleTimings timings = + new org.iiab.controller.install.domain.RunroleTimings(); + final long startMs = System.currentTimeMillis(); final int remainingSnapshot = moduleQueue.size(); final int[] lastPct = { Integer.MIN_VALUE }; if (progress.hasTable()) { @@ -942,10 +948,13 @@ public void onOutputLine(String line) { // percent change so LiveData isn't spammed per output line. if (progress.hasTable()) { progress.observe(line); + String tn = org.iiab.controller.install.domain.RunroleProgress.taskName(line); + if (tn != null) timings.onTask(tn, System.currentTimeMillis()); int pct = progress.percent(); if (pct != lastPct[0]) { lastPct[0] = pct; - ModuleQueueRepository.get().postRunning(nextModule, remainingSnapshot, pct); + long eta = estimateEtaSeconds(progress, tasks, learned, startMs); + ModuleQueueRepository.get().postRunning(nextModule, remainingSnapshot, pct, eta); } } } @@ -965,7 +974,11 @@ public void onProcessExit(int exitCode) { // above). The next installNextModule() supersedes it with the following module's // state, so this only lingers on the just-finished module's own detail view. if (progress.hasTable()) { - ModuleQueueRepository.get().postRunning(nextModule, remainingSnapshot, 100); + // ADFA-5228: close the timings and blend them into the per-role store so the + // next install's ETA is sharper; finish the bar at exactly 100. + timings.finish(System.currentTimeMillis()); + RunroleDurationStore.blendAndSave(InstallService.this, roleName, timings.durationsMs()); + ModuleQueueRepository.get().postRunning(nextModule, remainingSnapshot, 100, 0L); } org.iiab.controller.analytics.AnalyticsClient.with(InstallService.this).logModuleInstall(nextModule, true); installNextModule(); @@ -986,6 +999,33 @@ public void onError(String error) { }); } + /** + * ADFA-5228: seconds remaining for the current module — the learned durations of the remaining + * tasks when all are known, otherwise the rate observed in this run. Pure delegation to + * {@link org.iiab.controller.install.domain.RunroleEta}; returns -1 when there's nothing to go on. + */ + private static long estimateEtaSeconds(org.iiab.controller.install.domain.RunroleProgress progress, + java.util.List tasks, + java.util.Map learned, long startMs) { + int total = progress.total(); + int reached = progress.reached(); + int remaining = total - reached; + long knownRemainingSec = -1L; + if (!learned.isEmpty() && remaining > 0 && tasks != null) { + long sumMs = 0L; + boolean allKnown = true; + for (int i = reached; i < tasks.size(); i++) { + Long d = learned.get(tasks.get(i)); + if (d == null) { allKnown = false; break; } + sumMs += d; + } + if (allKnown) knownRemainingSec = Math.round(sumMs / 1000.0); + } + long elapsedSec = Math.max(0L, (System.currentTimeMillis() - startMs) / 1000L); + return org.iiab.controller.install.domain.RunroleEta.secondsRemaining( + remaining, knownRemainingSec, reached, elapsedSec); + } + /** * ADFA-4435: roll back the speculative local_vars edit made before runrole, so a failed * install is not left looking installed/enabled. Always runs {@code then} afterwards. diff --git a/controller/app/src/main/java/org/iiab/controller/install/presentation/ModuleQueueRepository.java b/controller/app/src/main/java/org/iiab/controller/install/presentation/ModuleQueueRepository.java index 79f5c2761..f5d431568 100644 --- a/controller/app/src/main/java/org/iiab/controller/install/presentation/ModuleQueueRepository.java +++ b/controller/app/src/main/java/org/iiab/controller/install/presentation/ModuleQueueRepository.java @@ -62,6 +62,8 @@ public boolean isInstalling(String moduleKey) { public void postRunning(String currentModule, int remaining) { post(ModuleQueueState.running(currentModule, remaining)); } /** ADFA-5228: running with a determinate percent (0..100) for the current module's runrole. */ public void postRunning(String currentModule, int remaining, int percent) { post(ModuleQueueState.running(currentModule, remaining, percent)); } + /** ADFA-5228: running with a determinate percent and an estimated seconds-remaining. */ + public void postRunning(String currentModule, int remaining, int percent, long etaSeconds) { post(ModuleQueueState.running(currentModule, remaining, percent, etaSeconds)); } public void postDone(List failedModules) { post(ModuleQueueState.done(failedModules)); } public void postIdle() { post(ModuleQueueState.idle()); } diff --git a/controller/app/src/main/java/org/iiab/controller/install/presentation/ModuleQueueState.java b/controller/app/src/main/java/org/iiab/controller/install/presentation/ModuleQueueState.java index 7891d608f..8c22a5c7e 100644 --- a/controller/app/src/main/java/org/iiab/controller/install/presentation/ModuleQueueState.java +++ b/controller/app/src/main/java/org/iiab/controller/install/presentation/ModuleQueueState.java @@ -26,6 +26,8 @@ public enum Phase { IDLE, RUNNING, DONE } /** Sentinel for "no determinate progress" — the current module runs indeterminate. */ public static final int INDETERMINATE = -1; + /** ADFA-5228: sentinel for "no ETA yet". */ + public static final long ETA_UNKNOWN = -1L; public final Phase phase; /** The module (yamlBaseKey) whose runrole is executing right now, or null. */ @@ -37,17 +39,20 @@ public enum Phase { IDLE, RUNNING, DONE } * {@link #INDETERMINATE} (-1) when there is no task table for it (fall back to a spinner). */ public final int percent; + /** ADFA-5228: estimated seconds remaining for the current module, or {@link #ETA_UNKNOWN}. */ + public final long etaSeconds; /** Modules whose runrole failed in this batch. Only meaningful on DONE. */ public final List failedModules; /** Monotonic sequence for one-shot effects (finish/fail snackbars exactly once). */ public final long seq; private ModuleQueueState(Phase phase, String currentModule, int remaining, int percent, - List failedModules, long seq) { + long etaSeconds, List failedModules, long seq) { this.phase = phase; this.currentModule = currentModule; this.remaining = Math.max(0, remaining); this.percent = percent; + this.etaSeconds = etaSeconds; this.failedModules = failedModules != null ? Collections.unmodifiableList(failedModules) : Collections.emptyList(); @@ -64,24 +69,29 @@ public boolean isInstalling(String moduleKey) { } public static ModuleQueueState idle() { - return new ModuleQueueState(Phase.IDLE, null, 0, INDETERMINATE, null, 0L); + return new ModuleQueueState(Phase.IDLE, null, 0, INDETERMINATE, ETA_UNKNOWN, null, 0L); } /** Running with no determinate progress (indeterminate spinner). */ public static ModuleQueueState running(String currentModule, int remaining) { - return running(currentModule, remaining, INDETERMINATE); + return running(currentModule, remaining, INDETERMINATE, ETA_UNKNOWN); } - /** ADFA-5228: running with a determinate percent (0..100) for the current module. */ + /** ADFA-5228: running with a determinate percent (0..100), no ETA. */ public static ModuleQueueState running(String currentModule, int remaining, int percent) { - return new ModuleQueueState(Phase.RUNNING, currentModule, remaining, percent, null, 0L); + return running(currentModule, remaining, percent, ETA_UNKNOWN); + } + + /** ADFA-5228: running with a determinate percent and an estimated seconds-remaining. */ + public static ModuleQueueState running(String currentModule, int remaining, int percent, long etaSeconds) { + return new ModuleQueueState(Phase.RUNNING, currentModule, remaining, percent, etaSeconds, null, 0L); } public static ModuleQueueState done(List failedModules) { - return new ModuleQueueState(Phase.DONE, null, 0, INDETERMINATE, failedModules, 0L); + return new ModuleQueueState(Phase.DONE, null, 0, INDETERMINATE, ETA_UNKNOWN, failedModules, 0L); } ModuleQueueState withSeq(long seq) { - return new ModuleQueueState(phase, currentModule, remaining, percent, failedModules, seq); + return new ModuleQueueState(phase, currentModule, remaining, percent, etaSeconds, failedModules, seq); } } diff --git a/controller/app/src/main/java/org/iiab/controller/install/presentation/RunroleDurationStore.java b/controller/app/src/main/java/org/iiab/controller/install/presentation/RunroleDurationStore.java new file mode 100644 index 000000000..8fb0eaacc --- /dev/null +++ b/controller/app/src/main/java/org/iiab/controller/install/presentation/RunroleDurationStore.java @@ -0,0 +1,55 @@ +package org.iiab.controller.install.presentation; + +import android.content.Context; + +import org.json.JSONObject; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +/** + * ADFA-5228: per-device, per-role learned task durations for the ETA. Stored as one JSON object per + * role in SharedPreferences ({@code {taskName: ms}}). Blended with a simple moving average so a + * one-off spike doesn't dominate and the estimate converges over installs. Device-specific by + * design — build-log times aren't portable across hardware. + */ +public final class RunroleDurationStore { + + private static final String PREFS = "runrole_timings"; + private static final double ALPHA = 0.5; // weight of the newest measurement vs the stored one + + private RunroleDurationStore() {} + + /** Learned durations (ms) for a role, keyed by task name. Empty when nothing learned yet. */ + public static Map load(Context ctx, String role) { + Map out = new HashMap<>(); + if (ctx == null || role == null || role.isEmpty()) return out; + String json = ctx.getSharedPreferences(PREFS, Context.MODE_PRIVATE).getString(role, null); + if (json == null) return out; + try { + JSONObject o = new JSONObject(json); + for (Iterator it = o.keys(); it.hasNext(); ) { + String k = it.next(); + out.put(k, o.getLong(k)); + } + } catch (Exception ignored) { } + return out; + } + + /** Blend this run's measured durations into the stored average and persist. */ + public static void blendAndSave(Context ctx, String role, Map measured) { + if (ctx == null || role == null || role.isEmpty() || measured == null || measured.isEmpty()) return; + Map merged = load(ctx, role); + for (Map.Entry e : measured.entrySet()) { + long m = Math.max(0L, e.getValue()); + Long old = merged.get(e.getKey()); + merged.put(e.getKey(), old == null ? m : Math.round(ALPHA * m + (1 - ALPHA) * old)); + } + try { + JSONObject o = new JSONObject(); + for (Map.Entry e : merged.entrySet()) o.put(e.getKey(), (long) e.getValue()); + ctx.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().putString(role, o.toString()).apply(); + } catch (Exception ignored) { } + } +} diff --git a/controller/app/src/main/java/org/iiab/controller/redesign/MapsPreparingFragment.java b/controller/app/src/main/java/org/iiab/controller/redesign/MapsPreparingFragment.java index 67732d880..693081e36 100644 --- a/controller/app/src/main/java/org/iiab/controller/redesign/MapsPreparingFragment.java +++ b/controller/app/src/main/java/org/iiab/controller/redesign/MapsPreparingFragment.java @@ -62,7 +62,7 @@ public static MapsPreparingFragment newInstance(boolean fromIndex) { private TextView status; private View progressRow; // ADFA-5228 private com.google.android.material.progressindicator.LinearProgressIndicator progress; - private TextView progressPct; + private TextView progressPct, progressEta; private boolean fromIndex = false; // ADFA-4901: hosted by the Finishing-setup index (observe only) private boolean launched = false; // ADFA-4900: guard against re-launching maps on view recreation @@ -88,6 +88,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c progressRow = root.findViewById(R.id.k2go_prep_progress_row); // ADFA-5228 progress = root.findViewById(R.id.k2go_prep_progress); progressPct = root.findViewById(R.id.k2go_prep_progress_pct); + progressEta = root.findViewById(R.id.k2go_prep_progress_eta); // ADFA-4919: the fromIndex=false branch below is the DEPRECATED standalone Get More route // (its own "Run in background", no index, no gate). Get More now routes through the install @@ -129,6 +130,7 @@ && getActivity() instanceof SetupLibraryActivity if (showBar) { progress.setProgressCompat(st.percent, true); progressPct.setText(st.percent + "%"); + progressEta.setText(org.iiab.controller.install.presentation.EtaText.of(requireContext(), st.etaSeconds)); } } if (st.phase == ModuleQueueState.Phase.RUNNING) { diff --git a/controller/app/src/main/java/org/iiab/controller/redesign/ModuleInstallFragment.java b/controller/app/src/main/java/org/iiab/controller/redesign/ModuleInstallFragment.java index 85e774033..7cf00e011 100644 --- a/controller/app/src/main/java/org/iiab/controller/redesign/ModuleInstallFragment.java +++ b/controller/app/src/main/java/org/iiab/controller/redesign/ModuleInstallFragment.java @@ -51,7 +51,7 @@ public static ModuleInstallFragment newInstance(String yamlBaseKey) { private TextView status, logText, logLabel; private View progressRow; // ADFA-5228 private com.google.android.material.progressindicator.LinearProgressIndicator progress; - private TextView progressPct; + private TextView progressPct, progressEta; private ScrollView logScroll; private ImageView logChevron; private boolean logExpanded = false; @@ -73,6 +73,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c progressRow = root.findViewById(R.id.k2go_modinst_progress_row); // ADFA-5228 progress = root.findViewById(R.id.k2go_modinst_progress); progressPct = root.findViewById(R.id.k2go_modinst_progress_pct); + progressEta = root.findViewById(R.id.k2go_modinst_progress_eta); logLabel = root.findViewById(R.id.k2go_modinst_log_label); // ADFA-5074: the key is passed so a module that earns its own art can be matched. org.iiab.controller.util.ProgressVisuals.applyForModule(root, key); @@ -120,6 +121,7 @@ private void updateStatus() { if (showBar) { progress.setProgressCompat(mq.percent, true); progressPct.setText(mq.percent + "%"); + progressEta.setText(org.iiab.controller.install.presentation.EtaText.of(requireContext(), mq.etaSeconds)); } } diff --git a/controller/app/src/main/res/layout/fragment_k2go_maps_preparing.xml b/controller/app/src/main/res/layout/fragment_k2go_maps_preparing.xml index cd016e96b..4350e611f 100644 --- a/controller/app/src/main/res/layout/fragment_k2go_maps_preparing.xml +++ b/controller/app/src/main/res/layout/fragment_k2go_maps_preparing.xml @@ -55,14 +55,28 @@ android:max="100" android:indeterminate="false" /> - + android:orientation="horizontal"> + + + + + diff --git a/controller/app/src/main/res/layout/fragment_k2go_module_install.xml b/controller/app/src/main/res/layout/fragment_k2go_module_install.xml index b49d427aa..ce4f30f7f 100644 --- a/controller/app/src/main/res/layout/fragment_k2go_module_install.xml +++ b/controller/app/src/main/res/layout/fragment_k2go_module_install.xml @@ -63,14 +63,28 @@ android:indeterminate="false" app:trackCornerRadius="4dp" /> - + android:orientation="horizontal"> + + + + + يتم التثبيت على جهازك مع إيقاف الخادم مؤقتًا.\n\n• يستغرق بعض الوقت، غالبًا عشرات الدقائق.\n• حافظ على اتصال مستقر إن أمكن.\n• تأكد من وجود بطارية كافية قبل البدء.\n• تظل هذه الشاشة مفتوحة حتى الانتهاء. تثبيت ليس الآن + + أقل من دقيقة + ~%1$d دقيقة diff --git a/controller/app/src/main/res/values-az/strings_k2go.xml b/controller/app/src/main/res/values-az/strings_k2go.xml index 96552b90a..2874d5d92 100644 --- a/controller/app/src/main/res/values-az/strings_k2go.xml +++ b/controller/app/src/main/res/values-az/strings_k2go.xml @@ -828,4 +828,7 @@ Bu, server dayandırılmış halda cihazınıza quraşdırılır.\n\n• Bir qədər vaxt aparır, çox vaxt onlarla dəqiqə.\n• Mümkünsə sabit bağlantı saxlayın.\n• Başlamazdan əvvəl kifayət qədər batareya olduğundan əmin olun.\n• Bu ekran bitənə qədər açıq qalır. Quraşdır İndi yox + + 1 dəqiqədən az + ~%1$d dəq diff --git a/controller/app/src/main/res/values-bg/strings_k2go.xml b/controller/app/src/main/res/values-bg/strings_k2go.xml index 647299e45..90b3cac85 100644 --- a/controller/app/src/main/res/values-bg/strings_k2go.xml +++ b/controller/app/src/main/res/values-bg/strings_k2go.xml @@ -828,4 +828,7 @@ Инсталира се на вашето устройство със спрян сървър.\n\n• Отнема известно време, често десетки минути.\n• Ако е възможно, поддържайте стабилна връзка.\n• Уверете се, че имате достатъчно батерия преди да започнете.\n• Този екран остава отворен до приключване. Инсталиране Не сега + + под 1 мин + ~%1$d мин diff --git a/controller/app/src/main/res/values-bn/strings_k2go.xml b/controller/app/src/main/res/values-bn/strings_k2go.xml index ae82af1c8..60e74dcf8 100644 --- a/controller/app/src/main/res/values-bn/strings_k2go.xml +++ b/controller/app/src/main/res/values-bn/strings_k2go.xml @@ -828,4 +828,7 @@ সার্ভার বিরতিতে থাকা অবস্থায় এটি আপনার ডিভাইসে ইনস্টল হয়।\n\n• কিছুটা সময় লাগে, প্রায়ই কয়েক দশ মিনিট।\n• সম্ভব হলে স্থিতিশীল সংযোগ রাখুন।\n• শুরুর আগে পর্যাপ্ত ব্যাটারি রাখুন।\n• শেষ না হওয়া পর্যন্ত এই স্ক্রিন খোলা থাকে। ইনস্টল এখন নয় + + ১ মিনিটের কম + ~%1$d মিনিট diff --git a/controller/app/src/main/res/values-cs/strings_k2go.xml b/controller/app/src/main/res/values-cs/strings_k2go.xml index 246584ac5..060131e7b 100644 --- a/controller/app/src/main/res/values-cs/strings_k2go.xml +++ b/controller/app/src/main/res/values-cs/strings_k2go.xml @@ -828,4 +828,7 @@ Instalace proběhne ve vašem zařízení s pozastaveným serverem.\n\n• Chvíli to trvá, často desítky minut.\n• Pokud můžete, udržujte stabilní připojení.\n• Před začátkem mějte dostatek baterie.\n• Tato obrazovka zůstane otevřená až do konce. Nainstalovat Teď ne + + méně než 1 min + ~%1$d min diff --git a/controller/app/src/main/res/values-de/strings_k2go.xml b/controller/app/src/main/res/values-de/strings_k2go.xml index 7e5721bb0..260d794d7 100644 --- a/controller/app/src/main/res/values-de/strings_k2go.xml +++ b/controller/app/src/main/res/values-de/strings_k2go.xml @@ -829,4 +829,7 @@ Dies wird auf deinem Gerät installiert, während der Server pausiert.\n\n• Dauert eine Weile – oft mehrere zehn Minuten.\n• Halte nach Möglichkeit eine stabile Verbindung.\n• Sorge vor dem Start für ausreichend Akku.\n• Dieser Bildschirm bleibt bis zum Ende geöffnet. Installieren Jetzt nicht + + unter 1 Min. + ~%1$d Min. diff --git a/controller/app/src/main/res/values-el/strings_k2go.xml b/controller/app/src/main/res/values-el/strings_k2go.xml index 11fd522ac..2c8e547f4 100644 --- a/controller/app/src/main/res/values-el/strings_k2go.xml +++ b/controller/app/src/main/res/values-el/strings_k2go.xml @@ -829,4 +829,7 @@ Η εγκατάσταση γίνεται στη συσκευή σας με τον διακομιστή σε παύση.\n\n• Διαρκεί λίγη ώρα, συχνά δεκάδες λεπτά.\n• Διατηρήστε σταθερή σύνδεση αν μπορείτε.\n• Φροντίστε να έχετε αρκετή μπαταρία πριν ξεκινήσετε.\n• Αυτή η οθόνη παραμένει ανοιχτή μέχρι να ολοκληρωθεί. Εγκατάσταση Όχι τώρα + + λιγότερο από 1 λεπτό + ~%1$d λεπτά diff --git a/controller/app/src/main/res/values-es/strings_k2go.xml b/controller/app/src/main/res/values-es/strings_k2go.xml index 3ff4f2f53..46d2023a4 100644 --- a/controller/app/src/main/res/values-es/strings_k2go.xml +++ b/controller/app/src/main/res/values-es/strings_k2go.xml @@ -828,4 +828,7 @@ Esto se instala en tu dispositivo con el servidor en pausa.\n\n• Tarda un rato, a menudo decenas de minutos.\n• Mantén una conexión estable si puedes.\n• Ten suficiente batería antes de empezar.\n• Esta pantalla permanece abierta hasta que termine. Instalar Ahora no + + menos de 1 min + ~%1$d min diff --git a/controller/app/src/main/res/values-fa/strings_k2go.xml b/controller/app/src/main/res/values-fa/strings_k2go.xml index 64765d369..cf17e9e2e 100644 --- a/controller/app/src/main/res/values-fa/strings_k2go.xml +++ b/controller/app/src/main/res/values-fa/strings_k2go.xml @@ -828,4 +828,7 @@ این روی دستگاه شما و با سرور متوقف‌شده نصب می‌شود.\n\n• کمی طول می‌کشد، اغلب ده‌ها دقیقه.\n• در صورت امکان اتصال پایدار داشته باشید.\n• پیش از شروع از کافی بودن باتری مطمئن شوید.\n• این صفحه تا پایان کار باز می‌ماند. نصب حالا نه + + کمتر از ۱ دقیقه + ~%1$d دقیقه diff --git a/controller/app/src/main/res/values-fr/strings_k2go.xml b/controller/app/src/main/res/values-fr/strings_k2go.xml index 9884047f3..01fca27be 100644 --- a/controller/app/src/main/res/values-fr/strings_k2go.xml +++ b/controller/app/src/main/res/values-fr/strings_k2go.xml @@ -838,4 +838,7 @@ L\'installation se fait sur votre appareil avec le serveur en pause.\n\n• Cela prend du temps, souvent des dizaines de minutes.\n• Gardez une connexion stable si possible.\n• Assurez-vous d\'avoir assez de batterie avant de commencer.\n• Cet écran reste ouvert jusqu\'à la fin. Installer Pas maintenant + + moins d\'1 min + ~%1$d min diff --git a/controller/app/src/main/res/values-gu/strings_k2go.xml b/controller/app/src/main/res/values-gu/strings_k2go.xml index b79ac901e..9de792bbe 100644 --- a/controller/app/src/main/res/values-gu/strings_k2go.xml +++ b/controller/app/src/main/res/values-gu/strings_k2go.xml @@ -828,4 +828,7 @@ સર્વર થોભાવેલું હોય ત્યારે આ તમારા ઉપકરણ પર ઇન્સ્ટૉલ થાય છે.\n\n• થોડો સમય લાગે છે, ઘણી વાર દસેક મિનિટ.\n• શક્ય હોય તો સ્થિર કનેક્શન રાખો.\n• શરૂ કરતાં પહેલાં પૂરતી બૅટરી રાખો.\n• આ સ્ક્રીન પૂરું થાય ત્યાં સુધી ખુલ્લી રહે છે. ઇન્સ્ટૉલ કરો હમણાં નહીં + + 1 મિનિટથી ઓછું + ~%1$d મિનિટ diff --git a/controller/app/src/main/res/values-hi/strings_k2go.xml b/controller/app/src/main/res/values-hi/strings_k2go.xml index 84c5012bd..362c22f7e 100644 --- a/controller/app/src/main/res/values-hi/strings_k2go.xml +++ b/controller/app/src/main/res/values-hi/strings_k2go.xml @@ -828,4 +828,7 @@ यह सर्वर रुका होने पर आपके डिवाइस पर इंस्टॉल होता है।\n\n• इसमें समय लगता है, अक्सर दसियों मिनट।\n• हो सके तो स्थिर कनेक्शन बनाए रखें।\n• शुरू करने से पहले पर्याप्त बैटरी रखें।\n• यह स्क्रीन पूरा होने तक खुली रहती है। इंस्टॉल करें अभी नहीं + + 1 मिनट से कम + ~%1$d मिनट diff --git a/controller/app/src/main/res/values-hu/strings_k2go.xml b/controller/app/src/main/res/values-hu/strings_k2go.xml index 44d06eb3f..0857921b2 100644 --- a/controller/app/src/main/res/values-hu/strings_k2go.xml +++ b/controller/app/src/main/res/values-hu/strings_k2go.xml @@ -828,4 +828,7 @@ A telepítés az eszközön történik, a kiszolgáló szüneteltetve.\n\n• Eltart egy ideig, gyakran több tíz percig.\n• Ha lehet, tartson stabil kapcsolatot.\n• Indítás előtt legyen elég akkumulátor.\n• Ez a képernyő a befejezésig nyitva marad. Telepítés Most nem + + kevesebb mint 1 perc + ~%1$d perc diff --git a/controller/app/src/main/res/values-in/strings_k2go.xml b/controller/app/src/main/res/values-in/strings_k2go.xml index 71efcba9d..4dc892277 100644 --- a/controller/app/src/main/res/values-in/strings_k2go.xml +++ b/controller/app/src/main/res/values-in/strings_k2go.xml @@ -828,4 +828,7 @@ Ini dipasang di perangkat Anda saat server dijeda.\n\n• Perlu waktu, sering kali puluhan menit.\n• Jaga koneksi tetap stabil jika bisa.\n• Pastikan baterai cukup sebelum memulai.\n• Layar ini tetap terbuka sampai selesai. Pasang Nanti saja + + kurang dari 1 mnt + ~%1$d mnt diff --git a/controller/app/src/main/res/values-it/strings_k2go.xml b/controller/app/src/main/res/values-it/strings_k2go.xml index 4ea173924..b41942fba 100644 --- a/controller/app/src/main/res/values-it/strings_k2go.xml +++ b/controller/app/src/main/res/values-it/strings_k2go.xml @@ -828,4 +828,7 @@ L\'installazione avviene sul dispositivo con il server in pausa.\n\n• Richiede tempo, spesso decine di minuti.\n• Mantieni una connessione stabile se puoi.\n• Assicurati di avere batteria sufficiente prima di iniziare.\n• Questa schermata resta aperta fino al termine. Installa Non ora + + meno di 1 min + ~%1$d min diff --git a/controller/app/src/main/res/values-ja/strings_k2go.xml b/controller/app/src/main/res/values-ja/strings_k2go.xml index d873edc6d..9a29087ad 100644 --- a/controller/app/src/main/res/values-ja/strings_k2go.xml +++ b/controller/app/src/main/res/values-ja/strings_k2go.xml @@ -828,4 +828,7 @@ これはサーバーを一時停止した状態で端末にインストールされます。\n\n• 時間がかかります。多くの場合数十分です。\n• 可能であれば安定した接続を保ってください。\n• 開始前に十分なバッテリーを確保してください。\n• 完了するまでこの画面は開いたままになります。 インストール 後で + + 1分未満 + 約%1$d分 diff --git a/controller/app/src/main/res/values-ko/strings_k2go.xml b/controller/app/src/main/res/values-ko/strings_k2go.xml index c07179ac2..ebcab71d9 100644 --- a/controller/app/src/main/res/values-ko/strings_k2go.xml +++ b/controller/app/src/main/res/values-ko/strings_k2go.xml @@ -828,4 +828,7 @@ 서버가 일시 중지된 상태에서 기기에 설치됩니다.\n\n• 시간이 걸리며, 보통 수십 분입니다.\n• 가능하면 안정적인 연결을 유지하세요.\n• 시작하기 전에 배터리가 충분한지 확인하세요.\n• 완료될 때까지 이 화면은 열려 있습니다. 설치 나중에 + + 1분 미만 + ~%1$d분 diff --git a/controller/app/src/main/res/values-lt/strings_k2go.xml b/controller/app/src/main/res/values-lt/strings_k2go.xml index b51260f59..25eb83bfc 100644 --- a/controller/app/src/main/res/values-lt/strings_k2go.xml +++ b/controller/app/src/main/res/values-lt/strings_k2go.xml @@ -838,4 +838,7 @@ Diegiama jūsų įrenginyje, kai serveris pristabdytas.\n\n• Užtrunka kurį laiką, dažnai kelias dešimtis minučių.\n• Jei galite, palaikykite stabilų ryšį.\n• Prieš pradėdami įsitikinkite, kad pakanka baterijos.\n• Šis ekranas lieka atidarytas iki pabaigos. Įdiegti Ne dabar + + mažiau nei 1 min + ~%1$d min diff --git a/controller/app/src/main/res/values-nl/strings_k2go.xml b/controller/app/src/main/res/values-nl/strings_k2go.xml index d72e89148..b227ed136 100644 --- a/controller/app/src/main/res/values-nl/strings_k2go.xml +++ b/controller/app/src/main/res/values-nl/strings_k2go.xml @@ -828,4 +828,7 @@ Dit wordt op je apparaat geïnstalleerd terwijl de server is gepauzeerd.\n\n• Duurt even, vaak tientallen minuten.\n• Houd indien mogelijk een stabiele verbinding.\n• Zorg voor voldoende batterij voordat je begint.\n• Dit scherm blijft open tot het klaar is. Installeren Niet nu + + minder dan 1 min + ~%1$d min diff --git a/controller/app/src/main/res/values-no/strings_k2go.xml b/controller/app/src/main/res/values-no/strings_k2go.xml index 86bd4e496..a8c2937c2 100644 --- a/controller/app/src/main/res/values-no/strings_k2go.xml +++ b/controller/app/src/main/res/values-no/strings_k2go.xml @@ -838,4 +838,7 @@ Dette installeres på enheten din mens serveren er satt på pause.\n\n• Tar en stund, ofte titalls minutter.\n• Hold en stabil tilkobling hvis du kan.\n• Sørg for nok batteri før du starter.\n• Denne skjermen forblir åpen til den er ferdig. Installer Ikke nå + + under 1 min + ~%1$d min diff --git a/controller/app/src/main/res/values-pl/strings_k2go.xml b/controller/app/src/main/res/values-pl/strings_k2go.xml index e4263f620..5e6b3f9ea 100644 --- a/controller/app/src/main/res/values-pl/strings_k2go.xml +++ b/controller/app/src/main/res/values-pl/strings_k2go.xml @@ -838,4 +838,7 @@ Instalacja odbywa się na Twoim urządzeniu przy wstrzymanym serwerze.\n\n• Trwa to chwilę, często kilkadziesiąt minut.\n• W miarę możliwości utrzymuj stabilne połączenie.\n• Zadbaj o wystarczający poziom baterii przed rozpoczęciem.\n• Ten ekran pozostaje otwarty do zakończenia. Zainstaluj Nie teraz + + mniej niż 1 min + ~%1$d min diff --git a/controller/app/src/main/res/values-pt/strings_k2go.xml b/controller/app/src/main/res/values-pt/strings_k2go.xml index 37551074b..107675077 100644 --- a/controller/app/src/main/res/values-pt/strings_k2go.xml +++ b/controller/app/src/main/res/values-pt/strings_k2go.xml @@ -828,4 +828,7 @@ Isto é instalado no seu dispositivo com o servidor pausado.\n\n• Demora um tempo, muitas vezes dezenas de minutos.\n• Mantenha uma conexão estável se possível.\n• Tenha bateria suficiente antes de começar.\n• Esta tela permanece aberta até terminar. Instalar Agora não + + menos de 1 min + ~%1$d min diff --git a/controller/app/src/main/res/values-ro/strings_k2go.xml b/controller/app/src/main/res/values-ro/strings_k2go.xml index 2921fe38d..73d56d20b 100644 --- a/controller/app/src/main/res/values-ro/strings_k2go.xml +++ b/controller/app/src/main/res/values-ro/strings_k2go.xml @@ -828,4 +828,7 @@ Se instalează pe dispozitivul dvs. cu serverul în pauză.\n\n• Durează un timp, adesea zeci de minute.\n• Păstrați o conexiune stabilă dacă puteți.\n• Asigurați-vă că aveți suficientă baterie înainte de a începe.\n• Acest ecran rămâne deschis până la finalizare. Instalați Nu acum + + sub 1 min + ~%1$d min diff --git a/controller/app/src/main/res/values-ru-rRU/strings_k2go.xml b/controller/app/src/main/res/values-ru-rRU/strings_k2go.xml index c601d8e98..e027f41ba 100644 --- a/controller/app/src/main/res/values-ru-rRU/strings_k2go.xml +++ b/controller/app/src/main/res/values-ru-rRU/strings_k2go.xml @@ -828,4 +828,7 @@ Установка выполняется на вашем устройстве с приостановленным сервером.\n\n• Занимает некоторое время, часто десятки минут.\n• По возможности сохраняйте стабильное соединение.\n• Убедитесь, что заряда батареи достаточно.\n• Этот экран остаётся открытым до завершения. Установить Не сейчас + + меньше 1 мин + ~%1$d мин diff --git a/controller/app/src/main/res/values-sk/strings_k2go.xml b/controller/app/src/main/res/values-sk/strings_k2go.xml index 85a3149cb..3a3021687 100644 --- a/controller/app/src/main/res/values-sk/strings_k2go.xml +++ b/controller/app/src/main/res/values-sk/strings_k2go.xml @@ -828,4 +828,7 @@ Inštalácia prebehne vo vašom zariadení s pozastaveným serverom.\n\n• Chvíľu to trvá, často desiatky minút.\n• Ak môžete, udržujte stabilné pripojenie.\n• Pred začatím majte dostatok batérie.\n• Táto obrazovka zostane otvorená až do konca. Nainštalovať Teraz nie + + menej než 1 min + ~%1$d min diff --git a/controller/app/src/main/res/values-sr/strings_k2go.xml b/controller/app/src/main/res/values-sr/strings_k2go.xml index 6af69eee0..5d1eb3302 100644 --- a/controller/app/src/main/res/values-sr/strings_k2go.xml +++ b/controller/app/src/main/res/values-sr/strings_k2go.xml @@ -828,4 +828,7 @@ Инсталира се на вашем уређају док је сервер паузиран.\n\n• Траје неко време, често десетине минута.\n• Ако можете, одржавајте стабилну везу.\n• Пре почетка обезбедите довољно батерије.\n• Овај екран остаје отворен до завршетка. Инсталирај Не сада + + мање од 1 мин + ~%1$d мин diff --git a/controller/app/src/main/res/values-sw/strings_k2go.xml b/controller/app/src/main/res/values-sw/strings_k2go.xml index d662f85d9..3339130c7 100644 --- a/controller/app/src/main/res/values-sw/strings_k2go.xml +++ b/controller/app/src/main/res/values-sw/strings_k2go.xml @@ -828,4 +828,7 @@ Hii inasakinishwa kwenye kifaa chako huku seva ikiwa imesitishwa.\n\n• Huchukua muda, mara nyingi makumi ya dakika.\n• Dumisha muunganisho thabiti ikiwezekana.\n• Hakikisha una betri ya kutosha kabla ya kuanza.\n• Skrini hii inabaki wazi hadi imalize. Sakinisha Si sasa + + chini ya dakika 1 + ~dakika %1$d diff --git a/controller/app/src/main/res/values-ta/strings_k2go.xml b/controller/app/src/main/res/values-ta/strings_k2go.xml index d6798fb8a..0927bff5a 100644 --- a/controller/app/src/main/res/values-ta/strings_k2go.xml +++ b/controller/app/src/main/res/values-ta/strings_k2go.xml @@ -828,4 +828,7 @@ சேவையகம் இடைநிறுத்தப்பட்ட நிலையில் இது உங்கள் சாதனத்தில் நிறுவப்படும்.\n\n• சிறிது நேரம் ஆகும், பெரும்பாலும் பல பத்து நிமிடங்கள்.\n• முடிந்தால் நிலையான இணைப்பை வைத்திருங்கள்.\n• தொடங்குவதற்கு முன் போதிய பேட்டரி இருப்பதை உறுதி செய்யுங்கள்.\n• முடியும் வரை இந்தத் திரை திறந்திருக்கும். நிறுவு இப்போது வேண்டாம் + + 1 நிமிடத்திற்கும் குறைவு + ~%1$d நிமிடம் diff --git a/controller/app/src/main/res/values-tr/strings_k2go.xml b/controller/app/src/main/res/values-tr/strings_k2go.xml index ddf4676ff..9665c8722 100644 --- a/controller/app/src/main/res/values-tr/strings_k2go.xml +++ b/controller/app/src/main/res/values-tr/strings_k2go.xml @@ -828,4 +828,7 @@ Bu, sunucu duraklatılmışken cihazınıza kurulur.\n\n• Bir süre alır, genellikle onlarca dakika.\n• Mümkünse kararlı bir bağlantı koruyun.\n• Başlamadan önce yeterli pil olduğundan emin olun.\n• Bu ekran bitene kadar açık kalır. Kur Şimdi değil + + 1 dk\'dan az + ~%1$d dk diff --git a/controller/app/src/main/res/values-uk/strings_k2go.xml b/controller/app/src/main/res/values-uk/strings_k2go.xml index 16e059041..61151e2bf 100644 --- a/controller/app/src/main/res/values-uk/strings_k2go.xml +++ b/controller/app/src/main/res/values-uk/strings_k2go.xml @@ -828,4 +828,7 @@ Встановлення відбувається на вашому пристрої з призупиненим сервером.\n\n• Триває деякий час, часто десятки хвилин.\n• За можливості підтримуйте стабільне з\'єднання.\n• Переконайтеся, що заряду батареї достатньо.\n• Цей екран залишається відкритим до завершення. Встановити Не зараз + + менше 1 хв + ~%1$d хв diff --git a/controller/app/src/main/res/values-vi/strings_k2go.xml b/controller/app/src/main/res/values-vi/strings_k2go.xml index ed96b1f38..1c2dfe663 100644 --- a/controller/app/src/main/res/values-vi/strings_k2go.xml +++ b/controller/app/src/main/res/values-vi/strings_k2go.xml @@ -828,4 +828,7 @@ Nội dung này được cài đặt trên thiết bị của bạn khi máy chủ tạm dừng.\n\n• Mất một lúc, thường là hàng chục phút.\n• Giữ kết nối ổn định nếu có thể.\n• Đảm bảo đủ pin trước khi bắt đầu.\n• Màn hình này vẫn mở cho đến khi hoàn tất. Cài đặt Để sau + + dưới 1 phút + ~%1$d phút diff --git a/controller/app/src/main/res/values-yo/strings_k2go.xml b/controller/app/src/main/res/values-yo/strings_k2go.xml index 50f594952..85a0b3d5a 100644 --- a/controller/app/src/main/res/values-yo/strings_k2go.xml +++ b/controller/app/src/main/res/values-yo/strings_k2go.xml @@ -828,4 +828,7 @@ Èyí máa fi sórí ẹ̀rọ rẹ nígbà tí sáfà bá dúró.\n\n• Ó máa gba àkókò díẹ̀, lọ́pọ̀ ìgbà ẹ̀wádọ́gbọ̀n ìṣẹ́jú.\n• Bí ó bá ṣeé ṣe, jẹ́ kí ìsopọ̀ dúró ṣinṣin.\n• Rí i pé batiri tó tó wà kí o tó bẹ̀rẹ̀.\n• Ojú-ìwé yìí máa wà ní ṣíṣí títí yóò fi parí. Fi sórí ẹ̀rọ Kì í ṣe báyìí + + kò tó ìṣẹ́jú 1 + ~ìṣẹ́jú %1$d diff --git a/controller/app/src/main/res/values-zh-rCN/strings_k2go.xml b/controller/app/src/main/res/values-zh-rCN/strings_k2go.xml index be2eb7ab2..4c2f96b51 100644 --- a/controller/app/src/main/res/values-zh-rCN/strings_k2go.xml +++ b/controller/app/src/main/res/values-zh-rCN/strings_k2go.xml @@ -828,4 +828,7 @@ 这将在服务器暂停的情况下安装到你的设备上。\n\n• 需要一些时间,通常几十分钟。\n• 如有可能,请保持网络稳定。\n• 开始前请确保电量充足。\n• 此界面会一直打开,直到完成。 安装 暂不 + + 不到 1 分钟 + 约 %1$d 分钟 diff --git a/controller/app/src/main/res/values/strings_k2go.xml b/controller/app/src/main/res/values/strings_k2go.xml index b4ddd6bf7..8036b59f8 100644 --- a/controller/app/src/main/res/values/strings_k2go.xml +++ b/controller/app/src/main/res/values/strings_k2go.xml @@ -911,4 +911,7 @@ This installs on your device with the server paused.\n\n• Takes a while — often tens of minutes.\n• Keep a stable connection if you can.\n• Have enough battery before you start.\n• This screen stays open until it finishes. Install Not now + + under a min + ~%1$d min diff --git a/controller/app/src/test/java/org/iiab/controller/install/domain/EtaTest.java b/controller/app/src/test/java/org/iiab/controller/install/domain/EtaTest.java new file mode 100644 index 000000000..b32757f19 --- /dev/null +++ b/controller/app/src/test/java/org/iiab/controller/install/domain/EtaTest.java @@ -0,0 +1,29 @@ +package org.iiab.controller.install.domain; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +/** Unit tests for {@link Eta} — the calm, rounded ETA shape for display (ADFA-5228). */ +public class EtaTest { + + @Test + public void negativeIsUnknown() { + assertEquals(Eta.Kind.UNKNOWN, Eta.of(-1L).kind); + } + + @Test + public void underOneMinute() { + assertEquals(Eta.Kind.UNDER_MINUTE, Eta.of(0L).kind); + assertEquals(Eta.Kind.UNDER_MINUTE, Eta.of(59L).kind); + } + + @Test + public void wholeMinutesRounded() { + assertEquals(Eta.Kind.MINUTES, Eta.of(60L).kind); + assertEquals(1, Eta.of(60L).minutes); + assertEquals(1, Eta.of(75L).minutes); // round(1.25) = 1 + assertEquals(2, Eta.of(90L).minutes); // round(1.5) = 2 + assertEquals(10, Eta.of(600L).minutes); + } +} diff --git a/controller/app/src/test/java/org/iiab/controller/install/domain/RunroleEtaTest.java b/controller/app/src/test/java/org/iiab/controller/install/domain/RunroleEtaTest.java new file mode 100644 index 000000000..716409898 --- /dev/null +++ b/controller/app/src/test/java/org/iiab/controller/install/domain/RunroleEtaTest.java @@ -0,0 +1,38 @@ +package org.iiab.controller.install.domain; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +/** Unit tests for {@link RunroleEta} — seconds-remaining estimate (ADFA-5228). */ +public class RunroleEtaTest { + + @Test + public void zeroWhenNothingRemains() { + assertEquals(0L, RunroleEta.secondsRemaining(0, -1L, 5, 50L)); + } + + @Test + public void usesLearnedDurationsWhenKnown() { + // 120s of remaining tasks known -> that's the estimate, ignoring the run rate. + assertEquals(120L, RunroleEta.secondsRemaining(10, 120L, 3, 30L)); + } + + @Test + public void fallsBackToObservedRateWhenNoHistory() { + // 10 tasks in 60s -> 6s/task; 20 remain -> 120s. + assertEquals(120L, RunroleEta.secondsRemaining(20, -1L, 10, 60L)); + } + + @Test + public void unknownWhenNoHistoryAndNoMovementYet() { + assertEquals(-1L, RunroleEta.secondsRemaining(20, -1L, 0, 0L)); + assertEquals(-1L, RunroleEta.secondsRemaining(20, -1L, 0, 5L)); + } + + @Test + public void learnedZeroIsAValidEstimate() { + // knownRemainingSeconds == 0 (all remaining tasks are instant) is still "known", not unknown. + assertEquals(0L, RunroleEta.secondsRemaining(3, 0L, 1, 10L)); + } +} diff --git a/controller/app/src/test/java/org/iiab/controller/install/domain/RunroleProgressTest.java b/controller/app/src/test/java/org/iiab/controller/install/domain/RunroleProgressTest.java index 267515885..1d5e9760b 100644 --- a/controller/app/src/test/java/org/iiab/controller/install/domain/RunroleProgressTest.java +++ b/controller/app/src/test/java/org/iiab/controller/install/domain/RunroleProgressTest.java @@ -10,9 +10,8 @@ import org.junit.Test; /** - * Unit tests for {@link RunroleProgress} — the ADFA-5228 determinate-progress signal derived from - * matching Ansible {@code TASK [role : name]} lines against an ordered task table, mapped onto a - * 5% liftoff / 95% ceiling band (100 only on completion). + * Unit tests for {@link RunroleProgress} — the ADFA-5228 determinate signal: a 0..5% warmup creep + * (common/dependency tasks), the module's known tasks over 5..95%, and 100% only on completion. */ public class RunroleProgressTest { @@ -30,10 +29,29 @@ public void zeroBeforeAnyMovement() { } @Test - public void liftsToFiveOnFirstMovementBeforeAnyKnownTask() { + public void firstMovementCreepsToOne() { RunroleProgress p = four(); - p.observe("changed: [127.0.0.1] => (item=something)"); // output, but not a known task yet - assertEquals(RunroleProgress.LIFTOFF, p.percent()); // 5 + p.observe("ok: [127.0.0.1]"); // output, but not a task header -> just "moving" + assertEquals(1, p.percent()); + } + + @Test + public void warmupTasksCreepTowardLiftoff() { + RunroleProgress p = four(); + for (int i = 0; i < 4; i++) p.observe(task("m", "warmup " + i)); // 4/10 of the way + assertEquals(2, p.percent()); // round(5 * 4/10) = 2 + for (int i = 0; i < 10; i++) p.observe(task("m", "warmup x" + i)); // well past target + assertEquals(RunroleProgress.LIFTOFF, p.percent()); // capped at 5 + } + + @Test + public void firstKnownTaskLeavesWarmupForTheBand() { + RunroleProgress p = four(); + p.observe(task("m", "warmup 1")); + p.observe(task("m", "warmup 2")); + assertTrue(p.percent() < RunroleProgress.LIFTOFF); // still warming up + p.observe(task("m", "a")); // first module task + assertEquals(28, p.percent()); // jumps into the 5..95 band } @Test @@ -73,14 +91,6 @@ public void neverGoesBackwards() { assertEquals(73, p.percent()); } - @Test - public void unknownTasksStayAtLiftoff() { - RunroleProgress p = four(); - p.observe(task("m", "not-in-table")); - p.observe(task("m", "Gather facts")); - assertEquals(RunroleProgress.LIFTOFF, p.percent()); // moved, but no known task -> 5 - } - @Test public void emptyTableIsIndeterminate() { RunroleProgress p = new RunroleProgress(Collections.emptyList()); diff --git a/controller/app/src/test/java/org/iiab/controller/install/domain/RunroleTimingsTest.java b/controller/app/src/test/java/org/iiab/controller/install/domain/RunroleTimingsTest.java new file mode 100644 index 000000000..f70a1f7d8 --- /dev/null +++ b/controller/app/src/test/java/org/iiab/controller/install/domain/RunroleTimingsTest.java @@ -0,0 +1,49 @@ +package org.iiab.controller.install.domain; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import java.util.Map; + +import org.junit.Test; + +/** Unit tests for {@link RunroleTimings} — per-task duration measurement (ADFA-5228). */ +public class RunroleTimingsTest { + + @Test + public void closesEachTaskWhenTheNextStarts() { + RunroleTimings t = new RunroleTimings(); + t.onTask("a", 0L); + t.onTask("b", 1000L); + t.onTask("c", 3000L); + Map d = t.durationsMs(); + assertEquals(Long.valueOf(1000L), d.get("a")); + assertEquals(Long.valueOf(2000L), d.get("b")); + assertFalse("c is still open until finish()", d.containsKey("c")); + } + + @Test + public void finishClosesTheLastTask() { + RunroleTimings t = new RunroleTimings(); + t.onTask("only", 0L); + t.finish(5000L); + assertEquals(Long.valueOf(5000L), t.durationsMs().get("only")); + } + + @Test + public void repeatedNameKeepsLastMeasurement() { + RunroleTimings t = new RunroleTimings(); + t.onTask("a", 0L); + t.onTask("a", 1000L); // closes first a=1000, reopens a + t.finish(1500L); // a=500 + assertEquals(Long.valueOf(500L), t.durationsMs().get("a")); + } + + @Test + public void nullTaskIsIgnored() { + RunroleTimings t = new RunroleTimings(); + t.onTask(null, 0L); + t.finish(1000L); + assertEquals(0, t.durationsMs().size()); + } +}