diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 721545ff0..169510a32 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -4,6 +4,13 @@ * 先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】,提示存储权限,选择允许即可导入成功。 * 注意:由于安卓10更改了权限策略,还需要给「允许安装其他应用」的权限才能导入源。MIUI11也需要此权限。 +**2019/12/20** +* 阅读界面的下载菜单可以用了 +* rss阅读bug修复,webView内可以用返回建返回上一链接 +* 优化搜索界面逻辑 +* 导入旧书源时url里的&不再转为&& +* 修复书架封面显示不全的bug + **2019/12/16** * 添加几个主题选择 * 音频播放添加header支持 diff --git a/app/src/main/java/io/legado/app/help/storage/OldRule.kt b/app/src/main/java/io/legado/app/help/storage/OldRule.kt index 1c180838c..0c9baa659 100644 --- a/app/src/main/java/io/legado/app/help/storage/OldRule.kt +++ b/app/src/main/java/io/legado/app/help/storage/OldRule.kt @@ -5,11 +5,7 @@ import io.legado.app.constant.BookType import io.legado.app.data.entities.BookSource import io.legado.app.data.entities.rule.* import io.legado.app.help.storage.Restore.jsonPath -import io.legado.app.utils.GSON -import io.legado.app.utils.fromJsonObject -import io.legado.app.utils.readInt -import io.legado.app.utils.readString -import io.legado.app.utils.readBool +import io.legado.app.utils.* import java.util.regex.Pattern object OldRule { @@ -129,7 +125,11 @@ object OldRule { newRule = newRule.replace("|", "||") } } - if (newRule.contains("&") && !newRule.contains("&&")) { + if (newRule.contains("&") + && !newRule.contains("&&") + && !newRule.contains("http") + && !newRule.startsWith("/") + ) { newRule = newRule.replace("&", "&&") } } @@ -145,10 +145,9 @@ object OldRule { return toNewUrl(oldUrls) val urls = oldUrls.split("(&&|\n)+".toRegex()) - val newUrls = urls.map { - toNewUrl(it)?.replace("\n\\s*".toRegex(),"") + return urls.map { + toNewUrl(it)?.replace("\n\\s*".toRegex(), "") }.joinToString("\n") - return newUrls } private fun toNewUrl(oldUrl: String?): String? { diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index 485b3d02b..c55c1812c 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -111,7 +111,6 @@ class BookInfoActivity : tv_intro.text = book.getDisplayIntro() book.getDisplayCover()?.let { ImageLoader.load(this, it) - .error(R.drawable.image_cover_default) .centerCrop() .into(iv_cover) ImageLoader.load(this, it) diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 1b5966efb..a059e380d 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -13,7 +13,6 @@ import io.legado.app.BuildConfig import io.legado.app.R import io.legado.app.base.VMBaseActivity import io.legado.app.constant.Bus -import io.legado.app.help.ActivityHelp import io.legado.app.help.storage.Backup import io.legado.app.lib.theme.ATH import io.legado.app.service.BaseReadAloudService @@ -113,14 +112,10 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), } override fun finish() { - if (ActivityHelp.size() > 1) { - moveTaskToBack(true) - } else { - if (!BuildConfig.DEBUG) { - Backup.autoBackup() - } - super.finish() + if (!BuildConfig.DEBUG) { + Backup.autoBackup() } + super.finish() } override fun onDestroy() { diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt index f20be3f87..9fc29878b 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt @@ -2,6 +2,7 @@ package io.legado.app.ui.rss.read import android.annotation.SuppressLint import android.os.Bundle +import android.view.KeyEvent import android.view.Menu import android.view.MenuItem import android.webkit.WebSettings @@ -90,4 +91,28 @@ class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_r } DrawableUtils.setTint(starMenuItem?.icon, primaryTextColor) } + + override fun onKeyLongPress(keyCode: Int, event: KeyEvent?): Boolean { + when (keyCode) { + KeyEvent.KEYCODE_BACK -> { + finish() + return true + } + } + return super.onKeyLongPress(keyCode, event) + } + + override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean { + event?.let { + when (keyCode) { + KeyEvent.KEYCODE_BACK -> if (event.isTracking && !event.isCanceled && webView.canGoBack()) { + if (webView.copyBackForwardList().size > 1) { + webView.goBack() + return true + } + } + } + } + return super.onKeyUp(keyCode, event) + } } \ No newline at end of file diff --git a/app/src/main/res/layout/item_bookshelf_grid.xml b/app/src/main/res/layout/item_bookshelf_grid.xml index 0160a1896..4ed7e8158 100644 --- a/app/src/main/res/layout/item_bookshelf_grid.xml +++ b/app/src/main/res/layout/item_bookshelf_grid.xml @@ -12,7 +12,7 @@