# Conflicts: # app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt # app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.ktpull/1114/head
commit
f6fe4f3099
@ -0,0 +1,32 @@ |
||||
package io.legado.app.ui.dict |
||||
|
||||
import android.os.Bundle |
||||
import android.view.View |
||||
import androidx.fragment.app.FragmentManager |
||||
import androidx.fragment.app.viewModels |
||||
import io.legado.app.base.BaseDialogFragment |
||||
|
||||
class DictDialog : BaseDialogFragment() { |
||||
|
||||
companion object { |
||||
|
||||
fun dict(manager: FragmentManager, word: String) { |
||||
DictDialog().apply { |
||||
val bundle = Bundle() |
||||
bundle.putString("word", word) |
||||
arguments = bundle |
||||
}.show(manager, word) |
||||
} |
||||
|
||||
} |
||||
|
||||
private val viewModel by viewModels<DictViewModel>() |
||||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { |
||||
viewModel.word = arguments?.getString("word") ?: "" |
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,11 @@ |
||||
package io.legado.app.ui.dict |
||||
|
||||
import android.app.Application |
||||
import androidx.lifecycle.AndroidViewModel |
||||
|
||||
class DictViewModel(application: Application) : AndroidViewModel(application) { |
||||
|
||||
var word: String? = null |
||||
|
||||
|
||||
} |
Loading…
Reference in new issue