mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-14 07:35:10 +01:00
Bolding current chapter in reader's chapter list
This commit is contained in:
parent
3438d72232
commit
2df67c5691
@ -1,6 +1,7 @@
|
|||||||
package eu.kanade.tachiyomi.ui.reader
|
package eu.kanade.tachiyomi.ui.reader
|
||||||
|
|
||||||
import android.content.res.ColorStateList
|
import android.content.res.ColorStateList
|
||||||
|
import android.graphics.Typeface
|
||||||
import android.text.format.DateUtils
|
import android.text.format.DateUtils
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
@ -13,7 +14,6 @@ import eu.kanade.tachiyomi.R
|
|||||||
import eu.kanade.tachiyomi.data.database.models.Chapter
|
import eu.kanade.tachiyomi.data.database.models.Chapter
|
||||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||||
import kotlinx.android.synthetic.main.chapters_item.*
|
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
import java.text.DecimalFormatSymbols
|
import java.text.DecimalFormatSymbols
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
@ -83,15 +83,22 @@ class ReaderChapterItem(val chapter: Chapter, val manga: Manga, val isCurrent: B
|
|||||||
|
|
||||||
chapterTitle.setTextColor(
|
chapterTitle.setTextColor(
|
||||||
when {
|
when {
|
||||||
item.isCurrent -> activeColor
|
chapter.bookmark -> activeColor
|
||||||
chapter.read -> readColor
|
chapter.read && !item.isCurrent -> readColor
|
||||||
else -> unreadColor
|
else -> unreadColor
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (item.isCurrent) {
|
||||||
|
chapterTitle.setTypeface(null, Typeface.BOLD)
|
||||||
|
chapterSubtitle.setTypeface(null, Typeface.BOLD)
|
||||||
|
} else {
|
||||||
|
chapterTitle.setTypeface(null, Typeface.NORMAL)
|
||||||
|
chapterSubtitle.setTypeface(null, Typeface.NORMAL)
|
||||||
|
}
|
||||||
|
|
||||||
chapterSubtitle.setTextColor(
|
chapterSubtitle.setTextColor(
|
||||||
when {
|
when {
|
||||||
item.isCurrent -> activeColor
|
|
||||||
chapter.read -> readColor
|
chapter.read -> readColor
|
||||||
else -> unreadColor
|
else -> unreadColor
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user