From ce6848b3c0c48b7321e8b21278867e49ab4c6992 Mon Sep 17 00:00:00 2001 From: arkon Date: Thu, 7 May 2020 23:03:22 -0400 Subject: [PATCH] Show icon when chapter is bookmarked --- .../tachiyomi/ui/manga/chapter/ChapterHolder.kt | 13 +++++++++---- app/src/main/res/layout/chapters_item.xml | 17 ++++++++++++++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt index 119a61073..4f4703e0f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt @@ -8,7 +8,9 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder +import eu.kanade.tachiyomi.util.view.visibleIf import java.util.Date +import kotlinx.android.synthetic.main.chapters_item.bookmark_icon import kotlinx.android.synthetic.main.chapters_item.chapter_description import kotlinx.android.synthetic.main.chapters_item.chapter_title import kotlinx.android.synthetic.main.chapters_item.download_text @@ -30,12 +32,15 @@ class ChapterHolder( } // Set correct text color - val chapterColor = if (chapter.read) adapter.readColor else adapter.unreadColor + val chapterColor = when { + chapter.read -> adapter.readColor + chapter.bookmark -> adapter.bookmarkedColor + else -> adapter.unreadColor + } chapter_title.setTextColor(chapterColor) chapter_description.setTextColor(chapterColor) - if (chapter.bookmark) { - chapter_title.setTextColor(adapter.bookmarkedColor) - } + + bookmark_icon.visibleIf { chapter.bookmark } val descriptions = mutableListOf() diff --git a/app/src/main/res/layout/chapters_item.xml b/app/src/main/res/layout/chapters_item.xml index a565d4c70..e3cf50626 100644 --- a/app/src/main/res/layout/chapters_item.xml +++ b/app/src/main/res/layout/chapters_item.xml @@ -8,6 +8,21 @@ android:paddingStart="16dp" android:paddingEnd="16dp"> + +