Show notification right away when requesting manual backup
This commit is contained in:
parent
6d8178f6b1
commit
4efaa08881
2 changed files with 8 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
|||
package com.stevesoltys.backup.settings
|
||||
|
||||
import android.app.Application
|
||||
import com.stevesoltys.backup.Backup
|
||||
import com.stevesoltys.backup.R
|
||||
import com.stevesoltys.backup.transport.requestBackup
|
||||
import com.stevesoltys.backup.ui.RequireProvisioningViewModel
|
||||
|
||||
|
@ -10,6 +12,10 @@ class SettingsViewModel(app: Application) : RequireProvisioningViewModel(app) {
|
|||
|
||||
override val isRestoreOperation = false
|
||||
|
||||
fun backupNow() = Thread { requestBackup(app) }.start()
|
||||
fun backupNow() {
|
||||
val nm = (app as Backup).notificationManager
|
||||
nm.onBackupUpdate(app.getString(R.string.notification_backup_starting), 0, 1, true)
|
||||
Thread { requestBackup(app) }.start()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
<!-- Notification -->
|
||||
<string name="notification_channel_title">Backup Notification</string>
|
||||
<string name="notification_title">Backup running</string>
|
||||
<string name="notification_backup_starting">Starting Backup…</string>
|
||||
<string name="notification_backup_result_complete">Backup complete</string>
|
||||
<string name="notification_backup_result_rejected">Not backed up</string>
|
||||
<string name="notification_backup_result_error">Backup failed</string>
|
||||
|
|
Loading…
Reference in a new issue