feat: 优化

pull/209/head
kunfei 5 years ago
parent d796a70f78
commit 507fbdee70
  1. 11
      app/src/main/java/io/legado/app/constant/AppConst.kt
  2. 11
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt
  3. 12
      app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt

@ -56,4 +56,15 @@ object AppConst {
const val notificationIdAudio = 1144772
const val notificationIdWeb = 1144773
const val notificationIdDownload = 1144774
val urlOption: String by lazy {
"""
,{
"charset": "",
"method": "POST",
"body": "",
"headers": {"User-Agent": ""}
}
""".trimIndent()
}
}

@ -367,16 +367,7 @@ class BookSourceEditActivity :
override fun sendText(text: String) {
if (text == AppConst.keyboardToolChars[0]) {
insertText(
"""
,{
"charset": "",
"method": "POST",
"body": "",
"headers": {"User-Agent": ""}
}
""".trimIndent()
)
insertText(AppConst.urlOption)
} else {
insertText(text)
}

@ -200,17 +200,7 @@ class RssSourceEditActivity :
override fun sendText(text: String) {
if (text == AppConst.keyboardToolChars[0]) {
insertText(
"""
,{
"charset": "",
"method": "POST",
"body": "",
"headers": {"User-Agent": ""}
}
""".trimIndent()
)
insertText(AppConst.urlOption)
} else {
insertText(text)
}

Loading…
Cancel
Save