|
|
@ -186,7 +186,7 @@ class ImportReplaceRuleDialog() : BaseDialogFragment(R.layout.dialog_recycler_vi |
|
|
|
requestId?.toInt()?.let { |
|
|
|
requestId?.toInt()?.let { |
|
|
|
GSON.fromJsonObject<ReplaceRule>(code)?.let { rule -> |
|
|
|
GSON.fromJsonObject<ReplaceRule>(code)?.let { rule -> |
|
|
|
viewModel.allRules[it] = rule |
|
|
|
viewModel.allRules[it] = rule |
|
|
|
adapter.notifyItemChanged(it) |
|
|
|
adapter.setItem(it, rule) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -198,6 +198,7 @@ class ImportReplaceRuleDialog() : BaseDialogFragment(R.layout.dialog_recycler_vi |
|
|
|
return ItemSourceImportBinding.inflate(inflater, parent, false) |
|
|
|
return ItemSourceImportBinding.inflate(inflater, parent, false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressLint("SetTextI18n") |
|
|
|
override fun convert( |
|
|
|
override fun convert( |
|
|
|
holder: ItemViewHolder, |
|
|
|
holder: ItemViewHolder, |
|
|
|
binding: ItemSourceImportBinding, |
|
|
|
binding: ItemSourceImportBinding, |
|
|
@ -206,7 +207,7 @@ class ImportReplaceRuleDialog() : BaseDialogFragment(R.layout.dialog_recycler_vi |
|
|
|
) { |
|
|
|
) { |
|
|
|
binding.run { |
|
|
|
binding.run { |
|
|
|
cbSourceName.isChecked = viewModel.selectStatus[holder.layoutPosition] |
|
|
|
cbSourceName.isChecked = viewModel.selectStatus[holder.layoutPosition] |
|
|
|
cbSourceName.text = item.name |
|
|
|
cbSourceName.text = "${item.name}(${item.group})" |
|
|
|
val localRule = viewModel.checkRules[holder.layoutPosition] |
|
|
|
val localRule = viewModel.checkRules[holder.layoutPosition] |
|
|
|
tvSourceState.text = when { |
|
|
|
tvSourceState.text = when { |
|
|
|
localRule == null -> "新增" |
|
|
|
localRule == null -> "新增" |
|
|
@ -237,6 +238,7 @@ class ImportReplaceRuleDialog() : BaseDialogFragment(R.layout.dialog_recycler_vi |
|
|
|
showDialogFragment( |
|
|
|
showDialogFragment( |
|
|
|
CodeDialog( |
|
|
|
CodeDialog( |
|
|
|
GSON.toJson(source), |
|
|
|
GSON.toJson(source), |
|
|
|
|
|
|
|
disableEdit = false, |
|
|
|
requestId = holder.layoutPosition.toString() |
|
|
|
requestId = holder.layoutPosition.toString() |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|