|
|
@ -570,20 +570,14 @@ object ReadBookConfig { |
|
|
|
bgDrawable = when (curBgType()) { |
|
|
|
bgDrawable = when (curBgType()) { |
|
|
|
0 -> ColorDrawable(Color.parseColor(curBgStr())) |
|
|
|
0 -> ColorDrawable(Color.parseColor(curBgStr())) |
|
|
|
1 -> { |
|
|
|
1 -> { |
|
|
|
BitmapDrawable( |
|
|
|
val path = "bg" + File.separator + curBgStr() |
|
|
|
resources, |
|
|
|
val bitmap = BitmapUtils.decodeAssetsBitmap(appCtx, path, width, height) |
|
|
|
BitmapUtils.decodeAssetsBitmap( |
|
|
|
BitmapDrawable(resources, bitmap) |
|
|
|
appCtx, |
|
|
|
} |
|
|
|
"bg" + File.separator + curBgStr(), |
|
|
|
else -> { |
|
|
|
width, |
|
|
|
val bitmap = BitmapUtils.decodeBitmap(curBgStr(), width, height) |
|
|
|
height |
|
|
|
BitmapDrawable(resources, bitmap) |
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else -> BitmapDrawable( |
|
|
|
|
|
|
|
resources, |
|
|
|
|
|
|
|
BitmapUtils.decodeBitmap(curBgStr(), width, height) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e: OutOfMemoryError) { |
|
|
|
} catch (e: OutOfMemoryError) { |
|
|
|
e.printOnDebug() |
|
|
|
e.printOnDebug() |
|
|
|