|
|
@ -89,12 +89,10 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener |
|
|
|
@SuppressLint("InflateParams") |
|
|
|
@SuppressLint("InflateParams") |
|
|
|
private fun addGroup() { |
|
|
|
private fun addGroup() { |
|
|
|
alert(title = getString(R.string.add_group)) { |
|
|
|
alert(title = getString(R.string.add_group)) { |
|
|
|
val alertBinding = DialogEditTextBinding.inflate(layoutInflater) |
|
|
|
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply { |
|
|
|
customView { |
|
|
|
editView.setHint(R.string.group_name) |
|
|
|
alertBinding.apply { |
|
|
|
|
|
|
|
editView.setHint(R.string.group_name) |
|
|
|
|
|
|
|
}.root |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
customView { alertBinding.root } |
|
|
|
yesButton { |
|
|
|
yesButton { |
|
|
|
alertBinding.editView.text?.toString()?.let { |
|
|
|
alertBinding.editView.text?.toString()?.let { |
|
|
|
if (it.isNotBlank()) { |
|
|
|
if (it.isNotBlank()) { |
|
|
@ -109,13 +107,11 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener |
|
|
|
@SuppressLint("InflateParams") |
|
|
|
@SuppressLint("InflateParams") |
|
|
|
private fun editGroup(group: String) { |
|
|
|
private fun editGroup(group: String) { |
|
|
|
alert(title = getString(R.string.group_edit)) { |
|
|
|
alert(title = getString(R.string.group_edit)) { |
|
|
|
val alertBinding = DialogEditTextBinding.inflate(layoutInflater) |
|
|
|
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply { |
|
|
|
customView { |
|
|
|
editView.setHint(R.string.group_name) |
|
|
|
alertBinding.apply { |
|
|
|
editView.setText(group) |
|
|
|
editView.setHint(R.string.group_name) |
|
|
|
|
|
|
|
editView.setText(group) |
|
|
|
|
|
|
|
}.root |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
customView { alertBinding.root } |
|
|
|
yesButton { |
|
|
|
yesButton { |
|
|
|
viewModel.upGroup(group, alertBinding.editView.text?.toString()) |
|
|
|
viewModel.upGroup(group, alertBinding.editView.text?.toString()) |
|
|
|
} |
|
|
|
} |
|
|
|