mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
style(chapter): Adjust contrast
This commit is contained in:
parent
87c13b44ab
commit
8e7f5d8897
2 changed files with 9 additions and 6 deletions
|
@ -11,6 +11,9 @@ The format is simplified version of [Keep a Changelog](https://keepachangelog.co
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Changes
|
||||
- Adjust chapter title-details contrast
|
||||
|
||||
## [1.9.1]
|
||||
|
||||
### Fixes
|
||||
|
|
|
@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.util.chapter
|
|||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.widget.TextView
|
||||
import androidx.core.graphics.ColorUtils
|
||||
import androidx.core.widget.TextViewCompat
|
||||
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
|
||||
import eu.kanade.tachiyomi.R
|
||||
|
@ -102,11 +103,10 @@ class ChapterUtil {
|
|||
|
||||
private fun readColor(context: Context): Int = context.contextCompatColor(R.color.read_chapter)
|
||||
|
||||
private fun unreadColor(context: Context, secondary: Boolean = false): Int =
|
||||
if (!secondary) {
|
||||
context.getResourceColor(R.attr.colorOnBackground)
|
||||
} else {
|
||||
context.getResourceColor(android.R.attr.textColorSecondary)
|
||||
private fun unreadColor(context: Context, secondary: Boolean = false): Int {
|
||||
val color = context.getResourceColor(R.attr.colorOnSurface)
|
||||
// 78% alpha for chapter details, 100% for chapter number/title
|
||||
return ColorUtils.setAlphaComponent(color, if (secondary) 198 else 255)
|
||||
}
|
||||
|
||||
private fun bookmarkedColor(context: Context): Int = context.getResourceColor(R.attr.colorSecondary)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue