From eea6fa1eabb2bae2dac2c8cb050c93ad184be232 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 19 Oct 2020 13:27:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/{ => font}/number.ttf | Bin .../java/io/legado/app/ui/widget/BatteryView.kt | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename app/src/main/assets/{ => font}/number.ttf (100%) diff --git a/app/src/main/assets/number.ttf b/app/src/main/assets/font/number.ttf similarity index 100% rename from app/src/main/assets/number.ttf rename to app/src/main/assets/font/number.ttf diff --git a/app/src/main/java/io/legado/app/ui/widget/BatteryView.kt b/app/src/main/java/io/legado/app/ui/widget/BatteryView.kt index 3141c5a86..1711a650e 100644 --- a/app/src/main/java/io/legado/app/ui/widget/BatteryView.kt +++ b/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) {