|
|
@ -7,31 +7,25 @@ import android.text.method.LinkMovementMethod |
|
|
|
import android.view.LayoutInflater |
|
|
|
import android.view.LayoutInflater |
|
|
|
import android.view.View |
|
|
|
import android.view.View |
|
|
|
import android.view.ViewGroup |
|
|
|
import android.view.ViewGroup |
|
|
|
import androidx.fragment.app.FragmentManager |
|
|
|
|
|
|
|
import androidx.fragment.app.viewModels |
|
|
|
import androidx.fragment.app.viewModels |
|
|
|
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.DialogDictBinding |
|
|
|
import io.legado.app.databinding.DialogDictBinding |
|
|
|
import io.legado.app.utils.invisible |
|
|
|
import io.legado.app.utils.invisible |
|
|
|
import io.legado.app.utils.showDialog |
|
|
|
|
|
|
|
import io.legado.app.utils.toastOnUi |
|
|
|
import io.legado.app.utils.toastOnUi |
|
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding |
|
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 词典 |
|
|
|
* 词典 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
class DictDialog : BaseDialogFragment() { |
|
|
|
class DictDialog() : BaseDialogFragment() { |
|
|
|
|
|
|
|
|
|
|
|
companion object { |
|
|
|
constructor(word: String) : this() { |
|
|
|
|
|
|
|
arguments = Bundle().apply { |
|
|
|
fun show(manager: FragmentManager, word: String) { |
|
|
|
|
|
|
|
manager.showDialog<DictDialog> { |
|
|
|
|
|
|
|
putString("word", word) |
|
|
|
putString("word", word) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private val viewModel by viewModels<DictViewModel>() |
|
|
|
private val viewModel by viewModels<DictViewModel>() |
|
|
|
private val binding by viewBinding(DialogDictBinding::bind) |
|
|
|
private val binding by viewBinding(DialogDictBinding::bind) |
|
|
|
|
|
|
|
|
|
|
|