优化
This commit is contained in:
@@ -88,14 +88,14 @@ object ReadBookConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun upBg(width: Int, height: Int) {
|
fun upBg(width: Int, height: Int) {
|
||||||
val tmp = bg
|
val drawable = durConfig.curBgDrawable(width, height)
|
||||||
bg = durConfig.curBgDrawable(width, height).apply {
|
if (drawable is BitmapDrawable && drawable.bitmap != null) {
|
||||||
if (this is BitmapDrawable) {
|
bgMeanColor = drawable.bitmap.getMeanColor()
|
||||||
bgMeanColor = bitmap.getMeanColor()
|
} else if (drawable is ColorDrawable) {
|
||||||
} else if (this is ColorDrawable) {
|
bgMeanColor = drawable.color
|
||||||
bgMeanColor = color
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
val tmp = bg
|
||||||
|
bg = drawable
|
||||||
(tmp as? BitmapDrawable)?.bitmap?.recycle()
|
(tmp as? BitmapDrawable)?.bitmap?.recycle()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user