From 517db3627223742f8b023dfa4a953a67e1ccdb86 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 4 Oct 2021 19:16:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/widget/dialog/CodeDialog.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/dialog/CodeDialog.kt b/app/src/main/java/io/legado/app/ui/widget/dialog/CodeDialog.kt index de928426e..4e7297da9 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dialog/CodeDialog.kt +++ b/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.base.BaseDialogFragment import io.legado.app.databinding.DialogCodeViewBinding +import io.legado.app.lib.theme.accentColor import io.legado.app.utils.setLayout import io.legado.app.utils.viewbindingdelegate.viewBinding +import java.util.regex.Pattern class CodeDialog() : BaseDialogFragment() { @@ -34,8 +36,7 @@ class CodeDialog() : BaseDialogFragment() { } override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { - binding.codeView.keyListener = null - + binding.codeView.addSyntaxPattern(Pattern.compile("[\",:;[->]{}()]"), accentColor) arguments?.getString("code")?.let { binding.codeView.setText(it) }