pull/32/head
kunfei 5 years ago
parent 9a8cb5beb0
commit 7d9adece7c
  1. 10
      app/src/main/assets/readConfig.json
  2. 7
      app/src/main/java/io/legado/app/help/ReadBookConfig.kt
  3. 8
      app/src/main/java/io/legado/app/ui/readbook/config/ReadAloudPopup.kt
  4. 12
      app/src/main/java/io/legado/app/ui/readbook/config/ReadStylePopup.kt

@ -1,6 +1,6 @@
[ [
{ {
"bg": "#F3F3F3", "bgStr": "#F3F3F3",
"bgInt": 0, "bgInt": 0,
"bgType": 0, "bgType": 0,
"darkStatusIcon": true, "darkStatusIcon": true,
@ -11,7 +11,7 @@
"lineSpacingMultiplier": 3 "lineSpacingMultiplier": 3
}, },
{ {
"bg": "#C6BAA1", "bgStr": "#C6BAA1",
"bgInt": 0, "bgInt": 0,
"bgType": 0, "bgType": 0,
"darkStatusIcon": true, "darkStatusIcon": true,
@ -26,7 +26,7 @@
"paddingBottom": 0 "paddingBottom": 0
}, },
{ {
"bg": "#E1F1DA", "bgStr": "#E1F1DA",
"bgInt": 0, "bgInt": 0,
"bgType": 0, "bgType": 0,
"darkStatusIcon": true, "darkStatusIcon": true,
@ -41,7 +41,7 @@
"paddingBottom": 0 "paddingBottom": 0
}, },
{ {
"bg": "#015A86", "bgStr": "#015A86",
"bgInt": 0, "bgInt": 0,
"bgType": 0, "bgType": 0,
"darkStatusIcon": false, "darkStatusIcon": false,
@ -56,7 +56,7 @@
"paddingBottom": 0 "paddingBottom": 0
}, },
{ {
"bg": "#808080", "bgStr": "#808080",
"bgInt": 0, "bgInt": 0,
"bgType": 0, "bgType": 0,
"darkStatusIcon": false, "darkStatusIcon": false,

@ -1,5 +1,7 @@
package io.legado.app.help package io.legado.app.help
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import io.legado.app.App import io.legado.app.App
import io.legado.app.utils.GSON import io.legado.app.utils.GSON
@ -13,7 +15,7 @@ import java.io.IOException
object ReadBookConfig { object ReadBookConfig {
private val configList = arrayListOf<Config>() private val configList = arrayListOf<Config>()
var styleSelect private var styleSelect
get() = App.INSTANCE.getPrefInt("readStyleSelect") get() = App.INSTANCE.getPrefInt("readStyleSelect")
set(value) = App.INSTANCE.putPrefInt("readStyleSelect", value) set(value) = App.INSTANCE.putPrefInt("readStyleSelect", value)
var bg: Drawable? = null var bg: Drawable? = null
@ -38,6 +40,7 @@ object ReadBookConfig {
fun upBg() { fun upBg() {
getConfig().apply { getConfig().apply {
when (bgType) { when (bgType) {
0 -> bg = ColorDrawable(Color.parseColor(bgStr))
} }
} }
@ -66,7 +69,7 @@ object ReadBookConfig {
} }
data class Config( data class Config(
var bg: String = "#F3F3F3", var bgStr: String = "#F3F3F3",
var bgInt: Int = 0, var bgInt: Int = 0,
var bgType: Int = 0, var bgType: Int = 0,
var darkStatusIcon: Boolean = true, var darkStatusIcon: Boolean = true,

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

@ -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 {
}
}
Loading…
Cancel
Save