|
|
|
@ -25,7 +25,7 @@ class BatteryView @JvmOverloads constructor( |
|
|
|
|
set(value) { |
|
|
|
|
field = value |
|
|
|
|
if (value) { |
|
|
|
|
typeface = batteryTypeface |
|
|
|
|
super.setTypeface(batteryTypeface) |
|
|
|
|
postInvalidate() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -37,6 +37,12 @@ class BatteryView @JvmOverloads constructor( |
|
|
|
|
batteryPaint.color = paint.color |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun setTypeface(tf: Typeface?) { |
|
|
|
|
if (!isBattery) { |
|
|
|
|
super.setTypeface(tf) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun setColor(@ColorInt color: Int) { |
|
|
|
|
setTextColor(color) |
|
|
|
|
batteryPaint.color = color |
|
|
|
|