From e362ab2ad955bef4ea114c257271089e4eb3282f Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 30 Sep 2019 22:21:36 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt | 2 +- .../io/legado/app/ui/widget/anima/explosion_field/Utils.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index bc38b8571..c04981cdd 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -445,7 +445,7 @@ class AnalyzeRule(private var book: BaseBook? = null) { } //分离正则表达式 val ruleStrS = - rule.trim { it <= ' ' }.splitNotBlank("##") + rule.trim { it <= ' ' }.split("##") rule = ruleStrS[0] if (ruleStrS.size > 1) { replaceRegex = ruleStrS[1] diff --git a/app/src/main/java/io/legado/app/ui/widget/anima/explosion_field/Utils.kt b/app/src/main/java/io/legado/app/ui/widget/anima/explosion_field/Utils.kt index 2f99191d2..6e33941fb 100644 --- a/app/src/main/java/io/legado/app/ui/widget/anima/explosion_field/Utils.kt +++ b/app/src/main/java/io/legado/app/ui/widget/anima/explosion_field/Utils.kt @@ -22,6 +22,7 @@ import android.graphics.Canvas import android.graphics.drawable.BitmapDrawable import android.view.View import android.widget.ImageView +import kotlin.math.roundToInt object Utils { @@ -29,7 +30,7 @@ object Utils { private val sCanvas = Canvas() fun dp2Px(dp: Int): Int { - return Math.round(dp * DENSITY) + return (dp * DENSITY).roundToInt() } fun createBitmapFromView(view: View): Bitmap? { @@ -55,7 +56,7 @@ object Utils { return bitmap } - fun createBitmapSafely( + private fun createBitmapSafely( width: Int, height: Int, config: Bitmap.Config,