|
|
@ -74,7 +74,7 @@ class ImportBookSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickList |
|
|
|
dismiss() |
|
|
|
dismiss() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
binding.tvFooterLeft.setText(R.string.select_all) |
|
|
|
upSelectText() |
|
|
|
binding.tvFooterLeft.setOnClickListener { |
|
|
|
binding.tvFooterLeft.setOnClickListener { |
|
|
|
val selectAll = viewModel.isSelectAll() |
|
|
|
val selectAll = viewModel.isSelectAll() |
|
|
|
viewModel.selectStatus.forEachIndexed { index, b -> |
|
|
|
viewModel.selectStatus.forEachIndexed { index, b -> |
|
|
@ -83,6 +83,23 @@ class ImportBookSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickList |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
adapter.notifyDataSetChanged() |
|
|
|
adapter.notifyDataSetChanged() |
|
|
|
|
|
|
|
upSelectText() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun upSelectText() { |
|
|
|
|
|
|
|
if (viewModel.isSelectAll()) { |
|
|
|
|
|
|
|
binding.tvFooterLeft.text = getString( |
|
|
|
|
|
|
|
R.string.select_cancel_count, |
|
|
|
|
|
|
|
viewModel.selectCount(), |
|
|
|
|
|
|
|
viewModel.allSources.size |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
binding.tvFooterLeft.text = getString( |
|
|
|
|
|
|
|
R.string.select_all_count, |
|
|
|
|
|
|
|
viewModel.selectCount(), |
|
|
|
|
|
|
|
viewModel.allSources.size |
|
|
|
|
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -162,6 +179,7 @@ class ImportBookSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickList |
|
|
|
cbSourceName.setOnCheckedChangeListener { buttonView, isChecked -> |
|
|
|
cbSourceName.setOnCheckedChangeListener { buttonView, isChecked -> |
|
|
|
if (buttonView.isPressed) { |
|
|
|
if (buttonView.isPressed) { |
|
|
|
viewModel.selectStatus[holder.layoutPosition] = isChecked |
|
|
|
viewModel.selectStatus[holder.layoutPosition] = isChecked |
|
|
|
|
|
|
|
upSelectText() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|