diff --git a/app/src/main/assets/readConfig.json b/app/src/main/assets/readConfig.json index 726668d1c..6ab073605 100644 --- a/app/src/main/assets/readConfig.json +++ b/app/src/main/assets/readConfig.json @@ -1,6 +1,6 @@ [ { - "bg": "#F3F3F3", + "bgStr": "#F3F3F3", "bgInt": 0, "bgType": 0, "darkStatusIcon": true, @@ -11,7 +11,7 @@ "lineSpacingMultiplier": 3 }, { - "bg": "#C6BAA1", + "bgStr": "#C6BAA1", "bgInt": 0, "bgType": 0, "darkStatusIcon": true, @@ -26,7 +26,7 @@ "paddingBottom": 0 }, { - "bg": "#E1F1DA", + "bgStr": "#E1F1DA", "bgInt": 0, "bgType": 0, "darkStatusIcon": true, @@ -41,7 +41,7 @@ "paddingBottom": 0 }, { - "bg": "#015A86", + "bgStr": "#015A86", "bgInt": 0, "bgType": 0, "darkStatusIcon": false, @@ -56,7 +56,7 @@ "paddingBottom": 0 }, { - "bg": "#808080", + "bgStr": "#808080", "bgInt": 0, "bgType": 0, "darkStatusIcon": false, diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index e94321e42..cb7805fbc 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -1,5 +1,7 @@ package io.legado.app.help +import android.graphics.Color +import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable import io.legado.app.App import io.legado.app.utils.GSON @@ -13,7 +15,7 @@ import java.io.IOException object ReadBookConfig { private val configList = arrayListOf() - var styleSelect + private var styleSelect get() = App.INSTANCE.getPrefInt("readStyleSelect") set(value) = App.INSTANCE.putPrefInt("readStyleSelect", value) var bg: Drawable? = null @@ -38,6 +40,7 @@ object ReadBookConfig { fun upBg() { getConfig().apply { when (bgType) { + 0 -> bg = ColorDrawable(Color.parseColor(bgStr)) } } @@ -66,7 +69,7 @@ object ReadBookConfig { } data class Config( - var bg: String = "#F3F3F3", + var bgStr: String = "#F3F3F3", var bgInt: Int = 0, var bgType: Int = 0, var darkStatusIcon: Boolean = true, diff --git a/app/src/main/java/io/legado/app/ui/readbook/config/ReadAloudPopup.kt b/app/src/main/java/io/legado/app/ui/readbook/config/ReadAloudPopup.kt new file mode 100644 index 000000000..3c2863478 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/readbook/config/ReadAloudPopup.kt @@ -0,0 +1,8 @@ +package io.legado.app.ui.readbook.config + +import android.content.Context +import android.widget.PopupWindow + +class ReadAloudPopup(context: Context?) : PopupWindow(context) { + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/readbook/config/ReadStylePopup.kt b/app/src/main/java/io/legado/app/ui/readbook/config/ReadStylePopup.kt new file mode 100644 index 000000000..b0a533d3a --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/readbook/config/ReadStylePopup.kt @@ -0,0 +1,12 @@ +package io.legado.app.ui.readbook.config + +import android.content.Context +import android.widget.PopupWindow + +class ReadStylePopup(context: Context?) : PopupWindow(context) { + + init { + + } + +} \ No newline at end of file