pull/1395/head
gedoor 3 years ago
parent dca2432615
commit 517db36272
  1. 5
      app/src/main/java/io/legado/app/ui/widget/dialog/CodeDialog.kt

@ -7,8 +7,10 @@ import android.view.ViewGroup
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.BaseDialogFragment import io.legado.app.base.BaseDialogFragment
import io.legado.app.databinding.DialogCodeViewBinding import io.legado.app.databinding.DialogCodeViewBinding
import io.legado.app.lib.theme.accentColor
import io.legado.app.utils.setLayout import io.legado.app.utils.setLayout
import io.legado.app.utils.viewbindingdelegate.viewBinding import io.legado.app.utils.viewbindingdelegate.viewBinding
import java.util.regex.Pattern
class CodeDialog() : BaseDialogFragment() { class CodeDialog() : BaseDialogFragment() {
@ -34,8 +36,7 @@ class CodeDialog() : BaseDialogFragment() {
} }
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
binding.codeView.keyListener = null binding.codeView.addSyntaxPattern(Pattern.compile("[\",:;[->]{}()]"), accentColor)
arguments?.getString("code")?.let { arguments?.getString("code")?.let {
binding.codeView.setText(it) binding.codeView.setText(it)
} }

Loading…
Cancel
Save