update + Fix
This commit is contained in:
Binary file not shown.
@@ -190,6 +190,25 @@ fun DashboardScreen(systemActions: SystemActions) {
|
|||||||
style = MaterialTheme.typography.bodyMedium
|
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()) {
|
OutlinedButton(onClick = { showResetDialog = true }, modifier = Modifier.fillMaxWidth()) {
|
||||||
Text(stringResource(R.string.dashboard_reset_now))
|
Text(stringResource(R.string.dashboard_reset_now))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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_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_permissions_needed">Autorisations requises pour fonctionner correctement</string>
|
||||||
<string name="dashboard_control_disabled">Contrôle désactivé</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 -->
|
<!-- Settings -->
|
||||||
<string name="settings_title">Réglages</string>
|
<string name="settings_title">Réglages</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user