|
|
@ -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 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|