From 39dd1b6a00e344e523b2106385ad20eef98e9deb Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 11 Nov 2020 10:17:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/help/webDavHelp.md | 15 ++++++++++++++- .../main/java/io/legado/app/help/LocalConfig.kt | 7 +++++++ .../legado/app/ui/config/BackupConfigFragment.kt | 7 +++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app/src/main/assets/help/webDavHelp.md b/app/src/main/assets/help/webDavHelp.md index 94e0a9c3d..b1e2a3285 100644 --- a/app/src/main/assets/help/webDavHelp.md +++ b/app/src/main/assets/help/webDavHelp.md @@ -1 +1,14 @@ -# WebDav备份教程 \ No newline at end of file +# WebDav备份教程 + +### 阅读支持云备份,采用WebDav协议,所有支持WebDav的云盘都可以,建议采用坚果云,每月免费1G流量,用来备份阅读足够了,下面就采用坚果云来讲解配置步骤. + +1. 打开坚果云网站 https://www.jianguoyun.com/d/home#/ +2. 如果没有注册过坚果云先注册一下 +3. 登录坚果云 +4. 右上角用户名点开点账户信息 +5. 点击安全选项 +6. 在第三方管理里添加应用 +7. 将应用示例里的服务器地址,用户名,和密码填到阅读的WebDav设置里 +8. 阅读的WebDav配置在我的-备份与恢复,创建子文件夹选项保持默认即可 +9. 设置完成后手动执行一下备份,看看是否成功 +10. 恢复时选择想要恢复的备份文件 \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/help/LocalConfig.kt b/app/src/main/java/io/legado/app/help/LocalConfig.kt index aee7a8665..858582fa6 100644 --- a/app/src/main/java/io/legado/app/help/LocalConfig.kt +++ b/app/src/main/java/io/legado/app/help/LocalConfig.kt @@ -20,4 +20,11 @@ object LocalConfig { set(value) { localConfig.edit { putBoolean("firstRead", value) } } + + var isFirstOpenBackup: Boolean + get() = localConfig.getBoolean("firstBackup", true) + set(value) { + localConfig.edit { putBoolean("firstBackup", value) } + } + } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt index 097148736..887efb63f 100644 --- a/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt @@ -11,11 +11,13 @@ import androidx.preference.Preference import io.legado.app.R import io.legado.app.base.BasePreferenceFragment import io.legado.app.constant.PreferKey +import io.legado.app.help.LocalConfig import io.legado.app.help.storage.Restore import io.legado.app.lib.dialogs.alert import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.accentColor import io.legado.app.ui.filepicker.FilePickerDialog +import io.legado.app.ui.widget.dialog.TextDialog import io.legado.app.utils.applyTint import io.legado.app.utils.getPrefString @@ -55,6 +57,11 @@ class BackupConfigFragment : BasePreferenceFragment(), super.onViewCreated(view, savedInstanceState) preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this) ATH.applyEdgeEffectColor(listView) + if (LocalConfig.isFirstOpenBackup) { + val text = String(requireContext().assets.open("help/webDavHelp.md").readBytes()) + TextDialog.show(childFragmentManager, text, TextDialog.MD) + LocalConfig.isFirstOpen = false + } } override fun onDestroy() {