mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
c9d2fdde10
commit
8a071a2ea2
@ -41,7 +41,7 @@ class BookSourceEditActivity :
|
||||
override val binding by viewBinding(ActivityBookSourceEditBinding::inflate)
|
||||
override val viewModel by viewModels<BookSourceEditViewModel>()
|
||||
|
||||
private val adapter = BookSourceEditAdapter()
|
||||
private val adapter by lazy { BookSourceEditAdapter() }
|
||||
private val sourceEntities: ArrayList<EditEntity> = ArrayList()
|
||||
private val searchEntities: ArrayList<EditEntity> = ArrayList()
|
||||
private val findEntities: ArrayList<EditEntity> = ArrayList()
|
||||
|
@ -2,8 +2,11 @@
|
||||
|
||||
package io.legado.app.ui.widget.code
|
||||
|
||||
import android.graphics.Color
|
||||
import android.content.Context
|
||||
import android.widget.ArrayAdapter
|
||||
import io.legado.app.R
|
||||
import io.legado.app.lib.theme.accentColor
|
||||
import io.legado.app.lib.theme.secondaryTextColor
|
||||
import splitties.init.appCtx
|
||||
import java.util.regex.Pattern
|
||||
|
||||
@ -21,6 +24,10 @@ fun CodeView.addJsonPattern() {
|
||||
}
|
||||
|
||||
fun CodeView.addJsPattern() {
|
||||
addSyntaxPattern(wrapPattern, Color.DKGRAY)
|
||||
addSyntaxPattern(wrapPattern, appCtx.secondaryTextColor)
|
||||
addSyntaxPattern(jsPattern, appCtx.accentColor)
|
||||
}
|
||||
|
||||
fun Context.arrayAdapter(keywords: Array<String>): ArrayAdapter<String> {
|
||||
return ArrayAdapter(this, R.layout.item_text, R.id.text_view, keywords)
|
||||
}
|
Loading…
Reference in New Issue
Block a user