Render YES_AUTO as outlined checkmark
|
Before Width: | Height: | Size: 603 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.9 KiB |
@@ -117,6 +117,7 @@ class CheckmarkButtonView(
|
|||||||
|
|
||||||
private inner class Drawer {
|
private inner class Drawer {
|
||||||
private val rect = RectF()
|
private val rect = RectF()
|
||||||
|
private val bgColor = sres.getColor(R.attr.cardBgColor)
|
||||||
private val lowContrastColor = sres.getColor(R.attr.contrast40)
|
private val lowContrastColor = sres.getColor(R.attr.contrast40)
|
||||||
private val mediumContrastColor = sres.getColor(R.attr.contrast60)
|
private val mediumContrastColor = sres.getColor(R.attr.contrast60)
|
||||||
|
|
||||||
@@ -128,9 +129,7 @@ class CheckmarkButtonView(
|
|||||||
|
|
||||||
fun draw(canvas: Canvas) {
|
fun draw(canvas: Canvas) {
|
||||||
paint.color = when (value) {
|
paint.color = when (value) {
|
||||||
YES_MANUAL -> color
|
YES_MANUAL, YES_AUTO, SKIP -> color
|
||||||
YES_AUTO -> mediumContrastColor
|
|
||||||
SKIP -> color
|
|
||||||
NO -> {
|
NO -> {
|
||||||
if (preferences.areQuestionMarksEnabled()) mediumContrastColor
|
if (preferences.areQuestionMarksEnabled()) mediumContrastColor
|
||||||
else lowContrastColor
|
else lowContrastColor
|
||||||
@@ -146,6 +145,13 @@ class CheckmarkButtonView(
|
|||||||
}
|
}
|
||||||
else -> R.string.fa_check
|
else -> R.string.fa_check
|
||||||
}
|
}
|
||||||
|
if (value == YES_AUTO) {
|
||||||
|
paint.strokeWidth = 5f
|
||||||
|
paint.style = Paint.Style.STROKE
|
||||||
|
} else {
|
||||||
|
paint.strokeWidth = 0f
|
||||||
|
paint.style = Paint.Style.FILL
|
||||||
|
}
|
||||||
|
|
||||||
paint.textSize = when (value) {
|
paint.textSize = when (value) {
|
||||||
UNKNOWN -> dim(R.dimen.smallerTextSize)
|
UNKNOWN -> dim(R.dimen.smallerTextSize)
|
||||||
@@ -158,6 +164,12 @@ class CheckmarkButtonView(
|
|||||||
rect.set(0f, 0f, width.toFloat(), height.toFloat())
|
rect.set(0f, 0f, width.toFloat(), height.toFloat())
|
||||||
rect.offset(0f, 0.4f * em)
|
rect.offset(0f, 0.4f * em)
|
||||||
canvas.drawText(label, rect.centerX(), rect.centerY(), paint)
|
canvas.drawText(label, rect.centerX(), rect.centerY(), paint)
|
||||||
|
|
||||||
|
if (value == YES_AUTO) {
|
||||||
|
paint.color = bgColor
|
||||||
|
paint.style = Paint.Style.FILL
|
||||||
|
canvas.drawText(label, rect.centerX(), rect.centerY(), paint)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||