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