From 505fa871e6f17543218b8cb9daaa13069bb6554d Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Sun, 4 Jul 2021 13:21:18 -0400 Subject: [PATCH] Update backup name/icon to match upstream --- .../ui/setting/SettingsBackupController.kt | 58 +++++++++---------- .../ui/setting/SettingsMainController.kt | 4 +- app/src/main/res/drawable/ic_backup_24dp.xml | 9 --- .../res/drawable/ic_backup_restore_24dp.xml | 8 +++ 4 files changed, 37 insertions(+), 42 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_backup_24dp.xml create mode 100644 app/src/main/res/drawable/ic_backup_restore_24dp.xml 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 8328503fad..6e1a90c6b0 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 @@ -44,42 +44,38 @@ class SettingsBackupController : SettingsController() { } override fun setupPreferenceScreen(screen: PreferenceScreen) = screen.apply { - titleRes = R.string.backup + titleRes = R.string.backup_and_restore - preferenceCategory { - titleRes = R.string.backup + preference { + key = "pref_create_backup" + titleRes = R.string.create_backup + summaryRes = R.string.can_be_used_to_restore - preference { - key = "pref_create_backup" - titleRes = R.string.create_backup - summaryRes = R.string.can_be_used_to_restore - - onClick { - if (!BackupCreateService.isRunning(context)) { - val ctrl = CreateBackupDialog() - ctrl.targetController = this@SettingsBackupController - ctrl.showDialog(router) - } else { - context.toast(R.string.backup_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.restore_backup - summaryRes = R.string.restore_from_backup_file + } + preference { + key = "pref_restore_backup" + titleRes = R.string.restore_backup + summaryRes = R.string.restore_from_backup_file - onClick { - if (!BackupRestoreService.isRunning(context)) { - val intent = Intent(Intent.ACTION_GET_CONTENT) - intent.addCategory(Intent.CATEGORY_OPENABLE) - intent.type = "application/*" - val title = resources?.getString(R.string.select_backup_file) - val chooser = Intent.createChooser(intent, title) - startActivityForResult(chooser, CODE_BACKUP_RESTORE) - } else { - context.toast(R.string.restore_in_progress) - } + onClick { + if (!BackupRestoreService.isRunning(context)) { + val intent = Intent(Intent.ACTION_GET_CONTENT) + intent.addCategory(Intent.CATEGORY_OPENABLE) + intent.type = "application/*" + val title = resources?.getString(R.string.select_backup_file) + val chooser = Intent.createChooser(intent, title) + startActivityForResult(chooser, CODE_BACKUP_RESTORE) + } else { + context.toast(R.string.restore_in_progress) } } } 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 cdb4c5e9a8..014864331d 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,9 +61,9 @@ class SettingsMainController : SettingsController(), FloatingSearchInterface { onClick { navigateTo(SettingsTrackingController()) } } preference { - iconRes = R.drawable.ic_backup_24dp + iconRes = R.drawable.ic_backup_restore_24dp iconTint = tintColor - titleRes = R.string.backup + titleRes = R.string.backup_and_restore onClick { navigateTo(SettingsBackupController()) } } preference { diff --git a/app/src/main/res/drawable/ic_backup_24dp.xml b/app/src/main/res/drawable/ic_backup_24dp.xml deleted file mode 100644 index 086281669f..0000000000 --- a/app/src/main/res/drawable/ic_backup_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_backup_restore_24dp.xml b/app/src/main/res/drawable/ic_backup_restore_24dp.xml new file mode 100644 index 0000000000..fd27b8bed2 --- /dev/null +++ b/app/src/main/res/drawable/ic_backup_restore_24dp.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file