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 76eee3a8f4..a6d1353605 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 @@ -7,6 +7,9 @@ import android.content.ActivityNotFoundException import android.content.Intent import android.net.Uri import android.os.Bundle +import android.view.Menu +import android.view.MenuInflater +import android.view.MenuItem import android.view.View import android.widget.Toast import androidx.appcompat.app.AlertDialog @@ -37,6 +40,7 @@ import eu.kanade.tachiyomi.util.preference.preferenceCategory import eu.kanade.tachiyomi.util.preference.summaryRes import eu.kanade.tachiyomi.util.preference.titleRes import eu.kanade.tachiyomi.util.system.DeviceUtil +import eu.kanade.tachiyomi.util.system.openInBrowser import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach @@ -158,6 +162,17 @@ class SettingsBackupController : SettingsController() { infoPreference(R.string.backup_info) } + override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { + inflater.inflate(R.menu.settings_backup, menu) + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + R.id.action_backup_help -> activity?.openInBrowser(HELP_URL) + } + return super.onOptionsItemSelected(item) + } + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { if (data != null && resultCode == Activity.RESULT_OK) { val activity = activity ?: return @@ -305,3 +320,5 @@ private const val KEY_URI = "RestoreBackupDialog.uri" private const val CODE_BACKUP_DIR = 503 private const val CODE_BACKUP_CREATE = 504 private const val CODE_BACKUP_RESTORE = 505 + +private const val HELP_URL = "https://tachiyomi.org/help/guides/backups/" diff --git a/app/src/main/res/menu/settings_backup.xml b/app/src/main/res/menu/settings_backup.xml new file mode 100644 index 0000000000..28ff24c5f5 --- /dev/null +++ b/app/src/main/res/menu/settings_backup.xml @@ -0,0 +1,11 @@ + + + + +