Merge pull request #652 from grote/scheduling-i18n
Always update next scheduling time in UI
This commit is contained in:
commit
bf40b53863
2 changed files with 4 additions and 4 deletions
|
@ -275,13 +275,13 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
||||||
backupScheduling.summary = getString(R.string.settings_backup_status_next_backup_usb)
|
backupScheduling.summary = getString(R.string.settings_backup_status_next_backup_usb)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (workInfo == null) return
|
|
||||||
|
|
||||||
val nextScheduleTimeMillis = workInfo.nextScheduleTimeMillis
|
val nextScheduleTimeMillis = workInfo?.nextScheduleTimeMillis ?: Long.MAX_VALUE
|
||||||
if (workInfo.state == WorkInfo.State.RUNNING) {
|
if (workInfo != null && workInfo.state == WorkInfo.State.RUNNING) {
|
||||||
val text = getString(R.string.notification_title)
|
val text = getString(R.string.notification_title)
|
||||||
backupScheduling.summary = getString(R.string.settings_backup_status_next_backup, text)
|
backupScheduling.summary = getString(R.string.settings_backup_status_next_backup, text)
|
||||||
} else if (nextScheduleTimeMillis == Long.MAX_VALUE) {
|
} else if (nextScheduleTimeMillis == Long.MAX_VALUE) {
|
||||||
|
Log.i(TAG, "No backup scheduled! workInfo: $workInfo")
|
||||||
val text = getString(R.string.settings_backup_last_backup_never)
|
val text = getString(R.string.settings_backup_last_backup_never)
|
||||||
backupScheduling.summary = getString(R.string.settings_backup_status_next_backup, text)
|
backupScheduling.summary = getString(R.string.settings_backup_status_next_backup, text)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
app:icon="@drawable/ic_access_time"
|
app:icon="@drawable/ic_access_time"
|
||||||
app:key="backup_scheduling"
|
app:key="backup_scheduling"
|
||||||
app:title="@string/settings_backup_scheduling_title"
|
app:title="@string/settings_backup_scheduling_title"
|
||||||
app:summary="Next backup: Never" />
|
tools:summary="Next backup: Never" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue