电池图标禁止替换字体

pull/737/head
gedoor 4 years ago
parent 169457db96
commit f8f2f7b87e
  1. 8
      app/src/main/java/io/legado/app/ui/widget/BatteryView.kt

@ -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

Loading…
Cancel
Save