mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 05:49:16 +01:00
Adjustments to download button colors
This commit is contained in:
parent
44c2337e3d
commit
b0948cf0a7
@ -21,11 +21,8 @@ class DownloadButton @JvmOverloads constructor(context: Context, attrs: Attribut
|
|||||||
|
|
||||||
private val activeColor = ColorUtils.blendARGB(
|
private val activeColor = ColorUtils.blendARGB(
|
||||||
context.getResourceColor(R.attr.colorAccent),
|
context.getResourceColor(R.attr.colorAccent),
|
||||||
ContextCompat.getColor(
|
context.getResourceColor(android.R.attr.textColorPrimaryInverse),
|
||||||
context,
|
0.05f
|
||||||
R.color.download
|
|
||||||
),
|
|
||||||
0.3f
|
|
||||||
)
|
)
|
||||||
private val progressBGColor = ContextCompat.getColor(
|
private val progressBGColor = ContextCompat.getColor(
|
||||||
context,
|
context,
|
||||||
@ -35,8 +32,12 @@ class DownloadButton @JvmOverloads constructor(context: Context, attrs: Attribut
|
|||||||
context,
|
context,
|
||||||
R.color.material_on_surface_disabled
|
R.color.material_on_surface_disabled
|
||||||
)
|
)
|
||||||
private val downloadedColor = context.getResourceColor(R.attr.colorAccent)
|
private val downloadedColor = ColorUtils.blendARGB(
|
||||||
private val downloadedTextColor = context.getResourceColor(R.attr.colorOnAccent)
|
context.getResourceColor(R.attr.colorAccent),
|
||||||
|
context.getResourceColor(android.R.attr.textColorPrimary),
|
||||||
|
0.3f
|
||||||
|
)
|
||||||
|
private val downloadedTextColor = context.getResourceColor(android.R.attr.textColorPrimaryInverse)
|
||||||
private val errorColor = ContextCompat.getColor(
|
private val errorColor = ContextCompat.getColor(
|
||||||
context,
|
context,
|
||||||
R.color.material_red_500
|
R.color.material_red_500
|
||||||
@ -154,6 +155,7 @@ class DownloadButton @JvmOverloads constructor(context: Context, attrs: Attribut
|
|||||||
binding.downloadBorder.drawable.setTint(downloadedColor)
|
binding.downloadBorder.drawable.setTint(downloadedColor)
|
||||||
} else {
|
} else {
|
||||||
binding.downloadBorder.setImageDrawable(filledCircle)
|
binding.downloadBorder.setImageDrawable(filledCircle)
|
||||||
|
binding.downloadBorder.drawable.setTint(downloadedColor)
|
||||||
binding.downloadIcon.drawable.setTint(downloadedTextColor)
|
binding.downloadIcon.drawable.setTint(downloadedTextColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user