pull/441/head
gedoor 4 years ago
parent 0cef6b0ad1
commit eea6fa1eab
  1. 0
      app/src/main/assets/font/number.ttf
  2. 3
      app/src/main/java/io/legado/app/ui/widget/BatteryView.kt

@ -10,6 +10,7 @@ import android.util.AttributeSet
import androidx.annotation.ColorInt
import androidx.appcompat.widget.AppCompatTextView
import io.legado.app.utils.dp
import java.io.File
class BatteryView(context: Context, attrs: AttributeSet?) : AppCompatTextView(context, attrs) {
private val batteryPaint = Paint()
@ -22,7 +23,7 @@ class BatteryView(context: Context, attrs: AttributeSet?) : AppCompatTextView(co
batteryPaint.strokeWidth = 1.dp.toFloat()
batteryPaint.isAntiAlias = true
batteryPaint.color = paint.color
typeface = Typeface.createFromAsset(context.assets, "number.ttf")
typeface = Typeface.createFromAsset(context.assets, "font${File.separator}number.ttf")
}
fun setColor(@ColorInt color: Int) {

Loading…
Cancel
Save