pull/1172/head 3.21.072522
gedoor 3 years ago
parent dd65c85278
commit 4f0c48ec0f
  1. 2
      app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt
  2. 3
      app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt
  3. 3
      app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt

@ -102,7 +102,6 @@ class ImportBookSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickList
dismissAllowingStateLoss() dismissAllowingStateLoss()
} }
} }
upSelectText()
binding.tvFooterLeft.visible() binding.tvFooterLeft.visible()
binding.tvFooterLeft.setOnClickListener { binding.tvFooterLeft.setOnClickListener {
val selectAll = viewModel.isSelectAll() val selectAll = viewModel.isSelectAll()
@ -125,6 +124,7 @@ class ImportBookSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickList
binding.rotateLoading.hide() binding.rotateLoading.hide()
if (it > 0) { if (it > 0) {
adapter.setItems(viewModel.allSources) adapter.setItems(viewModel.allSources)
upSelectText()
} else { } else {
binding.tvMsg.apply { binding.tvMsg.apply {
setText(R.string.wrong_format) setText(R.string.wrong_format)

@ -70,7 +70,6 @@ class ImportReplaceRuleDialog : BaseDialogFragment() {
adapter = SourcesAdapter(requireContext()) adapter = SourcesAdapter(requireContext())
binding.recyclerView.layoutManager = LinearLayoutManager(requireContext()) binding.recyclerView.layoutManager = LinearLayoutManager(requireContext())
binding.recyclerView.adapter = adapter binding.recyclerView.adapter = adapter
adapter.setItems(viewModel.allRules)
binding.tvCancel.visible() binding.tvCancel.visible()
binding.tvCancel.setOnClickListener { binding.tvCancel.setOnClickListener {
dismissAllowingStateLoss() dismissAllowingStateLoss()
@ -84,7 +83,6 @@ class ImportReplaceRuleDialog : BaseDialogFragment() {
dismissAllowingStateLoss() dismissAllowingStateLoss()
} }
} }
upSelectText()
binding.tvFooterLeft.visible() binding.tvFooterLeft.visible()
binding.tvFooterLeft.setOnClickListener { binding.tvFooterLeft.setOnClickListener {
val selectAll = viewModel.isSelectAll() val selectAll = viewModel.isSelectAll()
@ -107,6 +105,7 @@ class ImportReplaceRuleDialog : BaseDialogFragment() {
binding.rotateLoading.hide() binding.rotateLoading.hide()
if (it > 0) { if (it > 0) {
adapter.setItems(viewModel.allRules) adapter.setItems(viewModel.allRules)
upSelectText()
} else { } else {
binding.tvMsg.apply { binding.tvMsg.apply {
setText(R.string.wrong_format) setText(R.string.wrong_format)

@ -86,7 +86,6 @@ class ImportRssSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListe
adapter = SourcesAdapter(requireContext()) adapter = SourcesAdapter(requireContext())
binding.recyclerView.layoutManager = LinearLayoutManager(requireContext()) binding.recyclerView.layoutManager = LinearLayoutManager(requireContext())
binding.recyclerView.adapter = adapter binding.recyclerView.adapter = adapter
adapter.setItems(viewModel.allSources)
binding.tvCancel.visible() binding.tvCancel.visible()
binding.tvCancel.setOnClickListener { binding.tvCancel.setOnClickListener {
dismissAllowingStateLoss() dismissAllowingStateLoss()
@ -100,7 +99,6 @@ class ImportRssSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListe
dismissAllowingStateLoss() dismissAllowingStateLoss()
} }
} }
upSelectText()
binding.tvFooterLeft.visible() binding.tvFooterLeft.visible()
binding.tvFooterLeft.setOnClickListener { binding.tvFooterLeft.setOnClickListener {
val selectAll = viewModel.isSelectAll() val selectAll = viewModel.isSelectAll()
@ -123,6 +121,7 @@ class ImportRssSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListe
binding.rotateLoading.hide() binding.rotateLoading.hide()
if (it > 0) { if (it > 0) {
adapter.setItems(viewModel.allSources) adapter.setItems(viewModel.allSources)
upSelectText()
} else { } else {
binding.tvMsg.apply { binding.tvMsg.apply {
setText(R.string.wrong_format) setText(R.string.wrong_format)

Loading…
Cancel
Save