From 762d63d4b74e738115ec75b786f762631877fe90 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 7 Jul 2021 10:25:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/ui/dict/DictDialog.kt | 4 ++++ app/src/main/res/layout/dialog_dict.xml | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/dict/DictDialog.kt b/app/src/main/java/io/legado/app/ui/dict/DictDialog.kt index 573e708ae..fc140d0c9 100644 --- a/app/src/main/java/io/legado/app/ui/dict/DictDialog.kt +++ b/app/src/main/java/io/legado/app/ui/dict/DictDialog.kt @@ -2,6 +2,7 @@ package io.legado.app.ui.dict import android.os.Bundle import android.text.Html +import android.text.method.LinkMovementMethod import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -10,6 +11,7 @@ import androidx.fragment.app.viewModels import io.legado.app.R import io.legado.app.base.BaseDialogFragment import io.legado.app.databinding.DialogDictBinding +import io.legado.app.utils.invisible import io.legado.app.utils.toastOnUi import io.legado.app.utils.viewbindingdelegate.viewBinding @@ -48,6 +50,7 @@ class DictDialog : BaseDialogFragment() { } override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { + binding.tvDict.movementMethod = LinkMovementMethod() val word = arguments?.getString("word") if (word.isNullOrEmpty()) { toastOnUi(R.string.cannot_empty) @@ -55,6 +58,7 @@ class DictDialog : BaseDialogFragment() { return } viewModel.dictHtmlData.observe(viewLifecycleOwner) { + binding.rotateLoading.invisible() binding.tvDict.text = Html.fromHtml(it) } viewModel.dict(word) diff --git a/app/src/main/res/layout/dialog_dict.xml b/app/src/main/res/layout/dialog_dict.xml index acd6a42f3..7eed5f326 100644 --- a/app/src/main/res/layout/dialog_dict.xml +++ b/app/src/main/res/layout/dialog_dict.xml @@ -1,5 +1,5 @@ - @@ -9,4 +9,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> - \ No newline at end of file + + + \ No newline at end of file