Refactor synthetic y añadir histórico shelving. App en test instalada

This commit is contained in:
Sergio De la torre 2021-11-29 11:31:41 +01:00
parent 155a2102cf
commit 26c9046903
12 changed files with 181 additions and 186 deletions

View File

@ -69,6 +69,7 @@
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_black.xml" value="0.1" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_black.xml" value="0.1" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_selected.xml" value="0.1" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_selected.xml" value="0.1" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/qrcode_scan.xml" value="0.17395833333333333" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/qrcode_scan.xml" value="0.17395833333333333" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/revision_icon.xml" value="0.1" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/round_av_timer_24.xml" value="0.15052083333333333" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/round_av_timer_24.xml" value="0.15052083333333333" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/round_outline.xml" value="0.11979166666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/round_outline.xml" value="0.11979166666666667" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/walk.xml" value="0.10885416666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/walk.xml" value="0.10885416666666667" />

View File

@ -37,9 +37,9 @@ import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
import es.verdnatura.presentation.view.feature.main.activity.MainActivity import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.sacador.model.* import es.verdnatura.presentation.view.feature.sacador.model.*
import kotlinx.android.synthetic.main.activity_main.* /*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_collection.* import kotlinx.android.synthetic.main.fragment_collection.*
import kotlinx.android.synthetic.main.toolbar.* import kotlinx.android.synthetic.main.toolbar.**/
import timber.log.Timber import timber.log.Timber
class CollectionFragment( class CollectionFragment(
@ -140,8 +140,9 @@ class CollectionFragment(
customDialogInput = CustomDialogInput(requireContext()) customDialogInput = CustomDialogInput(requireContext())
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
customDialogThreeButtons = CustomDialogThreeButtons(requireContext()) customDialogThreeButtons = CustomDialogThreeButtons(requireContext())
requireActivity().main_bottom_navigation.visibility = View.GONE //requireActivity().main_bottom_navigation.visibility = View.GONE
if (splash_progress != null) splash_progress.visibility = View.VISIBLE (activity as MainActivity).hideBottomNavigation(View.GONE)
if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
@ -151,8 +152,8 @@ class CollectionFragment(
if (type != PRECHECKER) { if (type != PRECHECKER) {
setToolBar() setToolBar()
} else { } else {
toolbar_subtitle.visibility = View.VISIBLE binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
scan_input.visibility = View.GONE binding.scanInput.visibility = View.GONE
} }
@ -174,7 +175,7 @@ class CollectionFragment(
} }
private fun setToolBar() { private fun setToolBar() {
toolbar_subtitle.visibility = View.VISIBLE binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
val listIcons: ArrayList<Drawable> = ArrayList() val listIcons: ArrayList<Drawable> = ArrayList()
val iconPrint: Drawable = val iconPrint: Drawable =
@ -193,7 +194,7 @@ class CollectionFragment(
listIcons.add(iconAdd) listIcons.add(iconAdd)
toolbar_icons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
if (item == iconPrint) { if (item == iconPrint) {
print() print()
@ -206,13 +207,13 @@ class CollectionFragment(
} }
} }
}) })
toolbar_icons.layoutManager = binding.mainToolbar.toolbarIcons.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
private fun scanRequest() { private fun scanRequest() {
if (scan_input != null) { if (binding.scanInput != null) {
scan_input.requestFocus() binding.scanInput.requestFocus()
} }
hideKeyboards() hideKeyboards()
} }
@ -230,24 +231,24 @@ class CollectionFragment(
private fun setEvents() { private fun setEvents() {
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
//ESCANER ========= //ESCANER =========
hideKeyboards() hideKeyboards()
/* if (type.equals(CONTROLADOR)){ /* if (type.equals(CONTROLADOR)){
scan_input.inputType= InputType.TYPE_CLASS_NUMBER binding.scanInput.inputType= InputType.TYPE_CLASS_NUMBER
}*/ }*/
scan_input.requestFocus() binding.scanInput.requestFocus()
scan_input.setOnEditorActionListener { v, actionId, event -> binding.scanInput.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED) if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED)
if (!scan_input.text.toString().isNullOrEmpty()) { if (!binding.scanInput.text.toString().isNullOrEmpty()) {
//////Log.i("VERDNATURA:","Pita o no pita si encuentra. Diferencia si es matricula o no") //////Log.i("VERDNATURA:","Pita o no pita si encuentra. Diferencia si es matricula o no")
findSale(scan_input.text.toString()) findSale(binding.scanInput.text.toString())
} }
scan_input.setText("") binding.scanInput.setText("")
hideKeyboards() hideKeyboards()
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
@ -257,11 +258,12 @@ class CollectionFragment(
hideKeyboards() hideKeyboards()
//LISTA ========= //LISTA =========
collection_swipe.setOnRefreshListener { binding.collectionSwipe.setOnRefreshListener {
collection_swipe.isRefreshing = false binding.collectionSwipe.isRefreshing = false
if (type != PRECHECKER) { if (type != PRECHECKER) {
if (splash_progress != null) splash_progress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
user, user,
password, password,
@ -269,7 +271,7 @@ class CollectionFragment(
sectorFk, sectorFk,
type type
,"collection_getTickets") ,"collection_getTickets")
collection_swipe.isRefreshing = false binding.collectionSwipe.isRefreshing = false
} }
} }
} }
@ -285,7 +287,7 @@ class CollectionFragment(
with(viewModel) { with(viewModel) {
collectionTicketList.observe(viewLifecycleOwner, Observer { collectionTicketList.observe(viewLifecycleOwner, Observer {
if (splash_progress != null) splash_progress.visibility = View.GONE if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
if (!it.isError) { if (!it.isError) {
if (it.tickets.isNotEmpty()) { if (it.tickets.isNotEmpty()) {
collection = it collection = it
@ -297,7 +299,7 @@ class CollectionFragment(
"El primer workerfk es :${it.tickets.get(0).sales.get(0).workerFk}" "El primer workerfk es :${it.tickets.get(0).sales.get(0).workerFk}"
)*/ )*/
} else { } else {
toolbar_subtitle.text = "0/0" binding.mainToolbar.toolbarSubtitle.text = "0/0"
} }
} else { } else {
customDialog.setTitle("Error").setDescription(it.errorMessage) customDialog.setTitle("Error").setDescription(it.errorMessage)
@ -310,19 +312,19 @@ class CollectionFragment(
}) })
placementSuppleyList.observe(viewLifecycleOwner, Observer { placementSuppleyList.observe(viewLifecycleOwner, Observer {
if (splash_progress != null) splash_progress.visibility = View.GONE if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
if (!goBack) printShelvingResult(it) if (!goBack) printShelvingResult(it)
goBack = false goBack = false
}) })
item.observe(viewLifecycleOwner, Observer { item.observe(viewLifecycleOwner, Observer {
if (splash_progress != null) splash_progress.visibility = View.GONE if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
if (!goBack) toastDisponibility(it) if (!goBack) toastDisponibility(it)
goBack = false goBack = false
}) })
responseNew.observe(viewLifecycleOwner, Observer { responseNew.observe(viewLifecycleOwner, Observer {
if (splash_progress != null) splash_progress.visibility = View.GONE if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
// if (!goBack) { // if (!goBack) {
if (it.isError) { if (it.isError) {
customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage) customDialog.setTitle("Disponibilidad").setDescription(it.errorMessage)
@ -332,7 +334,7 @@ class CollectionFragment(
}.show() }.show()
} else { } else {
if (splash_progress != null) splash_progress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
sendSalixMessage( sendSalixMessage(
item=dataMessageSalix.item, item=dataMessageSalix.item,
@ -357,7 +359,7 @@ class CollectionFragment(
}) })
responseCode.observe(viewLifecycleOwner, Observer { responseCode.observe(viewLifecycleOwner, Observer {
if (splash_progress != null) splash_progress.visibility = View.GONE if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
if (!goBack2) { if (!goBack2) {
if (it.isError) { if (it.isError) {
customDialog.setTitle("Error").setDescription(it.errorMessage) customDialog.setTitle("Error").setDescription(it.errorMessage)
@ -385,18 +387,18 @@ class CollectionFragment(
}) })
responseIncQuantity.observe(viewLifecycleOwner, Observer { responseIncQuantity.observe(viewLifecycleOwner, Observer {
/* splash_progress.visibility = View.VISIBLE /* binding.splashProgress.visibility = View.VISIBLE
viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)*/ viewModel.collectionTicketGet(user,password,collection.collectionFk,sectorFk)*/
}) })
mistakeList.observe(viewLifecycleOwner, Observer { mistakeList.observe(viewLifecycleOwner, Observer {
if (splash_progress != null) splash_progress.visibility = View.GONE if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
if (!goBack) showMistakeList(it.list) if (!goBack) showMistakeList(it.list)
goBack = false goBack = false
}) })
//sergio: para si hay algun ticket por revisar //sergio: para si hay algun ticket por revisar
responsecheckfully.observe(viewLifecycleOwner, Observer { responsecheckfully.observe(viewLifecycleOwner, Observer {
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError) { if (it.isError) {
customDialog.setTitle("Error").setDescription(it.errorMessage) customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Aceptar") { .setOkButton("Aceptar") {
@ -411,7 +413,7 @@ class CollectionFragment(
} }
.setKoButton("Revisar"){ .setKoButton("Revisar"){
splash_progress.visibility=View.VISIBLE binding.splashProgress.visibility=View.VISIBLE
viewModel.collectionTicketGet(user, password, it.response, sectorFk, type,"collection_getTickets") viewModel.collectionTicketGet(user, password, it.response, sectorFk, type,"collection_getTickets")
customDialog.dismiss() customDialog.dismiss()
} }
@ -478,10 +480,10 @@ class CollectionFragment(
speak("Colección cargada, diga listo para empezar.") speak("Colección cargada, diga listo para empezar.")
} }
toolbar_title.text = collection.collectionFk binding.mainToolbar.toolbarTitle.text = collection.collectionFk
if (splash_progress != null) splash_progress.visibility = View.GONE if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
var salesList: ArrayList<SaleVO> = ArrayList() var salesList: ArrayList<SaleVO> = ArrayList()
tickets = ArrayList() tickets = ArrayList()
var observations = "" var observations = ""
@ -571,7 +573,7 @@ class CollectionFragment(
}, object : OnMistakeClickListener { }, object : OnMistakeClickListener {
override fun onMistakeClickListener(sale: SaleVO) { override fun onMistakeClickListener(sale: SaleVO) {
if (type != "PRECHECKER") { if (type != "PRECHECKER") {
if (splash_progress != null) splash_progress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
mistakeSale = sale mistakeSale = sale
viewModel.mistakeType(usuario = user, password = password) viewModel.mistakeType(usuario = user, password = password)
} }
@ -579,8 +581,8 @@ class CollectionFragment(
}) })
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
fragment_sacador_collections.adapter = saleAdapter binding.fragmentSacadorCollections.adapter = saleAdapter
fragment_sacador_collections.layoutManager = lm binding.fragmentSacadorCollections.layoutManager = lm
setTotalLines() setTotalLines()
if (storedPosition != 0) if (storedPosition != 0)
@ -596,7 +598,7 @@ class CollectionFragment(
} }
private fun setScrollListener(lm: LinearLayoutManager) { private fun setScrollListener(lm: LinearLayoutManager) {
fragment_sacador_collections.addOnScrollListener(object : RecyclerView.OnScrollListener() { binding.fragmentSacadorCollections.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
storedBackPosition = lm.findFirstVisibleItemPosition() storedBackPosition = lm.findFirstVisibleItemPosition()
super.onScrolled(recyclerView, dx, dy) super.onScrolled(recyclerView, dx, dy)
@ -733,7 +735,7 @@ class CollectionFragment(
if (mpok != null) mpok!!.start() if (mpok != null) mpok!!.start()
getString(R.string.Ticketaparcado).toast(requireContext()) getString(R.string.Ticketaparcado).toast(requireContext())
} else { } else {
if (splash_progress != null) splash_progress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
storedPosition = 0 storedPosition = 0
storedBackPosition = 0 storedBackPosition = 0
if (type != PRECHECKER) { if (type != PRECHECKER) {
@ -744,7 +746,7 @@ class CollectionFragment(
viewModel.ticketOrCollection_checkFullyControlled(user, password, txtscan,"ticketOrCollection_checkFullyControlled") viewModel.ticketOrCollection_checkFullyControlled(user, password, txtscan,"ticketOrCollection_checkFullyControlled")
} }
} else { } else {
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
} }
////Log.i("VERDNATURA:","La collection es ${txtscan}") ////Log.i("VERDNATURA:","La collection es ${txtscan}")
} }
@ -852,15 +854,15 @@ class CollectionFragment(
private fun setListPosition(position: Int, isFromBack: Boolean) { private fun setListPosition(position: Int, isFromBack: Boolean) {
storedPosition = position storedPosition = position
if (type == SACADOR) { if (type == SACADOR) {
if (fragment_sacador_collections != null) { if (binding.fragmentSacadorCollections != null) {
fragment_sacador_collections.addViewObserver { binding.fragmentSacadorCollections.addViewObserver {
lm!!.scrollToPositionWithOffset(position, 0) lm!!.scrollToPositionWithOffset(position, 0)
} }
} }
} else if (isFromBack) { } else if (isFromBack) {
if (fragment_sacador_collections != null) { if (binding.fragmentSacadorCollections != null) {
fragment_sacador_collections.addViewObserver { binding.fragmentSacadorCollections.addViewObserver {
lm!!.scrollToPositionWithOffset(position, 0) lm!!.scrollToPositionWithOffset(position, 0)
} }
} }
@ -917,7 +919,7 @@ class CollectionFragment(
private fun showShelving(position: Int, shelvingPosition: Int) { private fun showShelving(position: Int, shelvingPosition: Int) {
storedShelvingPosition = shelvingPosition storedShelvingPosition = shelvingPosition
storedPosition = position storedPosition = position
if (splash_progress != null) splash_progress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
var quantityGet = "0" var quantityGet = "0"
try { try {
quantityGet = quantityGet =
@ -983,7 +985,7 @@ class CollectionFragment(
customDialogList.dismiss() customDialogList.dismiss()
} else { } else {
itemShelvingFkStored = itemShelvingFk itemShelvingFkStored = itemShelvingFk
if (splash_progress != null) splash_progress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
viewModel.getIdFromCode( viewModel.getIdFromCode(
usuario = user, usuario = user,
password = password, password = password,
@ -1051,7 +1053,7 @@ class CollectionFragment(
customDialogList.dismiss() customDialogList.dismiss()
} else { } else {
itemShelvingFkStored = itemShelvingFk itemShelvingFkStored = itemShelvingFk
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.getIdFromCode( viewModel.getIdFromCode(
usuario = user, usuario = user,
password = password, password = password,
@ -1145,7 +1147,7 @@ class CollectionFragment(
d("VERDNATURA","Ordenamos") d("VERDNATURA","Ordenamos")
fragment_sacador_collections.adapter?.notifyDataSetChanged() binding.fragmentSacadorCollections.adapter?.notifyDataSetChanged()
}*/ }*/
@ -1252,7 +1254,7 @@ class CollectionFragment(
) { ) {
getString(R.string.Todosloscampossonobligatorios).toast(requireContext()) getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
} else { } else {
if (splash_progress != null) splash_progress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
//sergio datos para mensaje salix //sergio datos para mensaje salix
@ -1308,7 +1310,7 @@ class CollectionFragment(
) { ) {
getString(R.string.Todosloscampossonobligatorios).toast(requireContext()) getString(R.string.Todosloscampossonobligatorios).toast(requireContext())
} else { } else {
if (splash_progress != null) splash_progress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
dataMessageSalix= DataMessageSalix( dataMessageSalix= DataMessageSalix(
ticket=ticketSelected, ticket=ticketSelected,
@ -1360,8 +1362,8 @@ class CollectionFragment(
.setDescription(getString(R.string.Escaneaetiqueta)) .setDescription(getString(R.string.Escaneaetiqueta))
.setOkButton(getString(R.string.Buscar)) { .setOkButton(getString(R.string.Buscar)) {
try { try {
if (splash_progress != null) { if (binding.splashProgress != null) {
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
} }
} catch (e: Exception) { } catch (e: Exception) {
@ -1379,8 +1381,8 @@ class CollectionFragment(
customDialogInput.dismiss() customDialogInput.dismiss()
}.setKoButton("Cancelar") { }.setKoButton("Cancelar") {
if (splash_progress != null) { if (binding.splashProgress != null) {
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
} }
hideKeyboards() hideKeyboards()
scanRequest() scanRequest()
@ -1390,7 +1392,7 @@ class CollectionFragment(
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()) { if (!customDialogInput.getValue().isNullOrEmpty()) {
if (splash_progress != null) splash_progress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
viewModel.itemGetAvailable( viewModel.itemGetAvailable(
usuario = user, usuario = user,
password = password, password = password,
@ -1436,9 +1438,9 @@ class CollectionFragment(
} }
} }
//toolbar_title.text = "" + totalMark + "/" + sales.size //toolbar_title.text = "" + totalMark + "/" + sales.size
if (toolbar_title != null) toolbar_title.text = if (binding.mainToolbar.toolbarTitle != null) binding.mainToolbar.toolbarTitle.text =
if (collection.collectionFk != null) collection.collectionFk else "" if (collection.collectionFk != null) collection.collectionFk else ""
if (toolbar_subtitle != null && totalMark != null && sales != null) toolbar_subtitle.text = if (binding.mainToolbar.toolbarSubtitle != null && totalMark != null && sales != null) binding.mainToolbar.toolbarSubtitle .text =
"" + totalMark + "/" + sales.size "" + totalMark + "/" + sales.size
if (totalMark == sales.size) { if (totalMark == sales.size) {
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT) getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
@ -1762,7 +1764,7 @@ class CollectionFragment(
} }
private fun showMistakeList(list: List<MistakeTypeVO>) { private fun showMistakeList(list: List<MistakeTypeVO>) {
if (splash_progress != null) splash_progress.visibility = View.GONE if (binding.splashProgress != null) binding.splashProgress.visibility = View.GONE
listPlacementSupply = ArrayList() listPlacementSupply = ArrayList()
list.forEach { list.forEach {
listPlacementSupply.add(BarcodeVO(code = it.description)) listPlacementSupply.add(BarcodeVO(code = it.description))

View File

@ -4,22 +4,14 @@ package es.verdnatura.presentation.view.feature.historicoshelvinglog.model
class ShelvingLog( class ShelvingLog(
var id:String = "", var id:String = "",
var originFk:String = "", var originFk:String = "",
var workerName:String = "", var name:String = "",
var action:String = "",
var creationDate:String = "", var creationDate:String = "",
var description:String = "", var description:String = "",
var changedModel:String = "",
var oldInstance:Boolean = false,
var newInstance:String = "",
var changedModelId:String = "",
var changedModelValue:String = "",
var isError:Boolean = false, var isError:Boolean = false,
var errorMessage:String = "" var errorMessage:String = ""
) )
class ShelvingLogList( class ShelvingLogList(
var list:List<ShelvingLog> = listOf()) var list:List<ShelvingLog> = listOf())

View File

@ -12,43 +12,41 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
fun inititializeDefaultData() { fun inititializeDefaultData() {
/* _pasillerositem.add( /* _pasillerositem.add(
PasillerosItemVO(20, PasillerosItemVO(20,
R.drawable.barcode_scan, R.drawable.barcode_scan,
"Visor web",R.string.SmarttagAssociate) "Visor web",R.string.SmarttagAssociate)
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO(20, PasillerosItemVO(20,
R.drawable.barcode_scan, R.drawable.barcode_scan,
"Asociar Sacador SmartTags",R.string.SmarttagAssociate) "Asociar Sacador SmartTags",R.string.SmarttagAssociate)
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO(21, PasillerosItemVO(21,
R.drawable.barcode, R.drawable.barcode,
"Registrar SmartTags",R.string.SmarttagRegister) "Registrar SmartTags",R.string.SmarttagRegister)
) )
*/ */
_pasillerositem.add( /* _pasillerositem.add(
PasillerosItemVO(7, PasillerosItemVO(7,
R.drawable.ic_streetview_black_24dp, R.drawable.ic_streetview_black_24dp,
"Pre Control",R.string.precontrolprevious) "Pre Control",R.string.precontrolprevious)
) )*/
_pasillerositem.add(
PasillerosItemVO(7,
R.drawable.ic_history_orange_24dp,
"Log Shelving",R.string.shelvingLog)
)
//sergio para que aparezca el nuevo menu //sergio para que aparezca el nuevo menu
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO(7, PasillerosItemVO(
R.drawable.ic_streetview_black_24dp, 7,
"Pre Sacador",R.string.PreSacador) R.drawable.ic_streetview_black_24dp,
) "Pre Sacador", R.string.PreSacador
)
)
//sergio para que aparezca el nuevo menu //sergio para que aparezca el nuevo menu
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
@ -63,16 +61,21 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
41, 41,
R.drawable.day_of_sale, R.drawable.day_of_sale,
"Día de venta", R.string.dayofSale "Día de venta", R.string.dayofSale
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
10, 10,
R.drawable.ic_history_orange_24dp, R.drawable.revision_icon,
"Histórico Shelving", R.string.itemShelvingLog "Histórico Shelving", R.string.itemShelvingLog
) )
) )
_pasillerositem.add(
PasillerosItemVO(7,
R.drawable.ic_history_orange_24dp,
"Log Shelving",R.string.shelvingLog)
)
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(

View File

@ -4,10 +4,7 @@ import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.view.View import android.view.View
import androidx.fragment.app.setFragmentResult
import androidx.fragment.app.setFragmentResultListener
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R import es.verdnatura.R
@ -20,14 +17,14 @@ import es.verdnatura.presentation.common.TAG
import es.verdnatura.presentation.common.addFragment import es.verdnatura.presentation.common.addFragment
import es.verdnatura.presentation.view.component.CustomDialog import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter import es.verdnatura.presentation.view.feature.inventario.adapter.ToolBarAdapter
import es.verdnatura.presentation.view.feature.login.fragment.LoginFragment
import es.verdnatura.presentation.view.feature.main.activity.MainActivity import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.sacador.adapter.CollectionAdapter import es.verdnatura.presentation.view.feature.sacador.adapter.CollectionAdapter
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import es.verdnatura.presentation.view.feature.smarttag.sacador.fragment.AssociateSmartTagsFragment import es.verdnatura.presentation.view.feature.smarttag.sacador.fragment.AssociateSmartTagsFragment
import kotlinx.android.synthetic.main.activity_main.*
/*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_sacador.* import kotlinx.android.synthetic.main.fragment_sacador.*
import kotlinx.android.synthetic.main.toolbar.* import kotlinx.android.synthetic.main.toolbar.**/
class SacadorFragment : class SacadorFragment :
BaseFragment<FragmentSacadorBinding, SacadorViewModel>(SacadorViewModel::class) { BaseFragment<FragmentSacadorBinding, SacadorViewModel>(SacadorViewModel::class) {
@ -80,9 +77,9 @@ class SacadorFragment :
override fun init() { override fun init() {
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
splash_progress_two.visibility = View.GONE binding.splashProgressTwo.visibility = View.GONE
toolbar_title.text = getString(R.string.getcollection) binding.mainToolbar.toolbarTitle.text = getString(R.string.getcollection)
setToolBar() setToolBar()
setEvents() setEvents()
viewModel.collectionGet(user, password,"collection_get") viewModel.collectionGet(user, password,"collection_get")
@ -98,8 +95,9 @@ class SacadorFragment :
private fun setToolBar() { private fun setToolBar() {
requireActivity().main_bottom_navigation.visibility = View.VISIBLE // requireActivity().main_bottom_navigation.visibility = View.VISIBLE
backButton.visibility = View.GONE (activity as MainActivity).hideBottomNavigation(View.VISIBLE)
binding.mainToolbar.backButton.visibility = View.GONE
val listIcons: ArrayList<Drawable> = ArrayList() val listIcons: ArrayList<Drawable> = ArrayList()
val iconAdd: Drawable = val iconAdd: Drawable =
resources.getDrawable(R.drawable.ic_add_black_24dp, resources.newTheme()) resources.getDrawable(R.drawable.ic_add_black_24dp, resources.newTheme())
@ -109,10 +107,10 @@ class SacadorFragment :
listIcons.add(iconVehicleIn) listIcons.add(iconVehicleIn)
listIcons.add(iconAdd) listIcons.add(iconAdd)
toolbar_icons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
if (item == iconAdd) { if (item == iconAdd) {
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
//viewModel.collectionNew(user, password, sectorFk, wagons) //viewModel.collectionNew(user, password, sectorFk, wagons)
viewModel.collectionNew(user,password,sectorFk,wagons,getTagsType(),"collection_new_wagon") viewModel.collectionNew(user,password,sectorFk,wagons,getTagsType(),"collection_new_wagon")
//checkTagsMode() //checkTagsMode()
@ -124,14 +122,14 @@ class SacadorFragment :
} }
} }
}) })
toolbar_icons.layoutManager = binding.mainToolbar.toolbarIcons.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
private fun setEvents() { private fun setEvents() {
sacador_swipe.setOnRefreshListener { binding.sacadorSwipe.setOnRefreshListener {
viewModel.collectionGet(user, password,"collection_get") viewModel.collectionGet(user, password,"collection_get")
sacador_swipe.isRefreshing = false binding.sacadorSwipe.isRefreshing = false
} }
} }
@ -168,13 +166,13 @@ class SacadorFragment :
with(viewModel) { with(viewModel) {
collectionList.observe(viewLifecycleOwner, Observer { collectionList.observe(viewLifecycleOwner, Observer {
if (!goBack2) splash_progress.visibility = View.GONE if (!goBack2) binding.splashProgress.visibility = View.GONE
createCollectionList(it.list) createCollectionList(it.list)
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
goBack2 = false goBack2 = false
}) })
/* collectionTicketList.observe(viewLifecycleOwner, Observer { /* collectionTicketList.observe(viewLifecycleOwner, Observer {
splash_progress_two.visibility = View.GONE binding.splashProgress_two.visibility = View.GONE
if (it.isError){ if (it.isError){
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){ customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Aceptar"){
customDialog.dismiss() customDialog.dismiss()
@ -185,8 +183,8 @@ class SacadorFragment :
goBack = false goBack = false
})*/ })*/
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
splash_progress_two.visibility = View.GONE binding.splashProgressTwo.visibility = View.GONE
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
if (it.isError) { if (it.isError) {
customDialog.setTitle("Error").setDescription(it.errorMessage) customDialog.setTitle("Error").setDescription(it.errorMessage)
.setOkButton("Aceptar") { .setOkButton("Aceptar") {
@ -209,8 +207,8 @@ class SacadorFragment :
} }
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
adapter = CollectionAdapter(collectionsList, onCollectionSelectedListener!!) adapter = CollectionAdapter(collectionsList, onCollectionSelectedListener!!)
fragment_sacador_collections.layoutManager = lm binding.fragmentSacadorCollections.layoutManager = lm
fragment_sacador_collections.adapter = adapter binding.fragmentSacadorCollections.adapter = adapter
} }

View File

@ -29,9 +29,9 @@ import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapter import es.verdnatura.presentation.view.feature.ubicador.adapter.UbicadorAdapter
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
import kotlinx.android.synthetic.main.activity_main.* /*import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.fragment_ubicador.* import kotlinx.android.synthetic.main.fragment_ubicador.*
import kotlinx.android.synthetic.main.toolbar.* import kotlinx.android.synthetic.main.toolbar.**/
class UbicadorFragment( class UbicadorFragment(
var shelvingFk:String = "" var shelvingFk:String = ""
@ -78,13 +78,14 @@ class UbicadorFragment(
customDialog = CustomDialog(requireContext()) customDialog = CustomDialog(requireContext())
customDialogUbicador = CustomDialogUbicador(requireContext()) customDialogUbicador = CustomDialogUbicador(requireContext())
customDialogTwoButtons = CustomDialogTwoButtons(requireContext()) customDialogTwoButtons = CustomDialogTwoButtons(requireContext())
requireActivity().main_bottom_navigation.visibility = View.GONE //requireActivity().main_bottom_navigation.visibility = View.GONE
toolbar_title.text = getString(R.string.locator) (activity as MainActivity).hideBottomNavigation(View.GONE)
binding.mainToolbar.toolbarTitle.text = getString(R.string.locator)
setEvents() setEvents()
setToolBar() setToolBar()
if (!shelvingFk.isNullOrEmpty()){ if (!shelvingFk.isNullOrEmpty()){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
toolbar_title.text = shelvingFk binding.mainToolbar.toolbarTitle.text = shelvingFk
viewModel.itemShelvingList(user,password,shelvingFk,"itemShelvingList") viewModel.itemShelvingList(user,password,shelvingFk,"itemShelvingList")
} }
super.init() super.init()
@ -102,50 +103,50 @@ class UbicadorFragment(
val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme()) val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme())
listIcons.add(iconAdd) listIcons.add(iconAdd)
listIcons.add(iconReload) listIcons.add(iconReload)
toolbar_icons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener { binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) { override fun onOptionsItemSelected(item: Drawable) {
if (item == iconAdd){ if (item == iconAdd){
showAddItem("","","","",false,ItemUbicadorVO(),"") showAddItem("","","","",false,ItemUbicadorVO(),"")
}else if(item == iconReload){ }else if(item == iconReload){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.itemShelvingList(user,password,shelvingFk,"itemShelvingList") viewModel.itemShelvingList(user,password,shelvingFk,"itemShelvingList")
} }
} }
}) })
toolbar_icons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
} }
private fun setEvents(){ private fun setEvents(){
backButton.setOnClickListener { binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed() requireActivity().onBackPressed()
} }
edit_matricula.requestFocus() binding.editMatricula.requestFocus()
edit_matricula.setOnEditorActionListener { v, actionId, event -> binding.editMatricula.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!edit_matricula.text.toString().isNullOrEmpty()){ if (!binding.editMatricula.text.toString().isNullOrEmpty()){
toolbar_title.text = edit_matricula.text.toString() binding.mainToolbar.toolbarTitle.text = binding.editMatricula.text.toString()
shelvingFk = edit_matricula.text.toString() shelvingFk = binding.editMatricula.text.toString()
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
viewModel.itemShelvingList(user,password,edit_matricula.text.toString(),"itemShelvingList") viewModel.itemShelvingList(user,password,binding.editMatricula.text.toString(),"itemShelvingList")
} }
edit_matricula.setText("") binding.editMatricula.setText("")
(activity as MainActivity).hideKeyboard(edit_matricula) (activity as MainActivity).hideKeyboard(binding.editMatricula)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
return@setOnEditorActionListener false return@setOnEditorActionListener false
} }
edit_prioridad.setOnEditorActionListener { v, actionId, event -> binding.editPrioridad.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!edit_prioridad.text.toString().isNullOrEmpty()){ if (!binding.editPrioridad.text.toString().isNullOrEmpty()){
viewModel.shelvingPriorityUpdate(user,password,edit_prioridad.text.toString(),shelvingFk,"shelvingPriority_update") viewModel.shelvingPriorityUpdate(user,password,binding.editPrioridad.text.toString(),shelvingFk,"shelvingPriority_update")
} }
(activity as MainActivity).hideKeyboard(edit_prioridad) (activity as MainActivity).hideKeyboard(binding.editPrioridad)
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
@ -153,18 +154,18 @@ class UbicadorFragment(
} }
automatic_img.setOnClickListener { binding.automaticImg.setOnClickListener {
if (!shelvingFk.isNullOrEmpty()) if (!shelvingFk.isNullOrEmpty())
(activity as MainActivity).onPasillerosItemClickListener(PasillerosItemVO(title = "Automatic"),entryPoint = shelvingFk) (activity as MainActivity).onPasillerosItemClickListener(PasillerosItemVO(title = "Automatic"),entryPoint = shelvingFk)
else else
"Escanea una matrícula".toast(requireActivity(),Toast.LENGTH_SHORT) "Escanea una matrícula".toast(requireActivity(),Toast.LENGTH_SHORT)
} }
parking_img.setOnClickListener { binding.parkingImg.setOnClickListener {
customDialogInput.setTitle("Aparcar carro").setValue("").setOkButton("Aparcar"){ customDialogInput.setTitle("Aparcar carro").setValue("").setOkButton("Aparcar"){
viewModel.shelvingPark(user,password,shelvingFk,customDialogInput.getValue(),"shelvingPark") viewModel.shelvingPark(user,password,shelvingFk,customDialogInput.getValue(),"shelvingPark")
parking = customDialogInput.getValue() parking = customDialogInput.getValue()
toolbar_title.text = shelvingFk.uppercase() + " P: "+parking + " E: "+etiquetas binding.mainToolbar.toolbarTitle.text = shelvingFk.uppercase() + " P: "+parking + " E: "+etiquetas
if(mpok != null) mpok!!.start() if(mpok != null) mpok!!.start()
customDialogInput.dismiss() customDialogInput.dismiss()
}.setKoButton("Cancelar"){ }.setKoButton("Cancelar"){
@ -179,10 +180,10 @@ class UbicadorFragment(
viewModel.shelvingPark(user,password,shelvingFk,customDialogInput.getValue(),"shelvingPark") viewModel.shelvingPark(user,password,shelvingFk,customDialogInput.getValue(),"shelvingPark")
customDialogInput.dismiss() customDialogInput.dismiss()
parking = customDialogInput.getValue() parking = customDialogInput.getValue()
if (toolbar_title != null && shelvingFk != null && parking != null && etiquetas != null){ if (binding.mainToolbar.toolbarTitle != null && shelvingFk != null && parking != null && etiquetas != null){
toolbar_title.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas binding.mainToolbar.toolbarTitle.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas
}else{ }else{
toolbar_title.text = "" binding.mainToolbar.toolbarTitle.text = ""
} }
if (mpok != null) { if (mpok != null) {
mpok!!.start() mpok!!.start()
@ -195,11 +196,11 @@ class UbicadorFragment(
} }
edit_img.setOnClickListener { binding.editPrioridad.setOnClickListener {
customDialogInput.setTitle("Cambiar matrícula").setValue("").setOkButton("Guardar"){ customDialogInput.setTitle("Cambiar matrícula").setValue("").setOkButton("Guardar"){
viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue(),"shelvingChange") viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue(),"shelvingChange")
shelvingFk = customDialogInput.getValue() shelvingFk = customDialogInput.getValue()
toolbar_title.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas binding.mainToolbar.toolbarTitle.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas
if(mpok != null) mpok!!.start() if(mpok != null) mpok!!.start()
customDialogInput.dismiss() customDialogInput.dismiss()
}.setKoButton("Cancelar"){ }.setKoButton("Cancelar"){
@ -213,7 +214,7 @@ class UbicadorFragment(
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) {
viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue(),"shelvingChange") viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue(),"shelvingChange")
shelvingFk = customDialogInput.getValue() shelvingFk = customDialogInput.getValue()
toolbar_title.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas binding.mainToolbar.toolbarTitle.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas
if(mpok != null) mpok!!.start() if(mpok != null) mpok!!.start()
customDialogInput.dismiss() customDialogInput.dismiss()
return@setOnEditorActionListener true return@setOnEditorActionListener true
@ -223,7 +224,7 @@ class UbicadorFragment(
} }
delete_img.setOnClickListener { binding.deleteImg.setOnClickListener {
customDialog.setTitle("Vaciar carro").setDescription("Esta operación no se puede rectificar.").setOkButton("Vaciar"){ customDialog.setTitle("Vaciar carro").setDescription("Esta operación no se puede rectificar.").setOkButton("Vaciar"){
viewModel.clearShelvingList(user,password,shelvingFk,"clearShelvingList") viewModel.clearShelvingList(user,password,shelvingFk,"clearShelvingList")
listItems.forEach { listItems.forEach {
@ -259,10 +260,10 @@ class UbicadorFragment(
listItems.add(item) listItems.add(item)
} }
etiquetas = contEtiquetas.toString() etiquetas = contEtiquetas.toString()
toolbar_title.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas binding.mainToolbar.toolbarTitle.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas
if(it.list.size > 0) if(it.list.size > 0)
edit_prioridad.setText(it.list[0].priority) binding.editPrioridad.setText(it.list[0].priority)
splash_progress.visibility = View.GONE binding.splashProgress.visibility = View.GONE
//sergio: para mostrar CustomDialogUbicator, ubicador con grouping //sergio: para mostrar CustomDialogUbicator, ubicador con grouping
adapter = UbicadorAdapter(listItems,onPasillerosItemClickListener = pasillerosItemClickListener!!, adapter = UbicadorAdapter(listItems,onPasillerosItemClickListener = pasillerosItemClickListener!!,
@ -282,8 +283,8 @@ class UbicadorFragment(
}) })
location_recyclerview.adapter = adapter binding.locationRecyclerview.adapter = adapter
location_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, true) binding.locationRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, true)
} }
}) })
@ -310,8 +311,8 @@ class UbicadorFragment(
responseMake.observe(viewLifecycleOwner, Observer { responseMake.observe(viewLifecycleOwner, Observer {
if (!shelvingFk.isNullOrEmpty()){ if (!shelvingFk.isNullOrEmpty()){
splash_progress.visibility = View.VISIBLE binding.splashProgress.visibility = View.VISIBLE
toolbar_title.text = shelvingFk binding.mainToolbar.toolbarTitle.text = shelvingFk
viewModel.itemShelvingList(user,password,shelvingFk,"itemShelvingList") viewModel.itemShelvingList(user,password,shelvingFk,"itemShelvingList")
} }
}) })
@ -438,7 +439,7 @@ class UbicadorFragment(
}*/ }*/
private fun changeOfflineValue(item:ItemUbicadorVO){ private fun changeOfflineValue(item:ItemUbicadorVO){
if (splash_progress != null) splash_progress.visibility = View.VISIBLE if (binding.splashProgress != null) binding.splashProgress.visibility = View.VISIBLE
/*listItems.add(item) /*listItems.add(item)
adapter?.notifyDataSetChanged()*/ adapter?.notifyDataSetChanged()*/
} }

View File

@ -2,4 +2,6 @@
android:viewportHeight="24.0" android:viewportWidth="24.0" android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F7931E" android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/> <path android:fillColor="#F7931E" android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
</vector> </vector>

View File

@ -0,0 +1,13 @@
<!-- drawable/barcode_scan.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:tint="#F7931E"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:pathData="M21 11.11V5C21 3.9 20.11 3 19 3H14.82C14.4 1.84 13.3 1 12 1S9.6 1.84 9.18 3H5C3.9 3 3 3.9 3 5V19C3 20.11 3.9 21 5 21H11.11C12.37 22.24 14.09 23 16 23C19.87 23 23 19.87 23 16C23 14.09 22.24 12.37 21 11.11M12 3C12.55 3 13 3.45 13 4S12.55 5 12 5 11 4.55 11 4 11.45 3 12 3M6 7H18V9H6V7M9.08 17H6V15H9.08" android:fillColor="#000"/>
</vector>

View File

@ -89,6 +89,7 @@
android:text="Acción" android:text="Acción"
android:textSize="@dimen/body2" android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:visibility="gone"
android:gravity="right" android:gravity="right"
android:paddingRight="@dimen/layout_margin_min"/> android:paddingRight="@dimen/layout_margin_min"/>

View File

@ -34,7 +34,7 @@
android:id="@+id/itemFk" android:id="@+id/itemFk"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{item.workerName}" android:text="@{item.name}"
android:textSize="@dimen/body2" android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
@ -49,15 +49,7 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="center"/> android:gravity="center"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{item.action}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:paddingRight="@dimen/layout_margin_min"
android:gravity="right"/>
</LinearLayout> </LinearLayout>
@ -83,16 +75,6 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="left" android:gravity="left"
/> />
<TextView
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{item.description}"
android:textSize="@dimen/body2"
android:textColor="@color/verdnatura_white"
android:layout_weight="1"
android:gravity="center"/>

View File

@ -152,6 +152,6 @@
<string name="Referencia">Referencia</string> <string name="Referencia">Referencia</string>
<string name="precontrolprevious">Control Previa</string> <string name="precontrolprevious">Control Previa</string>
<string name="itemShelvingLog">Historico de ítems del carro</string> <string name="itemShelvingLog">Historico de ítems del carro</string>
<string name="shelvingLog">Histórico por matrícula</string> <string name="shelvingLog">Histórico del carro</string>
<string name="bufferload">Cargar expedición en buffer</string> <string name="bufferload">Cargar expedición en buffer</string>
</resources> </resources>