Merge pull request #6 from gedoor/master

merge
pull/441/head
口口吕 4 years ago committed by GitHub
commit 6c82189cb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/src/main/assets/httpTTS.json
  2. 5
      app/src/main/assets/updateLog.md
  3. 87
      app/src/main/java/io/legado/app/help/ReadBookConfig.kt
  4. 24
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt
  5. 40
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt
  6. 46
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByXPath.kt
  7. 2
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt
  8. 4
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  9. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivityHelp.kt
  10. 62
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  11. 6
      app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt
  12. 2
      app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugActivity.kt
  13. 2
      app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt
  14. 13
      app/src/main/res/drawable/ic_last_read.xml
  15. 4
      app/src/main/res/layout/activity_read_record.xml
  16. 2
      app/src/main/res/menu/book_source.xml
  17. 2
      app/src/main/res/values-zh-rHK/strings.xml
  18. 2
      app/src/main/res/values-zh-rTW/strings.xml
  19. 2
      app/src/main/res/values-zh/strings.xml
  20. 2
      app/src/main/res/values/strings.xml

@ -12,7 +12,7 @@
{
"id": 1598233029306,
"name": "度逍遥",
"url": "http://tts.baidu.com/text2audio,{\n \"method\": \"POST\",\n \"body\": \"tex={{java.encodeURI(java.encodeURI(speakText))}}&spd={{String((speakSpeed + 5) / 10 + 4)}}&per=3&cuid=baidu_speech_demo&idx=1&cod=2&lan=zh&ctp=1&pdt=1&vol=5&pit=5&_res_tag_=audio\"\n}"
"url": "http://tts.baidu.com/text2audio,{\n \"method\": \"POST\",\n \"body\": \"tex={{java.encodeURI(java.encodeURI(speakText))}}&spd={{String((speakSpeed + 5) / 10 + 4)}}&per=5003&cuid=baidu_speech_demo&idx=1&cod=2&lan=zh&ctp=1&pdt=1&vol=5&pit=5&_res_tag_=audio\"\n}"
},
{
"id": 1598233029307,

@ -3,6 +3,11 @@
* 关注合作公众号 **[小说拾遗]()** 获取好看的小说。
* 旧版数据导入教程:先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】。
**2020/10/16**
* 修复排版导入背景失败bug
* 修改默认度逍遥per为5003,需要重新导入默认
* 优化规则解析
**2020/10/14**
* 优化替换规则编辑界面
* 修复网格书架间距变大bug

@ -42,7 +42,7 @@ object ReadBookConfig {
var bg: Drawable? = null
var bgMeanColor: Int = 0
val textColor: Int get() = durConfig.textColor()
val textColor: Int get() = durConfig.curTextColor()
init {
initConfigs()
@ -93,7 +93,7 @@ object ReadBookConfig {
val dm = resources.displayMetrics
val width = dm.widthPixels
val height = dm.heightPixels
bg = durConfig.bgDrawable(width, height).apply {
bg = durConfig.curBgDrawable(width, height).apply {
if (this is BitmapDrawable) {
bgMeanColor = BitmapUtils.getMeanColor(bitmap)
} else if (this is ColorDrawable) {
@ -168,9 +168,9 @@ object ReadBookConfig {
val config get() = if (shareLayout) shareConfig else durConfig
var pageAnim: Int
get() = config.pageAnim()
get() = config.curPageAnim()
set(value) {
config.setPageAnim(value)
config.setCurPageAnim(value)
isScroll = pageAnim == 3
}
@ -365,12 +365,12 @@ object ReadBookConfig {
@Keep
@Parcelize
class Config(
private var bgStr: String = "#EEEEEE",//白天背景
private var bgStrNight: String = "#000000",//夜间背景
private var bgStrEInk: String = "#FFFFFF",
private var bgType: Int = 0,//白天背景类型 0:颜色, 1:assets图片, 2其它图片
private var bgTypeNight: Int = 0,//夜间背景类型
private var bgTypeEInk: Int = 0,
var bgStr: String = "#EEEEEE",//白天背景
var bgStrNight: String = "#000000",//夜间背景
var bgStrEInk: String = "#FFFFFF",
var bgType: Int = 0,//白天背景类型 0:颜色, 1:assets图片, 2其它图片
var bgTypeNight: Int = 0,//夜间背景类型
var bgTypeEInk: Int = 0,
private var darkStatusIcon: Boolean = true,//白天是否暗色状态栏
private var darkStatusIconNight: Boolean = false,//晚上是否暗色状态栏
private var darkStatusIconEInk: Boolean = true,
@ -413,24 +413,8 @@ object ReadBookConfig {
var hideHeader: Boolean = true,
var hideFooter: Boolean = false
) : Parcelable {
fun setBg(bgType: Int, bg: String) {
when {
AppConfig.isEInkMode -> {
bgTypeEInk = bgType
bgStrEInk = bg
}
AppConfig.isNightTheme -> {
bgTypeNight = bgType
bgStrNight = bg
}
else -> {
this.bgType = bgType
bgStr = bg
}
}
}
fun setTextColor(color: Int) {
fun setCurTextColor(color: Int) {
when {
AppConfig.isEInkMode -> textColorEInk = "#${color.hexString}"
AppConfig.isNightTheme -> textColorNight = "#${color.hexString}"
@ -439,7 +423,15 @@ object ReadBookConfig {
ChapterProvider.upStyle()
}
fun setStatusIconDark(isDark: Boolean) {
fun curTextColor(): Int {
return when {
AppConfig.isEInkMode -> Color.parseColor(textColorEInk)
AppConfig.isNightTheme -> Color.parseColor(textColorNight)
else -> Color.parseColor(textColor)
}
}
fun setCurStatusIconDark(isDark: Boolean) {
when {
AppConfig.isEInkMode -> darkStatusIconEInk = isDark
AppConfig.isNightTheme -> darkStatusIconNight = isDark
@ -447,7 +439,7 @@ object ReadBookConfig {
}
}
fun statusIconDark(): Boolean {
fun curStatusIconDark(): Boolean {
return when {
AppConfig.isEInkMode -> darkStatusIconEInk
AppConfig.isNightTheme -> darkStatusIconNight
@ -455,29 +447,38 @@ object ReadBookConfig {
}
}
fun setPageAnim(anim: Int) {
fun setCurPageAnim(anim: Int) {
when {
AppConfig.isEInkMode -> pageAnimEInk = anim
else -> pageAnim = anim
}
}
fun pageAnim(): Int {
fun curPageAnim(): Int {
return when {
AppConfig.isEInkMode -> pageAnimEInk
else -> pageAnim
}
}
fun textColor(): Int {
return when {
AppConfig.isEInkMode -> Color.parseColor(textColorEInk)
AppConfig.isNightTheme -> Color.parseColor(textColorNight)
else -> Color.parseColor(textColor)
fun setCurBg(bgType: Int, bg: String) {
when {
AppConfig.isEInkMode -> {
bgTypeEInk = bgType
bgStrEInk = bg
}
AppConfig.isNightTheme -> {
bgTypeNight = bgType
bgStrNight = bg
}
else -> {
this.bgType = bgType
bgStr = bg
}
}
}
fun bgStr(): String {
fun curBgStr(): String {
return when {
AppConfig.isEInkMode -> bgStrEInk
AppConfig.isNightTheme -> bgStrNight
@ -485,7 +486,7 @@ object ReadBookConfig {
}
}
fun bgType(): Int {
fun curBgType(): Int {
return when {
AppConfig.isEInkMode -> bgTypeEInk
AppConfig.isNightTheme -> bgTypeNight
@ -493,18 +494,18 @@ object ReadBookConfig {
}
}
fun bgDrawable(width: Int, height: Int): Drawable {
fun curBgDrawable(width: Int, height: Int): Drawable {
var bgDrawable: Drawable? = null
val resources = App.INSTANCE.resources
try {
bgDrawable = when (bgType()) {
0 -> ColorDrawable(Color.parseColor(bgStr()))
bgDrawable = when (curBgType()) {
0 -> ColorDrawable(Color.parseColor(curBgStr()))
1 -> {
BitmapDrawable(
resources,
BitmapUtils.decodeAssetsBitmap(
App.INSTANCE,
"bg" + File.separator + bgStr(),
"bg" + File.separator + curBgStr(),
width,
height
)
@ -512,7 +513,7 @@ object ReadBookConfig {
}
else -> BitmapDrawable(
resources,
BitmapUtils.decodeBitmap(bgStr(), width, height)
BitmapUtils.decodeBitmap(curBgStr(), width, height)
)
}
} catch (e: Exception) {

@ -10,13 +10,12 @@ import java.util.regex.Pattern
@Keep
class AnalyzeByJSonPath {
private var ctx: ReadContext? = null
private lateinit var ctx: ReadContext
fun parse(json: Any): AnalyzeByJSonPath {
ctx = if (json is String) {
JsonPath.parse(json)
} else {
JsonPath.parse(json)
ctx = when (json) {
is String -> JsonPath.parse(json)
else -> JsonPath.parse(json)
}
return this
}
@ -35,9 +34,9 @@ class AnalyzeByJSonPath {
}
if (rules.size == 1) {
if (!rule.contains("{$.")) {
ctx?.let {
result = try {
val ob = it.read<Any>(rule)
try {
val ob = ctx.read<Any>(rule)
result =
if (ob is List<*>) {
val builder = StringBuilder()
for (o in ob) {
@ -48,8 +47,6 @@ class AnalyzeByJSonPath {
ob.toString()
}
} catch (ignored: Exception) {
rule
}
}
return result
} else {
@ -100,7 +97,7 @@ class AnalyzeByJSonPath {
if (rules.size == 1) {
if (!rule.contains("{$.")) {
try {
val obj = ctx!!.read<Any>(rule) ?: return result
val obj = ctx.read<Any>(rule) ?: return result
if (obj is List<*>) {
for (o in obj)
result.add(o.toString())
@ -108,7 +105,6 @@ class AnalyzeByJSonPath {
result.add(obj.toString())
}
} catch (ignored: Exception) {
result.add(rule)
}
return result
} else {
@ -152,7 +148,7 @@ class AnalyzeByJSonPath {
}
internal fun getObject(rule: String): Any {
return ctx!!.read(rule)
return ctx.read(rule)
}
internal fun getList(rule: String): ArrayList<Any>? {
@ -175,7 +171,7 @@ class AnalyzeByJSonPath {
}
}
if (rules.size == 1) {
ctx?.let {
ctx.let {
try {
return it.read<ArrayList<Any>>(rules[0])
} catch (e: Exception) {

@ -18,19 +18,17 @@ import java.util.*
*/
@Keep
class AnalyzeByJSoup {
private var element: Element? = null
companion object {
val validKeys = arrayOf("class", "id", "tag", "text", "children")
}
private lateinit var element: Element
fun parse(doc: Any): AnalyzeByJSoup {
element = if (doc is Element) {
doc
} else if (doc is JXNode) {
if (doc.isElement) {
doc.asElement()
} else {
Jsoup.parse(doc.value().toString())
}
} else {
Jsoup.parse(doc.toString())
element = when (doc) {
is Element -> doc
is JXNode -> if (doc.isElement) doc.asElement() else Jsoup.parse(doc.toString())
else -> Jsoup.parse(doc.toString())
}
return this
}
@ -79,7 +77,7 @@ class AnalyzeByJSoup {
//拆分规则
val sourceRule = SourceRule(ruleStr)
if (isEmpty(sourceRule.elementsRule)) {
textS.add(element?.data() ?: "")
textS.add(element.data() ?: "")
} else {
val elementsType: String
val ruleStrS: Array<String>
@ -103,7 +101,7 @@ class AnalyzeByJSoup {
temp = if (sourceRule.isCss) {
val lastIndex = ruleStrX.lastIndexOf('@')
getResultLast(
element!!.select(ruleStrX.substring(0, lastIndex)),
element.select(ruleStrX.substring(0, lastIndex)),
ruleStrX.substring(lastIndex + 1)
)
} else {
@ -232,18 +230,18 @@ class AnalyzeByJSoup {
elements.addAll(es)
}
} else {
val rulePcx = rule.splitNotBlank("!")
val rulePc =
rulePcx[0].trim { it <= ' ' }.splitNotBlank(">")
val rules =
rulePc[0].trim { it <= ' ' }.splitNotBlank(".")
val rulePcx = rule.split("!")
val rulePc = rulePcx[0].trim { it <= ' ' }.split(">")
val rules = rulePc[0].trim { it <= ' ' }.split(".")
var filterRules: Array<String>? = null
var needFilterElements = rulePc.size > 1 && !isEmpty(rulePc[1].trim { it <= ' ' })
if (needFilterElements) {
filterRules = rulePc[1].trim { it <= ' ' }.splitNotBlank(".")
filterRules = rulePc[1].trim { it <= ' ' }.split(".").toTypedArray()
filterRules[0] = filterRules[0].trim { it <= ' ' }
val validKeys = listOf("class", "id", "tag", "text")
if (filterRules.size < 2 || !validKeys.contains(filterRules[0]) || isEmpty(filterRules[1].trim { it <= ' ' })) {
if (filterRules.size < 2
|| !validKeys.contains(filterRules[0])
|| filterRules[1].trim { it <= ' ' }.isEmpty()
) {
needFilterElements = false
}
filterRules[1] = filterRules[1].trim { it <= ' ' }

@ -12,28 +12,15 @@ import java.util.*
@Keep
class AnalyzeByXPath {
private var jxDocument: JXDocument? = null
private var jxNode: JXNode? = null
private lateinit var jxNode: Any
fun parse(doc: Any): AnalyzeByXPath {
if (doc is JXNode) {
jxNode = doc
if (jxNode?.isElement == false) {
jxDocument = strToJXDocument(doc.toString())
jxNode = null
}
} else if (doc is Document) {
jxDocument = JXDocument.create(doc)
jxNode = null
} else if (doc is Element) {
jxDocument = JXDocument.create(Elements(doc))
jxNode = null
} else if (doc is Elements) {
jxDocument = JXDocument.create(doc)
jxNode = null
} else {
jxDocument = strToJXDocument(doc.toString())
jxNode = null
jxNode = when (doc) {
is JXNode -> if (doc.isElement) doc else strToJXDocument(doc.toString())
is Document -> JXDocument.create(doc)
is Element -> JXDocument.create(Elements(doc))
is Elements -> JXDocument.create(doc)
else -> strToJXDocument(doc.toString())
}
return this
}
@ -49,6 +36,15 @@ class AnalyzeByXPath {
return JXDocument.create(html1)
}
private fun getResult(xPath: String): List<JXNode>? {
val node = jxNode
return if (node is JXNode) {
node.sel(xPath)
} else {
(node as JXDocument).selN(xPath)
}
}
internal fun getElements(xPath: String): List<JXNode>? {
if (TextUtils.isEmpty(xPath)) {
return null
@ -71,7 +67,7 @@ class AnalyzeByXPath {
}
}
if (rules.size == 1) {
return jxNode?.sel(rules[0]) ?: jxDocument?.selN(rules[0])
return getResult(rules[0])
} else {
val results = ArrayList<List<JXNode>>()
for (rl in rules) {
@ -121,8 +117,7 @@ class AnalyzeByXPath {
}
}
if (rules.size == 1) {
val jxNodes = jxNode?.sel(xPath) ?: jxDocument?.selN(xPath)
jxNodes?.map {
getResult(xPath)?.map {
result.add(it.asString())
}
return result
@ -167,9 +162,8 @@ class AnalyzeByXPath {
elementsType = "|"
}
if (rules.size == 1) {
val jxNodes = jxNode?.sel(rule) ?: jxDocument?.selN(rule)
jxNodes?.let {
return TextUtils.join("\n", jxNodes)
getResult(rule)?.let {
return TextUtils.join("\n", it)
}
return null
} else {

@ -461,7 +461,7 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions {
mode = Mode.Regex
}
splitRegex(tmp)
} else if (mode != Mode.Js && mode != Mode.Json && mode != Mode.Regex
} else if (mode != Mode.Js && mode != Mode.Regex
&& evalMatcher.start() == 0
) {
mode = Mode.Regex

@ -741,11 +741,11 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo
override fun onColorSelected(dialogId: Int, color: Int) = with(ReadBookConfig.durConfig) {
when (dialogId) {
TEXT_COLOR -> {
setTextColor(color)
setCurTextColor(color)
postEvent(EventBus.UP_CONFIG, false)
}
BG_COLOR -> {
setBg(0, "#${color.hexString}")
setCurBg(0, "#${color.hexString}")
ReadBookConfig.upBg()
postEvent(EventBus.UP_CONFIG, false)
}

@ -59,7 +59,7 @@ object ReadBookActivityHelp {
}
window.decorView.systemUiVisibility = flag
if (toolBarHide) {
ATH.setLightStatusBar(window, ReadBookConfig.durConfig.statusIconDark())
ATH.setLightStatusBar(window, ReadBookConfig.durConfig.curStatusIconDark())
} else {
ATH.setLightStatusBarAuto(
window,

@ -108,7 +108,7 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
@SuppressLint("InflateParams")
private fun initData() = with(ReadBookConfig.durConfig) {
sw_dark_status_icon.isChecked = statusIconDark()
sw_dark_status_icon.isChecked = curStatusIconDark()
adapter = BgAdapter(requireContext())
recycler_view.adapter = adapter
val headerView = LayoutInflater.from(requireContext())
@ -127,13 +127,13 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
private fun initEvent() = with(ReadBookConfig.durConfig) {
sw_dark_status_icon.onCheckedChange { buttonView, isChecked ->
if (buttonView?.isPressed == true) {
setStatusIconDark(isChecked)
setCurStatusIconDark(isChecked)
(activity as? ReadBookActivity)?.upSystemUiVisibility()
}
}
tv_text_color.onClick {
ColorPickerDialog.newBuilder()
.setColor(textColor())
.setColor(curTextColor())
.setShowAlphaSlider(false)
.setDialogType(ColorPickerDialog.TYPE_CUSTOM)
.setDialogId(TEXT_COLOR)
@ -141,7 +141,7 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
}
tv_bg_color.onClick {
val bgColor =
if (bgType() == 0) Color.parseColor(bgStr())
if (curBgType() == 0) Color.parseColor(curBgStr())
else Color.parseColor("#015A86")
ColorPickerDialog.newBuilder()
.setColor(bgColor)
@ -206,7 +206,7 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
holder.itemView.apply {
this.onClick {
getItemByLayoutPosition(holder.layoutPosition)?.let {
ReadBookConfig.durConfig.setBg(1, it)
ReadBookConfig.durConfig.setCurBg(1, it)
ReadBookConfig.upBg()
postEvent(EventBus.UP_CONFIG, false)
}
@ -237,9 +237,27 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
exportFiles.add(fontExportFile)
}
}
if (ReadBookConfig.durConfig.bgType() == 2) {
val bgName = FileUtils.getName(ReadBookConfig.durConfig.bgStr())
val bgFile = File(ReadBookConfig.durConfig.bgStr())
if (ReadBookConfig.durConfig.bgType == 2) {
val bgName = FileUtils.getName(ReadBookConfig.durConfig.bgStr)
val bgFile = File(ReadBookConfig.durConfig.bgStr)
if (bgFile.exists()) {
val bgExportFile = File(FileUtils.getPath(configDir, bgName))
bgFile.copyTo(bgExportFile)
exportFiles.add(bgExportFile)
}
}
if (ReadBookConfig.durConfig.bgTypeNight == 2) {
val bgName = FileUtils.getName(ReadBookConfig.durConfig.bgStrNight)
val bgFile = File(ReadBookConfig.durConfig.bgStrNight)
if (bgFile.exists()) {
val bgExportFile = File(FileUtils.getPath(configDir, bgName))
bgFile.copyTo(bgExportFile)
exportFiles.add(bgExportFile)
}
}
if (ReadBookConfig.durConfig.bgTypeEInk == 2) {
val bgName = FileUtils.getName(ReadBookConfig.durConfig.bgStrEInk)
val bgFile = File(ReadBookConfig.durConfig.bgStrEInk)
if (bgFile.exists()) {
val bgExportFile = File(FileUtils.getPath(configDir, bgName))
bgFile.copyTo(bgExportFile)
@ -329,8 +347,28 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
}
config.textFont = fontPath
}
if (config.bgType() == 2) {
val bgName = FileUtils.getName(config.bgStr())
if (config.bgType == 2) {
val bgName = FileUtils.getName(config.bgStr)
val bgPath = FileUtils.getPath(requireContext().externalFilesDir, "bg", bgName)
if (!FileUtils.exist(bgPath)) {
val bgFile = FileUtils.getFile(configDir, bgName)
if (bgFile.exists()) {
bgFile.copyTo(File(bgPath))
}
}
}
if (config.bgTypeNight == 2) {
val bgName = FileUtils.getName(config.bgStrNight)
val bgPath = FileUtils.getPath(requireContext().externalFilesDir, "bg", bgName)
if (!FileUtils.exist(bgPath)) {
val bgFile = FileUtils.getFile(configDir, bgName)
if (bgFile.exists()) {
bgFile.copyTo(File(bgPath))
}
}
}
if (config.bgTypeEInk == 2) {
val bgName = FileUtils.getName(config.bgStrEInk)
val bgPath = FileUtils.getPath(requireContext().externalFilesDir, "bg", bgName)
if (!FileUtils.exist(bgPath)) {
val bgFile = FileUtils.getFile(configDir, bgName)
@ -387,7 +425,7 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
DocumentUtils.readBytes(requireContext(), doc.uri)
}.getOrNull()?.let { byteArray ->
file.writeBytes(byteArray)
ReadBookConfig.durConfig.setBg(2, file.absolutePath)
ReadBookConfig.durConfig.setCurBg(2, file.absolutePath)
ReadBookConfig.upBg()
postEvent(EventBus.UP_CONFIG, false)
} ?: toast("获取文件出错")
@ -401,7 +439,7 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
.rationale(R.string.bg_image_per)
.onGranted {
RealPathUtil.getPath(requireContext(), uri)?.let { path ->
ReadBookConfig.durConfig.setBg(2, path)
ReadBookConfig.durConfig.setCurBg(2, path)
ReadBookConfig.upBg()
postEvent(EventBus.UP_CONFIG, false)
}

@ -246,13 +246,13 @@ class ReadStyleDialog : BaseDialogFragment(), FontSelectDialog.CallBack {
payloads: MutableList<Any>
) {
holder.itemView.apply {
iv_style.setTextColor(item.textColor())
iv_style.setImageDrawable(item.bgDrawable(100, 150))
iv_style.setTextColor(item.curTextColor())
iv_style.setImageDrawable(item.curBgDrawable(100, 150))
if (ReadBookConfig.styleSelect == holder.layoutPosition) {
iv_style.borderColor = accentColor
iv_style.setTextBold(true)
} else {
iv_style.borderColor = item.textColor()
iv_style.borderColor = item.curTextColor()
iv_style.setTextBold(false)
}
}

@ -5,7 +5,6 @@ import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import androidx.appcompat.widget.SearchView
import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.lib.theme.ATH
@ -44,7 +43,6 @@ class BookSourceDebugActivity :
private fun initRecyclerView() {
ATH.applyEdgeEffectColor(recycler_view)
adapter = BookSourceDebugAdapter(this)
recycler_view.layoutManager = LinearLayoutManager(this)
recycler_view.adapter = adapter
rotate_loading.loadingColor = accentColor
}

@ -1,7 +1,6 @@
package io.legado.app.ui.rss.source.debug
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.lib.theme.ATH
@ -40,7 +39,6 @@ class RssSourceDebugActivity : VMBaseActivity<RssSourceDebugModel>(R.layout.acti
private fun initRecyclerView() {
ATH.applyEdgeEffectColor(recycler_view)
adapter = RssSourceDebugAdapter(this)
recycler_view.layoutManager = LinearLayoutManager(this)
recycler_view.adapter = adapter
rotate_loading.loadingColor = accentColor
}

@ -1,13 +0,0 @@
<vector android:autoMirrored="true"
android:height="24dp"
android:viewportHeight="48"
android:viewportWidth="48"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#39393A"
android:fillType="evenOdd"
android:pathData="M39.4,11H8.6c-0.7,0 -1.2,-0.5 -1.2,-1.2c0,-0.7 0.5,-1.2 1.2,-1.2h30.8c0.7,0 1.2,0.5 1.2,1.2C40.6,10.4 40.1,11 39.4,11zM8.6,18.1h21.3c0.7,0 1.2,0.5 1.2,1.2c0,0.7 -0.5,1.2 -1.2,1.2H8.6c-0.7,0 -1.2,-0.5 -1.2,-1.2C7.4,18.6 7.9,18.1 8.6,18.1zM8.6,27.6h30.8c0.7,0 1.2,0.5 1.2,1.2c0,0.7 -0.5,1.2 -1.2,1.2H8.6c-0.7,0 -1.2,-0.5 -1.2,-1.2C7.4,28.1 7.9,27.6 8.6,27.6zM8.6,37h17.8c0.7,0 1.2,0.5 1.2,1.2c0,0.7 -0.5,1.2 -1.2,1.2H8.6c-0.7,0 -1.2,-0.5 -1.2,-1.2C7.4,37.6 7.9,37 8.6,37z"
android:strokeColor="#39393A"
android:strokeWidth="1" />
</vector>

@ -24,7 +24,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout>

@ -49,7 +49,7 @@
<item
android:id="@+id/menu_sort_time"
android:checkable="true"
android:title="@string/sort_by_lastUppdateTime" />
android:title="@string/sort_by_lastUpdateTime" />
</group>
</menu>

@ -765,7 +765,7 @@
<string name="theme_list_summary">使用保存主题,导入,分享主题</string>
<string name="select_theme">切換默認主題</string>
<string name="share_selected_source">分享選中書源</string>
<string name="sort_by_lastUppdateTime">時間排序</string>
<string name="sort_by_lastUpdateTime">時間排序</string>
<string name="search_content">全文搜索</string>
<string name="rss_source_empty">关注公众号[开源阅读]获取订阅源!</string>
<string name="explore_empty">当前没有发现源,关注公众号[开源阅读]添加带发现的书源!</string>

@ -765,7 +765,7 @@
<string name="theme_list_summary">使用儲存主題,匯入,分享主題</string>
<string name="select_theme">切換預設主題</string>
<string name="share_selected_source">分享選中書源</string>
<string name="sort_by_lastUppdateTime">時間排序</string>
<string name="sort_by_lastUpdateTime">時間排序</string>
<string name="search_content">全文搜尋</string>
<string name="rss_source_empty">关注公众号[开源阅读]获取订阅源!</string>
<string name="explore_empty">当前没有发现源,关注公众号[开源阅读]添加带发现的书源!</string>

@ -768,7 +768,7 @@
<string name="theme_list">主题列表</string>
<string name="theme_list_summary">使用保存主题,导入,分享主题</string>
<string name="select_theme">切换默认主题</string>
<string name="sort_by_lastUppdateTime">时间排序</string>
<string name="sort_by_lastUpdateTime">时间排序</string>
<string name="search_content">全文搜索</string>
<string name="rss_source_empty">关注公众号[开源阅读]获取订阅源!</string>
<string name="explore_empty">当前没有发现源,关注公众号[开源阅读]添加带发现的书源!</string>

@ -771,7 +771,7 @@
<string name="theme_list">Theme list</string>
<string name="theme_list_summary">Save, Import, Share theme</string>
<string name="share_selected_source">Share selected sources</string>
<string name="sort_by_lastUppdateTime">Sort by update time</string>
<string name="sort_by_lastUpdateTime">Sort by update time</string>
<string name="search_content">Search content</string>
<string name="rss_source_empty">关注公众号[开源阅读]获取订阅源!</string>
<string name="explore_empty">当前没有发现源,关注公众号[开源阅读]添加带发现的书源!</string>

Loading…
Cancel
Save