Merge pull request #652 from grote/scheduling-i18n

Always update next scheduling time in UI
This commit is contained in:
Torsten Grote 2024-04-29 13:46:06 -03:00 committed by GitHub
commit bf40b53863
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -275,13 +275,13 @@ class SettingsFragment : PreferenceFragmentCompat() {
backupScheduling.summary = getString(R.string.settings_backup_status_next_backup_usb)
return
}
if (workInfo == null) return
val nextScheduleTimeMillis = workInfo.nextScheduleTimeMillis
if (workInfo.state == WorkInfo.State.RUNNING) {
val nextScheduleTimeMillis = workInfo?.nextScheduleTimeMillis ?: Long.MAX_VALUE
if (workInfo != null && workInfo.state == WorkInfo.State.RUNNING) {
val text = getString(R.string.notification_title)
backupScheduling.summary = getString(R.string.settings_backup_status_next_backup, text)
} else if (nextScheduleTimeMillis == Long.MAX_VALUE) {
Log.i(TAG, "No backup scheduled! workInfo: $workInfo")
val text = getString(R.string.settings_backup_last_backup_never)
backupScheduling.summary = getString(R.string.settings_backup_status_next_backup, text)
} else {

View file

@ -51,7 +51,7 @@
app:icon="@drawable/ic_access_time"
app:key="backup_scheduling"
app:title="@string/settings_backup_scheduling_title"
app:summary="Next backup: Never" />
tools:summary="Next backup: Never" />
</PreferenceCategory>