update + Fix

This commit is contained in:
Johnny
2026-07-03 09:47:09 +02:00
parent 84b972a0f7
commit c32458f704
3 changed files with 24 additions and 0 deletions

Binary file not shown.

View File

@@ -190,6 +190,25 @@ fun DashboardScreen(systemActions: SystemActions) {
style = MaterialTheme.typography.bodyMedium
)
val nextCutoffText = when {
!settings.controlEnabled -> stringResource(R.string.dashboard_control_disabled)
snapshot.dataState == DataState.WIFI -> stringResource(R.string.dashboard_cutoff_wifi)
snapshot.dataState == DataState.CUT -> stringResource(R.string.dashboard_cutoff_in_progress)
snapshot.nextCutoffAtMillis != null -> {
val remainingMs = (snapshot.nextCutoffAtMillis!! - System.currentTimeMillis()).coerceAtLeast(0L)
stringResource(
R.string.dashboard_cutoff_countdown,
remainingMs / 60_000,
(remainingMs / 1000) % 60
)
}
else -> stringResource(R.string.dashboard_cutoff_unavailable)
}
Text(
"${stringResource(R.string.dashboard_next_cutoff)}: $nextCutoffText",
style = MaterialTheme.typography.bodyMedium
)
OutlinedButton(onClick = { showResetDialog = true }, modifier = Modifier.fillMaxWidth()) {
Text(stringResource(R.string.dashboard_reset_now))
}

View File

@@ -31,6 +31,11 @@
<string name="dashboard_reset_confirm_message">Le compteur de données consommées sera remis à zéro immédiatement.</string>
<string name="dashboard_permissions_needed">Autorisations requises pour fonctionner correctement</string>
<string name="dashboard_control_disabled">Contrôle désactivé</string>
<string name="dashboard_next_cutoff">Prochaine coupure</string>
<string name="dashboard_cutoff_wifi">Wi-Fi actif (pas de coupure)</string>
<string name="dashboard_cutoff_in_progress">En cours…</string>
<string name="dashboard_cutoff_countdown">dans %1$d min %2$d s</string>
<string name="dashboard_cutoff_unavailable">indisponible (pare-feu inactif)</string>
<!-- Settings -->
<string name="settings_title">Réglages</string>