|
|
@@ -425,6 +425,7 @@ object ReadBookConfig {
|
|
|
}
|
|
|
if (config.bgType == 2) {
|
|
|
val bgName = FileUtils.getName(config.bgStr)
|
|
|
+ config.bgStr = bgName
|
|
|
val bgPath = FileUtils.getPath(appCtx.externalFiles, "bg", bgName)
|
|
|
if (!FileUtils.exist(bgPath)) {
|
|
|
val bgFile = configDir.getFile(bgName)
|
|
|
@@ -436,6 +437,7 @@ object ReadBookConfig {
|
|
|
}
|
|
|
if (config.bgTypeNight == 2) {
|
|
|
val bgName = FileUtils.getName(config.bgStrNight)
|
|
|
+ config.bgStrNight = bgName
|
|
|
val bgPath = FileUtils.getPath(appCtx.externalFiles, "bg", bgName)
|
|
|
if (!FileUtils.exist(bgPath)) {
|
|
|
val bgFile = configDir.getFile(bgName)
|
|
|
@@ -447,6 +449,7 @@ object ReadBookConfig {
|
|
|
}
|
|
|
if (config.bgTypeEInk == 2) {
|
|
|
val bgName = FileUtils.getName(config.bgStrEInk)
|
|
|
+ config.bgStrEInk = bgName
|
|
|
val bgPath = FileUtils.getPath(appCtx.externalFiles, "bg", bgName)
|
|
|
if (!FileUtils.exist(bgPath)) {
|
|
|
val bgFile = configDir.getFile(bgName)
|
|
|
@@ -570,10 +573,12 @@ object ReadBookConfig {
|
|
|
bgTypeEInk = bgType
|
|
|
bgStrEInk = bg
|
|
|
}
|
|
|
+
|
|
|
AppConfig.isNightTheme -> {
|
|
|
bgTypeNight = bgType
|
|
|
bgStrNight = bg
|
|
|
}
|
|
|
+
|
|
|
else -> {
|
|
|
this.bgType = bgType
|
|
|
bgStr = bg
|
|
|
@@ -611,8 +616,13 @@ object ReadBookConfig {
|
|
|
val bitmap = BitmapUtils.decodeAssetsBitmap(appCtx, path, width, height)
|
|
|
BitmapDrawable(resources, bitmap?.resizeAndRecycle(width, height))
|
|
|
}
|
|
|
+
|
|
|
else -> {
|
|
|
- val bitmap = BitmapUtils.decodeBitmap(curBgStr(), width, height)
|
|
|
+ val path = curBgStr().let {
|
|
|
+ if (it.contains(File.separator)) it
|
|
|
+ else FileUtils.getPath(appCtx.externalFiles, "bg", curBgStr())
|
|
|
+ }
|
|
|
+ val bitmap = BitmapUtils.decodeBitmap(path, width, height)
|
|
|
BitmapDrawable(resources, bitmap?.resizeAndRecycle(width, height))
|
|
|
}
|
|
|
}
|