refs #6413 feat:refactor ubicador

This commit is contained in:
Sergio De la torre 2024-02-27 09:39:01 +01:00
parent f8a17deded
commit 9bf43e6dd0
3 changed files with 31 additions and 11 deletions

View File

@ -16,7 +16,6 @@ import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.She
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoViewModel
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
import es.verdnatura.presentation.view.feature.login.fragment.LoginViewModel
import es.verdnatura.presentation.view.feature.modelViewModel.FragmentsViewModel
import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
import es.verdnatura.presentation.view.feature.packingHolland.fragment.PackingHollandViewModel
import es.verdnatura.presentation.view.feature.paletizador.fragment.CmrExpeditionPalletViewModel
@ -199,7 +198,4 @@ val viewModelModule = module {
viewModel {
TicketViewModel(androidContext())
}
viewModel {
FragmentsViewModel(androidContext())
}
}

View File

@ -43,12 +43,7 @@ class UbicadorAdapterNew(
binding.apply {
this.item = item
multiText.text = "${item.stickers}x${item.packing}"
if (!item.url.isNullOrBlank()) {
imgItem.loadUrl(item.url+"/catalog/200x200/"+item.item)
} else {
imgItem.loadUrl("https://cdn.verdnatura.es/image/catalog/200x200/" + item.item)
}
imgItem.loadUrl("http:" + item.url + "/catalog/200x200/" + item.item)
imgItem.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO(

View File

@ -639,6 +639,35 @@ class UbicadorFragmentNew(
}.show()
}
customDialogUbicador.getEditItem()
.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
if (!customDialogUbicador.getItemValue().isNullOrEmpty()) {
try {
customDialogUbicador.setItemValue(
itemScanValue(
customDialogUbicador.getItemValue(),
"buy",
"more"
).toString()
)
} catch (ex: Exception) {
ma.messageWithSound(ex.message.toString(), true, true)
customDialogUbicador.setItemValue("")
}
}
return@setOnEditorActionListener true
}
customDialogUbicador.getPackingItem().requestFocus()
}
setWatcher()
customDialogUbicador.getEditItem().requestFocus()
ma.hideKeyboard(customDialogUbicador.getEditItem())
@ -649,7 +678,7 @@ class UbicadorFragmentNew(
if (customDialogUbicador.getItemValue()
.isNullOrEmpty() || customDialogUbicador.getPackingValue().isNullOrBlank()
) {
"Los campos item y packing son obligatorios".toast(context)
getString(R.string.itemAndPackingMandatory).toast(context)
} else {
saveItemCall(customDialogUbicador, itemUbicador)
customDialogUbicador.dismiss()