Merge pull request #10 from gedoor/master

up
pull/62/head
口口吕 5 years ago committed by GitHub
commit d656a49f83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      app/src/main/assets/updateLog.md
  2. 15
      app/src/main/java/io/legado/app/help/storage/OldRule.kt
  3. 1
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt
  4. 5
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  5. 25
      app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt
  6. 2
      app/src/main/res/layout/item_bookshelf_grid.xml

@ -4,6 +4,13 @@
* 先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】,提示存储权限,选择允许即可导入成功。 * 先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】,提示存储权限,选择允许即可导入成功。
* 注意:由于安卓10更改了权限策略,还需要给「允许安装其他应用」的权限才能导入源。MIUI11也需要此权限。 * 注意:由于安卓10更改了权限策略,还需要给「允许安装其他应用」的权限才能导入源。MIUI11也需要此权限。
**2019/12/20**
* 阅读界面的下载菜单可以用了
* rss阅读bug修复,webView内可以用返回建返回上一链接
* 优化搜索界面逻辑
* 导入旧书源时url里的&不再转为&&
* 修复书架封面显示不全的bug
**2019/12/16** **2019/12/16**
* 添加几个主题选择 * 添加几个主题选择
* 音频播放添加header支持 * 音频播放添加header支持

@ -5,11 +5,7 @@ import io.legado.app.constant.BookType
import io.legado.app.data.entities.BookSource import io.legado.app.data.entities.BookSource
import io.legado.app.data.entities.rule.* import io.legado.app.data.entities.rule.*
import io.legado.app.help.storage.Restore.jsonPath import io.legado.app.help.storage.Restore.jsonPath
import io.legado.app.utils.GSON import io.legado.app.utils.*
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 java.util.regex.Pattern import java.util.regex.Pattern
object OldRule { object OldRule {
@ -129,7 +125,11 @@ object OldRule {
newRule = newRule.replace("|", "||") newRule = newRule.replace("|", "||")
} }
} }
if (newRule.contains("&") && !newRule.contains("&&")) { if (newRule.contains("&")
&& !newRule.contains("&&")
&& !newRule.contains("http")
&& !newRule.startsWith("/")
) {
newRule = newRule.replace("&", "&&") newRule = newRule.replace("&", "&&")
} }
} }
@ -145,10 +145,9 @@ object OldRule {
return toNewUrl(oldUrls) return toNewUrl(oldUrls)
val urls = oldUrls.split("(&&|\n)+".toRegex()) val urls = oldUrls.split("(&&|\n)+".toRegex())
val newUrls = urls.map { return urls.map {
toNewUrl(it)?.replace("\n\\s*".toRegex(), "") toNewUrl(it)?.replace("\n\\s*".toRegex(), "")
}.joinToString("\n") }.joinToString("\n")
return newUrls
} }
private fun toNewUrl(oldUrl: String?): String? { private fun toNewUrl(oldUrl: String?): String? {

@ -111,7 +111,6 @@ class BookInfoActivity :
tv_intro.text = book.getDisplayIntro() tv_intro.text = book.getDisplayIntro()
book.getDisplayCover()?.let { book.getDisplayCover()?.let {
ImageLoader.load(this, it) ImageLoader.load(this, it)
.error(R.drawable.image_cover_default)
.centerCrop() .centerCrop()
.into(iv_cover) .into(iv_cover)
ImageLoader.load(this, it) ImageLoader.load(this, it)

@ -13,7 +13,6 @@ import io.legado.app.BuildConfig
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.VMBaseActivity import io.legado.app.base.VMBaseActivity
import io.legado.app.constant.Bus import io.legado.app.constant.Bus
import io.legado.app.help.ActivityHelp
import io.legado.app.help.storage.Backup import io.legado.app.help.storage.Backup
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.service.BaseReadAloudService import io.legado.app.service.BaseReadAloudService
@ -113,15 +112,11 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
} }
override fun finish() { override fun finish() {
if (ActivityHelp.size() > 1) {
moveTaskToBack(true)
} else {
if (!BuildConfig.DEBUG) { if (!BuildConfig.DEBUG) {
Backup.autoBackup() Backup.autoBackup()
} }
super.finish() super.finish()
} }
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()

@ -2,6 +2,7 @@ package io.legado.app.ui.rss.read
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import android.view.KeyEvent
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.webkit.WebSettings import android.webkit.WebSettings
@ -90,4 +91,28 @@ class ReadRssActivity : VMBaseActivity<ReadRssViewModel>(R.layout.activity_rss_r
} }
DrawableUtils.setTint(starMenuItem?.icon, primaryTextColor) 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)
}
} }

@ -12,7 +12,7 @@
<io.legado.app.ui.widget.image.CoverImageView <io.legado.app.ui.widget.image.CoverImageView
android:id="@+id/iv_cover" android:id="@+id/iv_cover"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="wrap_content"
android:contentDescription="@string/img_cover" android:contentDescription="@string/img_cover"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/image_cover_default" android:src="@drawable/image_cover_default"

Loading…
Cancel
Save