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