固定电池字体

pull/346/head
gedoor 4 years ago
parent fa471e8799
commit b2f7eb45a5
  1. 2
      app/src/main/java/io/legado/app/ui/widget/BatteryView.kt

@ -5,6 +5,7 @@ import android.content.Context
import android.graphics.Canvas import android.graphics.Canvas
import android.graphics.Paint import android.graphics.Paint
import android.graphics.Rect import android.graphics.Rect
import android.graphics.Typeface
import android.util.AttributeSet import android.util.AttributeSet
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
import androidx.appcompat.widget.AppCompatTextView import androidx.appcompat.widget.AppCompatTextView
@ -21,6 +22,7 @@ class BatteryView(context: Context, attrs: AttributeSet?) : AppCompatTextView(co
batteryPaint.strokeWidth = 1.dp.toFloat() batteryPaint.strokeWidth = 1.dp.toFloat()
batteryPaint.isAntiAlias = true batteryPaint.isAntiAlias = true
batteryPaint.color = paint.color batteryPaint.color = paint.color
typeface = Typeface.createFromAsset(context.assets, "number.ttf")
} }
fun setColor(@ColorInt color: Int) { fun setColor(@ColorInt color: Int) {

Loading…
Cancel
Save