feat: 优化代码

pull/141/head
kunfei 5 years ago
parent a198f5da53
commit bfb95d3166
  1. 11
      app/src/main/java/io/legado/app/help/ReadBookConfig.kt

@ -70,12 +70,11 @@ object ReadBookConfig {
val dm = resources.displayMetrics val dm = resources.displayMetrics
val width = dm.widthPixels val width = dm.widthPixels
val height = dm.heightPixels val height = dm.heightPixels
bg = durConfig.bgDrawable(width, height) bg = durConfig.bgDrawable(width, height).apply {
bg?.let { if (this is BitmapDrawable) {
if (it is BitmapDrawable) { bgMeanColor = BitmapUtils.getMeanColor(bitmap)
bgMeanColor = BitmapUtils.getMeanColor(it.bitmap) } else if (this is ColorDrawable) {
} else if (it is ColorDrawable) { bgMeanColor = color
bgMeanColor = it.color
} }
} }
} }

Loading…
Cancel
Save