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