mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix initial downloaded badge color
which applies in recents and manga details when theming is off some refactoring to in DownloadButton as well, like renaming colorSecondary to accentColor
This commit is contained in:
parent
bccb7c0e03
commit
31ec0ec945
2 changed files with 8 additions and 15 deletions
|
@ -19,29 +19,22 @@ import eu.kanade.tachiyomi.util.system.getResourceColor
|
|||
class DownloadButton @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
|
||||
FrameLayout(context, attrs) {
|
||||
|
||||
var colorSecondary = context.getResourceColor(R.attr.colorSecondary)
|
||||
var accentColor = context.getResourceColor(R.attr.colorSecondary)
|
||||
set(value) {
|
||||
field = value
|
||||
activeColor = colorSecondary
|
||||
downloadedColor = colorSecondary
|
||||
activeColor = ColorUtils.blendARGB(value, bgColor, 0.05f)
|
||||
downloadedColor = ColorUtils.blendARGB(value, cOnBgColor, 0.3f)
|
||||
}
|
||||
private val bgColor = context.getResourceColor(R.attr.background)
|
||||
private var activeColor = ColorUtils.blendARGB(colorSecondary, bgColor, 0.05f)
|
||||
set(value) { field = ColorUtils.blendARGB(value, bgColor, 0.05f) }
|
||||
|
||||
private val cOnBgColor = context.getResourceColor(R.attr.colorOnBackground)
|
||||
private var downloadedColor = ColorUtils.blendARGB(colorSecondary, cOnBgColor, 0.05f)
|
||||
set(value) { field = ColorUtils.blendARGB(value, cOnBgColor, 0.3f) }
|
||||
private val progressBGColor by lazy {
|
||||
ContextCompat.getColor(context, R.color.divider)
|
||||
}
|
||||
private var activeColor = ColorUtils.blendARGB(accentColor, bgColor, 0.05f)
|
||||
private var downloadedColor = ColorUtils.blendARGB(accentColor, cOnBgColor, 0.3f)
|
||||
private val progressBGColor by lazy { ContextCompat.getColor(context, R.color.divider) }
|
||||
private val disabledColor by lazy {
|
||||
ContextCompat.getColor(context, R.color.material_on_surface_disabled)
|
||||
}
|
||||
private val downloadedTextColor = context.getResourceColor(R.attr.background)
|
||||
private val errorColor by lazy {
|
||||
ContextCompat.getColor(context, R.color.material_red_500)
|
||||
}
|
||||
private val errorColor by lazy { ContextCompat.getColor(context, R.color.material_red_500) }
|
||||
private val filledCircle by lazy {
|
||||
ContextCompat.getDrawable(context, R.drawable.filled_circle)?.mutate()
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ class ChapterHolder(
|
|||
binding.chapterTitle,
|
||||
ColorStateList.valueOf(it),
|
||||
)
|
||||
colorSecondary = it
|
||||
accentColor = it
|
||||
}
|
||||
if (locked) {
|
||||
isVisible = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue