优化
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
* 目录界面菜单添加替换开关,开启替换加载时间会长一些
|
* 目录界面菜单添加替换开关,开启替换加载时间会长一些
|
||||||
* 书源校验添加规则失效分组,更新书源界面帮助文档
|
* 书源校验添加规则失效分组,更新书源界面帮助文档
|
||||||
* 替换规则添加作用于标题和作用于正文
|
* 替换规则添加作用于标题和作用于正文
|
||||||
|
* 导出支持本地书籍再次导出
|
||||||
* 修复一些bug
|
* 修复一些bug
|
||||||
|
|
||||||
**2022/02/09**
|
**2022/02/09**
|
||||||
|
|||||||
+31
-14
@@ -33,17 +33,29 @@ class CacheAdapter(context: Context, private val callBack: CallBack) :
|
|||||||
if (payloads.isEmpty()) {
|
if (payloads.isEmpty()) {
|
||||||
tvName.text = item.name
|
tvName.text = item.name
|
||||||
tvAuthor.text = context.getString(R.string.author_show, item.getRealAuthor())
|
tvAuthor.text = context.getString(R.string.author_show, item.getRealAuthor())
|
||||||
val cs = cacheChapters[item.bookUrl]
|
if (item.isLocalBook()) {
|
||||||
if (cs == null) {
|
tvDownload.setText(R.string.local_book)
|
||||||
tvDownload.setText(R.string.loading)
|
|
||||||
} else {
|
} else {
|
||||||
tvDownload.text =
|
val cs = cacheChapters[item.bookUrl]
|
||||||
context.getString(R.string.download_count, cs.size, item.totalChapterNum)
|
if (cs == null) {
|
||||||
|
tvDownload.setText(R.string.loading)
|
||||||
|
} else {
|
||||||
|
tvDownload.text =
|
||||||
|
context.getString(
|
||||||
|
R.string.download_count,
|
||||||
|
cs.size,
|
||||||
|
item.totalChapterNum
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
val cacheSize = cacheChapters[item.bookUrl]?.size ?: 0
|
if (item.isLocalBook()) {
|
||||||
tvDownload.text =
|
tvDownload.setText(R.string.local_book)
|
||||||
context.getString(R.string.download_count, cacheSize, item.totalChapterNum)
|
} else {
|
||||||
|
val cacheSize = cacheChapters[item.bookUrl]?.size ?: 0
|
||||||
|
tvDownload.text =
|
||||||
|
context.getString(R.string.download_count, cacheSize, item.totalChapterNum)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
upDownloadIv(ivDownload, item)
|
upDownloadIv(ivDownload, item)
|
||||||
upExportInfo(tvMsg, progressExport, item)
|
upExportInfo(tvMsg, progressExport, item)
|
||||||
@@ -72,14 +84,19 @@ class CacheAdapter(context: Context, private val callBack: CallBack) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun upDownloadIv(iv: ImageView, book: Book) {
|
private fun upDownloadIv(iv: ImageView, book: Book) {
|
||||||
CacheBook.cacheBookMap[book.bookUrl]?.let {
|
if (book.isLocalBook()) {
|
||||||
if (it.isRun()) {
|
iv.gone()
|
||||||
iv.setImageResource(R.drawable.ic_stop_black_24dp)
|
} else {
|
||||||
} else {
|
iv.visible()
|
||||||
|
CacheBook.cacheBookMap[book.bookUrl]?.let {
|
||||||
|
if (it.isRun()) {
|
||||||
|
iv.setImageResource(R.drawable.ic_stop_black_24dp)
|
||||||
|
} else {
|
||||||
|
iv.setImageResource(R.drawable.ic_play_24dp)
|
||||||
|
}
|
||||||
|
} ?: let {
|
||||||
iv.setImageResource(R.drawable.ic_play_24dp)
|
iv.setImageResource(R.drawable.ic_play_24dp)
|
||||||
}
|
}
|
||||||
} ?: let {
|
|
||||||
iv.setImageResource(R.drawable.ic_play_24dp)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user