feat: 优化代码

pull/98/head
kunfei 5 years ago
parent d267874fa8
commit b029c6f865
  1. 8
      app/src/main/java/io/legado/app/ui/download/DownloadAdapter.kt

@ -18,7 +18,13 @@ class DownloadAdapter(context: Context) :
if (payloads.isEmpty()) { if (payloads.isEmpty()) {
tv_name.text = item.name tv_name.text = item.name
tv_author.text = context.getString(R.string.author_show, item.getRealAuthor()) tv_author.text = context.getString(R.string.author_show, item.getRealAuthor())
tv_download.setText(R.string.loading) val cs = cacheChapters[item.bookUrl]
if (cs == null) {
tv_download.setText(R.string.loading)
} else {
tv_download.text =
context.getString(R.string.download_count, cs.size, item.totalChapterNum)
}
} else { } else {
val cacheSize = cacheChapters[item.bookUrl]?.size ?: 0 val cacheSize = cacheChapters[item.bookUrl]?.size ?: 0
tv_download.text = tv_download.text =

Loading…
Cancel
Save