pull/1705/head
kunfei 3 years ago
parent ae9c849e50
commit 08e777b6df
  1. 162
      app/src/main/assets/defaultData/keyboardAssists.json
  2. 9
      app/src/main/java/io/legado/app/help/DefaultData.kt

@ -0,0 +1,162 @@
[
{
"key": "@css:",
"value": "@css:",
"serialNo": 0
},
{
"key": "<js>",
"value": "<js></js>",
"serialNo": 1
},
{
"key": "{{}}",
"value": "{{}}",
"serialNo": 2
},
{
"key": "##",
"value": "##",
"serialNo": 3
},
{
"key": "&&",
"value": "&&",
"serialNo": 4
},
{
"key": "%%",
"value": "%%",
"serialNo": 5
},
{
"key": "||",
"value": "||",
"serialNo": 6
},
{
"key": "//",
"value": "//",
"serialNo": 7
},
{
"key": "\\",
"value": "\\",
"serialNo": 8
},
{
"key": "$.",
"value": "$.",
"serialNo": 9
},
{
"key": "@",
"value": "@",
"serialNo": 10
},
{
"key": ":",
"value": ":",
"serialNo": 11
},
{
"key": "class",
"value": "class",
"serialNo": 12
},
{
"key": "text",
"value": "text",
"serialNo": 13
},
{
"key": "href",
"value": "href",
"serialNo": 14
},
{
"key": "textNodes",
"value": "textNodes",
"serialNo": 15
},
{
"key": "ownText",
"value": "ownText",
"serialNo": 16
},
{
"key": "all",
"value": "all",
"serialNo": 17
},
{
"key": "html",
"value": "html",
"serialNo": 18
},
{
"key": "[",
"value": "[",
"serialNo": 19
},
{
"key": "]",
"value": "]",
"serialNo": 20
},
{
"key": "<",
"value": "<",
"serialNo": 21
},
{
"key": ">",
"value": ">",
"serialNo": 22
},
{
"key": "#",
"value": "#",
"serialNo": 23
},
{
"key": "!",
"value": "!",
"serialNo": 24
},
{
"key": ".",
"value": ".",
"serialNo": 25
},
{
"key": "+",
"value": "+",
"serialNo": 26
},
{
"key": "-",
"value": "-",
"serialNo": 27
},
{
"key": "*",
"value": "*",
"serialNo": 28
},
{
"key": "/",
"value": "/",
"serialNo": 29
},
{
"key": "=",
"value": "=",
"serialNo": 30
},
{
"key": "webView",
"value": "{'webView': true}",
"serialNo": 31
}
]

@ -2,6 +2,7 @@ package io.legado.app.help
import io.legado.app.data.appDb import io.legado.app.data.appDb
import io.legado.app.data.entities.HttpTTS import io.legado.app.data.entities.HttpTTS
import io.legado.app.data.entities.KeyboardAssist
import io.legado.app.data.entities.RssSource import io.legado.app.data.entities.RssSource
import io.legado.app.data.entities.TxtTocRule import io.legado.app.data.entities.TxtTocRule
import io.legado.app.help.config.ReadBookConfig import io.legado.app.help.config.ReadBookConfig
@ -70,6 +71,14 @@ object DefaultData {
GSON.fromJsonObject<BookCover.CoverRuleConfig>(json).getOrThrow()!! GSON.fromJsonObject<BookCover.CoverRuleConfig>(json).getOrThrow()!!
} }
val keyboardAssists: List<KeyboardAssist> by lazy {
val json = String(
appCtx.assets.open("defaultData${File.separator}keyboardAssists.json")
.readBytes()
)
GSON.fromJsonArray<KeyboardAssist>(json).getOrNull()!!
}
fun importDefaultHttpTTS() { fun importDefaultHttpTTS() {
appDb.httpTTSDao.deleteDefault() appDb.httpTTSDao.deleteDefault()
appDb.httpTTSDao.insert(*httpTTS.toTypedArray()) appDb.httpTTSDao.insert(*httpTTS.toTypedArray())

Loading…
Cancel
Save