From 3bb31c83348e9737c50ffbca1b52f64c182bb668 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 28 Aug 2019 15:17:22 +0800 Subject: [PATCH] up --- .../legado/app/ui/chapterlist/ChapterListAdapter.kt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListAdapter.kt b/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListAdapter.kt index aff557711..aa975798a 100644 --- a/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/chapterlist/ChapterListAdapter.kt @@ -44,14 +44,12 @@ class ChapterListAdapter(val callback: Callback) : class MyViewHolder(view: View) : RecyclerView.ViewHolder(view) { fun bind(bookChapter: BookChapter, callback: Callback) = with(itemView) { - tv_chapter_name.text = bookChapter.title - callback.let { - if (it.durChapterIndex() == bookChapter.index) { - tv_chapter_name.setTextColor(context.accentColor) - } else { - tv_chapter_name.setTextColor(context.getCompatColor(R.color.tv_text_default)) - } + if (callback.durChapterIndex() == bookChapter.index) { + tv_chapter_name.setTextColor(context.accentColor) + } else { + tv_chapter_name.setTextColor(context.getCompatColor(R.color.tv_text_default)) } + tv_chapter_name.text = bookChapter.title itemView.onClick { callback.openChapter(bookChapter) }