refs #5200 actionDialog
This commit is contained in:
parent
ff3a9c72e8
commit
fcb3f12f90
|
@ -1927,10 +1927,7 @@ class CollectionFragmentPickerNew(
|
|||
customDialogInput.setTitle(""+sale.itemFk)
|
||||
.setDescription(getString(R.string.scanWagonForItem))
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
findSale(customDialogInput.getValue(), index, sale)
|
||||
}
|
||||
closeCustomDialog(binding.scanInput, customDialogInput)
|
||||
findSaleAction(index, sale)
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
closeCustomDialog(binding.scanInput, customDialogInput)
|
||||
}.setValue("").show()
|
||||
|
@ -1938,10 +1935,7 @@ class CollectionFragmentPickerNew(
|
|||
|
||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
findSale(customDialogInput.getValue(), index, sale)
|
||||
}
|
||||
closeCustomDialog(binding.scanInput, customDialogInput)
|
||||
findSaleAction(index, sale)
|
||||
return@setOnEditorActionListener false
|
||||
}
|
||||
false
|
||||
|
@ -1949,6 +1943,13 @@ class CollectionFragmentPickerNew(
|
|||
customDialogInput.getEditText().requestFocus()
|
||||
}
|
||||
|
||||
private fun findSaleAction(index:Int, sale:Sale) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
findSale(customDialogInput.getValue(), index, sale)
|
||||
}
|
||||
closeCustomDialog(binding.scanInput, customDialogInput)
|
||||
}
|
||||
|
||||
private fun closeCustomDialog(scanInput: EditText, customDialogInput: CustomDialogInput) {
|
||||
requireContext().hideKeyboard(customDialogInput.getEditText())
|
||||
scanInput.requestFocus()
|
||||
|
|
Loading…
Reference in New Issue