pull/36/head
kunfei 6 years ago
parent 0b2007870f
commit e362ab2ad9
  1. 2
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt
  2. 5
      app/src/main/java/io/legado/app/ui/widget/anima/explosion_field/Utils.kt

@ -445,7 +445,7 @@ class AnalyzeRule(private var book: BaseBook? = null) {
} }
//分离正则表达式 //分离正则表达式
val ruleStrS = val ruleStrS =
rule.trim { it <= ' ' }.splitNotBlank("##") rule.trim { it <= ' ' }.split("##")
rule = ruleStrS[0] rule = ruleStrS[0]
if (ruleStrS.size > 1) { if (ruleStrS.size > 1) {
replaceRegex = ruleStrS[1] replaceRegex = ruleStrS[1]

@ -22,6 +22,7 @@ import android.graphics.Canvas
import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.BitmapDrawable
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import kotlin.math.roundToInt
object Utils { object Utils {
@ -29,7 +30,7 @@ object Utils {
private val sCanvas = Canvas() private val sCanvas = Canvas()
fun dp2Px(dp: Int): Int { fun dp2Px(dp: Int): Int {
return Math.round(dp * DENSITY) return (dp * DENSITY).roundToInt()
} }
fun createBitmapFromView(view: View): Bitmap? { fun createBitmapFromView(view: View): Bitmap? {
@ -55,7 +56,7 @@ object Utils {
return bitmap return bitmap
} }
fun createBitmapSafely( private fun createBitmapSafely(
width: Int, width: Int,
height: Int, height: Int,
config: Bitmap.Config, config: Bitmap.Config,

Loading…
Cancel
Save