diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt index d5a0b59bfe..a50f9f4b61 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt @@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.ui.base.controller.RootController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.category.CategoryController import eu.kanade.tachiyomi.ui.download.DownloadController +import eu.kanade.tachiyomi.ui.setting.SettingsBackupController import eu.kanade.tachiyomi.ui.setting.SettingsController import eu.kanade.tachiyomi.ui.setting.SettingsMainController import eu.kanade.tachiyomi.util.preference.add @@ -93,6 +94,14 @@ class MoreController : router.pushController(CategoryController().withFadeTransaction()) } } + preference { + titleRes = R.string.label_backup + iconRes = R.drawable.ic_backup_24dp + iconTint = tintColor + onClick { + router.pushController(SettingsBackupController().withFadeTransaction()) + } + } } preferenceCategory { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt index 7be998fa96..75ebca1952 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt @@ -53,46 +53,43 @@ class SettingsBackupController : SettingsController() { } override fun setupPreferenceScreen(screen: PreferenceScreen) = screen.apply { - titleRes = R.string.backup + titleRes = R.string.label_backup - preferenceCategory { - titleRes = R.string.backup + preference { + key = "pref_create_backup" + titleRes = R.string.pref_create_backup + summaryRes = R.string.pref_create_backup_summ - preference { - key = "pref_create_backup" - titleRes = R.string.pref_create_backup - summaryRes = R.string.pref_create_backup_summ - - onClick { - if (!BackupCreateService.isRunning(context)) { - val ctrl = CreateBackupDialog() - ctrl.targetController = this@SettingsBackupController - ctrl.showDialog(router) - } else { - context.toast(R.string.backup_in_progress) - } - } - } - preference { - key = "pref_restore_backup" - titleRes = R.string.pref_restore_backup - summaryRes = R.string.pref_restore_backup_summ - - onClick { - if (!BackupRestoreService.isRunning(context)) { - val intent = Intent(Intent.ACTION_GET_CONTENT).apply { - addCategory(Intent.CATEGORY_OPENABLE) - type = "*/*" - } - val title = resources?.getString(R.string.file_select_backup) - val chooser = Intent.createChooser(intent, title) - startActivityForResult(chooser, CODE_BACKUP_RESTORE) - } else { - context.toast(R.string.restore_in_progress) - } + onClick { + if (!BackupCreateService.isRunning(context)) { + val ctrl = CreateBackupDialog() + ctrl.targetController = this@SettingsBackupController + ctrl.showDialog(router) + } else { + context.toast(R.string.backup_in_progress) } } } + preference { + key = "pref_restore_backup" + titleRes = R.string.pref_restore_backup + summaryRes = R.string.pref_restore_backup_summ + + onClick { + if (!BackupRestoreService.isRunning(context)) { + val intent = Intent(Intent.ACTION_GET_CONTENT).apply { + addCategory(Intent.CATEGORY_OPENABLE) + type = "*/*" + } + val title = resources?.getString(R.string.file_select_backup) + val chooser = Intent.createChooser(intent, title) + startActivityForResult(chooser, CODE_BACKUP_RESTORE) + } else { + context.toast(R.string.restore_in_progress) + } + } + } + preferenceCategory { titleRes = R.string.pref_backup_service_category diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt index eb2e5ac58b..6d456717f9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt @@ -61,7 +61,7 @@ class SettingsMainController : SettingsController() { preference { iconRes = R.drawable.ic_backup_24dp iconTint = tintColor - titleRes = R.string.backup + titleRes = R.string.label_backup onClick { navigateTo(SettingsBackupController()) } } preference { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 634a0da237..6ef16679f2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -18,7 +18,7 @@ Updates History Sources - Backup + Backup and restore Migrate Extensions Extension info @@ -389,7 +389,6 @@ Only include pinned sources - Backup Create backup Can be used to restore current library Restore backup