From f4ff991e1d3f0da665e37f1fcb331924453d1523 Mon Sep 17 00:00:00 2001 From: ca1e Date: Sat, 7 Dec 2019 14:44:06 +0800 Subject: [PATCH 1/2] commit clean caches --- app/src/main/java/io/legado/app/constant/PreferKey.kt | 3 +++ .../java/io/legado/app/ui/config/ConfigFragment.kt | 10 ++++++++-- app/src/main/res/values/strings.xml | 1 + app/src/main/res/xml/pref_config.xml | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/constant/PreferKey.kt b/app/src/main/java/io/legado/app/constant/PreferKey.kt index 24ac981e9..446efc0bf 100644 --- a/app/src/main/java/io/legado/app/constant/PreferKey.kt +++ b/app/src/main/java/io/legado/app/constant/PreferKey.kt @@ -10,4 +10,7 @@ object PreferKey { const val nextKey = "nextKeyCode" const val showRss = "showRss" const val bookshelfLayout = "bookshelfLayout" + const val recordLog = "recordLog" + const val processText = "process_text" + const val cleanCache = "cleanCache" } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/config/ConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/ConfigFragment.kt index cee764420..a4a7bd62d 100644 --- a/app/src/main/java/io/legado/app/ui/config/ConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/ConfigFragment.kt @@ -12,6 +12,7 @@ import io.legado.app.App import io.legado.app.R import io.legado.app.constant.PreferKey import io.legado.app.help.BookHelp +import io.legado.app.help.FileHelp import io.legado.app.lib.theme.ATH import io.legado.app.receiver.SharedReceiverActivity import io.legado.app.ui.filechooser.FileChooserDialog @@ -59,6 +60,11 @@ class ConfigFragment : PreferenceFragmentCompat(), mode = FileChooserDialog.DIRECTORY, initPath = getPreferenceString(PreferKey.downloadPath) ) + PreferKey.cleanCache -> { + LogUtils.d("xxx","cleancaches") + FileHelp.deleteFile(getPreferenceString(PreferKey.downloadPath)) + toast("成功清理缓存") + } } return super.onPreferenceTreeClick(preference) } @@ -69,8 +75,8 @@ class ConfigFragment : PreferenceFragmentCompat(), BookHelp.upDownloadPath() findPreference(key)?.summary = getPreferenceString(key) } - "recordLog" -> LogUtils.upLevel() - "process_text" -> sharedPreferences?.let { + PreferKey.recordLog -> LogUtils.upLevel() + PreferKey.processText -> sharedPreferences?.let { setProcessTextEnable(it.getBoolean("process_text", true)) } PreferKey.showRss -> postEvent(PreferKey.showRss, PreferKey.showRss) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9e6327377..f4786808e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -313,6 +313,7 @@ 替换范围,选填书名或者源名 分组 内容缓存路径 + 清理缓存 系统文件选择器 新版本 下载更新 diff --git a/app/src/main/res/xml/pref_config.xml b/app/src/main/res/xml/pref_config.xml index 3e9a873b6..bc421509b 100644 --- a/app/src/main/res/xml/pref_config.xml +++ b/app/src/main/res/xml/pref_config.xml @@ -39,4 +39,8 @@ android:key="recordLog" android:title="记录日志" app:iconSpaceReserved="false" /> + \ No newline at end of file From 6bf160ed816b32b3a71c83a5014eab8b9f8281de Mon Sep 17 00:00:00 2001 From: ca1e Date: Sat, 7 Dec 2019 20:03:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?commit=20=E8=B0=83=E6=95=B4=E9=85=8D?= =?UTF-8?q?=E8=89=B2=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/readConfig.json | 14 +++++++------- app/src/main/res/xml/about.xml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/assets/readConfig.json b/app/src/main/assets/readConfig.json index 21cea9f69..ee546dc37 100644 --- a/app/src/main/assets/readConfig.json +++ b/app/src/main/assets/readConfig.json @@ -4,7 +4,7 @@ "bgType": 1, "darkStatusIcon": true, "textColor": "#5E432E", - "textSize": 22, + "textSize": 24, "letterSpacing": 0, "lineSpacingExtra": 10, "lineSpacingMultiplier": 1.2, @@ -14,11 +14,11 @@ "paddingBottom": 0 }, { - "bgStr": "新羊皮纸.jpg", - "bgType": 1, + "bgStr": "#C6BAA1", + "bgType": 0, "darkStatusIcon": true, "textColor": "#5E432E", - "textSize": 22, + "textSize": 24, "letterSpacing": 0, "lineSpacingExtra": 10, "lineSpacingMultiplier": 1.2, @@ -32,7 +32,7 @@ "bgType": 0, "darkStatusIcon": false, "textColor": "#FFFFFF", - "textSize": 22, + "textSize": 24, "letterSpacing": 0, "lineSpacingExtra": 10, "lineSpacingMultiplier": 1.2, @@ -46,7 +46,7 @@ "bgType": 1, "darkStatusIcon": false, "textColor": "#adadad", - "textSize": 22, + "textSize": 24, "letterSpacing": 0, "lineSpacingExtra": 10, "lineSpacingMultiplier": 1.2, @@ -60,7 +60,7 @@ "bgType": 0, "darkStatusIcon": false, "textColor": "#adadad", - "textSize": 22, + "textSize": 24, "letterSpacing": 0, "lineSpacingExtra": 10, "lineSpacingMultiplier": 1.2, diff --git a/app/src/main/res/xml/about.xml b/app/src/main/res/xml/about.xml index 0391f9d86..9bf6b7b71 100644 --- a/app/src/main/res/xml/about.xml +++ b/app/src/main/res/xml/about.xml @@ -5,7 +5,7 @@