diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index a669fb6a6..569f6d190 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -2,7 +2,13 @@ * 旧版数据导入教程: * 先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】,提示存储权限,选择允许即可导入成功。 -* 注意:由于安卓10更改了权限策略,还需要给「允许安装其他应用」的权限才能导入源。 +* 注意:由于安卓10更改了权限策略,还需要给「允许安装其他应用」的权限才能导入源。MIUI11也需要此权限。 + +**2019/12/15** +* 修复清理缓存会把其他文件删除的问题 +* 详情页模糊背景 +* 修复朗读时最后一页显示不正确的问题 +* 最近感冒了,发热咳嗽还没好,继续咸鱼 **2019/12/12** * [fix]web服务停止问题 @@ -14,14 +20,16 @@ * [mod]启用web服务 **2019/12/03** -* [by Celeter]1、调试log修改 2、增加书源字符串分享(RSS未包含) 3、增加导出选中的源(包含书源、RSS、替换规则) +* from Celeter: + - 调试log修改 + - 增加书源字符串分享(RSS未包含) + - 增加导出选中的源(包含书源、RSS、替换规则) * 一键缓存 * 修复bug **2019/12/02** * 修复一些bug,书架网格布局完成 - * 音频添加速度调整 * 后台朗读,长按返回,或点击按钮 * 订阅可以隐藏 -* [by Celeter]优化老版本规则导入 \ No newline at end of file +* 优化老版本规则导入from Celeter \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index 022113231..e6f17134a 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -26,6 +26,15 @@ object BookHelp { ?: App.INSTANCE.cacheDir.absolutePath } + private fun getBookCachePath(): String { + return "$downloadPath${File.separator}book_cache" + } + + fun clearCache() { + FileHelp.deleteFile(getBookCachePath()) + FileHelp.getFolder(getBookCachePath()) + } + fun saveContent(book: Book, bookChapter: BookChapter, content: String) { if (content.isEmpty()) return val filePath = getChapterPath(book, bookChapter) @@ -69,7 +78,7 @@ object BookHelp { val bookFolder = formatFolderName(book.name + book.bookUrl) val chapterFile = String.format("%05d-%s", bookChapter.index, MD5Utils.md5Encode(bookChapter.title)) - return "$downloadPath${File.separator}book_cache${File.separator}$bookFolder${File.separator}$chapterFile.nb" + return "${getBookCachePath()}${File.separator}$bookFolder${File.separator}$chapterFile.nb" } private fun formatFolderName(folderName: String): String { diff --git a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt index 117ef37c6..08a5fa6a1 100644 --- a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt +++ b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt @@ -23,6 +23,7 @@ class AboutFragment : PreferenceFragmentCompat() { override fun onPreferenceTreeClick(preference: Preference?): Boolean { when (preference?.key) { + "contributors" -> openIntent(Intent.ACTION_VIEW, getString(R.string.contributors_url)) "update_log" -> UpdateLog().show(childFragmentManager, "update_log") "check_update" -> openIntent(Intent.ACTION_VIEW, getString(R.string.latest_release_url)) "mail" -> openIntent(Intent.ACTION_SENDTO, "mailto:kunfei.ge@gmail.com") diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 9e584ca86..11c9dc5cf 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -256,7 +256,9 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo } override fun upContent(position: Int) { - page_view.upContent(position) + launch { + page_view.upContent(position) + } } override fun upView() { 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 0410b34a6..74d517b20 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 @@ -13,7 +13,6 @@ import io.legado.app.R import io.legado.app.constant.Bus 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 @@ -62,10 +61,7 @@ class ConfigFragment : PreferenceFragmentCompat(), initPath = getPreferenceString(PreferKey.downloadPath) ) PreferKey.cleanCache -> { - getPreferenceString(PreferKey.downloadPath).let { - FileHelp.deleteFile(it) - FileHelp.getFolder(it) - } + BookHelp.clearCache() toast(R.string.clear_cache_success) } } diff --git a/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt b/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt index b6e18a834..d9c57c4ce 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt @@ -54,7 +54,7 @@ data class TextChapter( fun getReadLength(pageIndex: Int): Int { var length = 0 - val maxIndex = min(pageIndex, pageLines.lastIndex) + val maxIndex = min(pageIndex, pageLines.size) for (index in 0 until maxIndex) { length += pageLengths[index] } diff --git a/app/src/main/res/values/pref_key_value.xml b/app/src/main/res/values/pref_key_value.xml index 138aa68cf..71c26bc29 100644 --- a/app/src/main/res/values/pref_key_value.xml +++ b/app/src/main/res/values/pref_key_value.xml @@ -18,8 +18,9 @@ Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.2357.134 Safari/537.36 - https://gedoor.github.io/MyBookshelf/sourcerule.html + https://gitee.com/alanskycn/yuedu/blob/master/Rule/README.md https://github.com/gedoor/legado + https://github.com/gedoor/legado/graphs/contributors https://gedoor.github.io/MyBookshelf/disclaimer.html https://gedoor.github.io/MyBookshelf/ https://github.com/gedoor/legado/releases/latest diff --git a/app/src/main/res/xml/about.xml b/app/src/main/res/xml/about.xml index 9bf6b7b71..ff8e16c44 100644 --- a/app/src/main/res/xml/about.xml +++ b/app/src/main/res/xml/about.xml @@ -3,9 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> - - + + +