From 53e1e028a0d4df9416d592112b884acc7f191fc0 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 22 Nov 2019 15:04:51 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/chapterlist/ChapterListAdapter.kt | 8 +++++++- app/src/main/res/layout/item_chapter_list.xml | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) 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 c7adcf2bb..05b70e1d3 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 @@ -9,7 +9,9 @@ import io.legado.app.data.entities.BookChapter import io.legado.app.help.BookHelp import io.legado.app.lib.theme.accentColor import io.legado.app.utils.getCompatColor -import kotlinx.android.synthetic.main.item_bookmark.view.* +import io.legado.app.utils.visible +import kotlinx.android.synthetic.main.item_bookmark.view.tv_chapter_name +import kotlinx.android.synthetic.main.item_chapter_list.view.* import org.jetbrains.anko.sdk27.listeners.onClick class ChapterListAdapter(context: Context, val callback: Callback) : @@ -23,6 +25,10 @@ class ChapterListAdapter(context: Context, val callback: Callback) : tv_chapter_name.setTextColor(context.getCompatColor(R.color.tv_text_default)) } tv_chapter_name.text = item.title + if (!item.tag.isNullOrEmpty()) { + tv_tag.text = item.tag + tv_tag.visible() + } this.onClick { callback.openChapter(item) } diff --git a/app/src/main/res/layout/item_chapter_list.xml b/app/src/main/res/layout/item_chapter_list.xml index 96bd703f0..bd678b4fe 100644 --- a/app/src/main/res/layout/item_chapter_list.xml +++ b/app/src/main/res/layout/item_chapter_list.xml @@ -12,5 +12,12 @@ android:layout_height="wrap_content" android:singleLine="true" /> + \ No newline at end of file