From 7bc6e93a8474ccc2596ed242f0f4a5ae77f1a44a Mon Sep 17 00:00:00 2001 From: Enrique Blasco Date: Tue, 4 Aug 2020 09:19:15 +0200 Subject: [PATCH] V5.1.5 --- app/build.gradle | 4 +- .../java/es/verdnatura/domain/ApiUtils.kt | 4 +- .../verdnatura/domain/GetUbicadorUserCase.kt | 7 ++ .../es/verdnatura/domain/VerdnaturaService.kt | 9 ++ .../ajustes/fragment/AjustesFragment.kt | 12 +-- .../articulo/fragment/ItemCardFragment.kt | 10 +-- .../collection/fragment/CollectionFragment.kt | 44 +++++----- .../feature/main/activity/MainActivity.kt | 20 ++--- .../pasillero/adapter/PasillerosAdapter.kt | 7 +- .../pasillero/fragment/PasilleroViewModel.kt | 19 ++-- .../pasillero/model/PasillerosItemVO.kt | 3 +- .../ubicador/fragment/UbicadorFragment.kt | 15 ++++ .../ubicador/fragment/UbicadorViewModel.kt | 18 ++++ .../layout/component_custom_edit_dialog.xml | 2 +- .../main/res/layout/component_custom_hour.xml | 4 +- .../layout/component_custom_three_dialog.xml | 2 +- .../component_custom_ubicador_dialog.xml | 4 +- app/src/main/res/layout/fragment_ajustes.xml | 6 +- .../layout/fragment_automatic_add_item.xml | 4 +- .../main/res/layout/fragment_buscar_item.xml | 8 +- .../main/res/layout/fragment_collection.xml | 2 +- .../main/res/layout/fragment_controlador.xml | 2 +- .../res/layout/fragment_expedition_pallet.xml | 4 +- .../fragment_expedition_pallet_detail.xml | 6 +- .../res/layout/fragment_expedition_scan.xml | 6 +- .../layout/fragment_expedition_truck_list.xml | 2 +- app/src/main/res/layout/fragment_faltas.xml | 6 +- .../main/res/layout/fragment_historico.xml | 10 +-- .../main/res/layout/fragment_inventary.xml | 4 +- .../main/res/layout/fragment_item_card.xml | 22 +++-- app/src/main/res/layout/fragment_login.xml | 12 +-- app/src/main/res/layout/fragment_parking.xml | 4 +- .../main/res/layout/fragment_pre_sacador.xml | 2 +- .../res/layout/fragment_shelving_parking.xml | 8 +- .../res/layout/fragment_transferencia.xml | 16 ++-- app/src/main/res/layout/fragment_ubicador.xml | 21 ++++- app/src/main/res/layout/item_article_row.xml | 6 +- .../res/layout/item_pasilleros_main_menu.xml | 5 +- app/src/main/res/values-es/strings.xml | 86 +++++++++++++++++++ app/src/main/res/values/strings.xml | 84 +++++++++++++++++- 40 files changed, 381 insertions(+), 129 deletions(-) create mode 100644 app/src/main/res/values-es/strings.xml diff --git a/app/build.gradle b/app/build.gradle index d8cbd43f..50bbf265 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId "es.verdnatura" minSdkVersion 21 targetSdkVersion 29 - versionCode 24 - versionName "5.1.4" + versionCode 25 + versionName "5.1.5" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/es/verdnatura/domain/ApiUtils.kt b/app/src/main/java/es/verdnatura/domain/ApiUtils.kt index 5e55ccd4..e20a9a33 100644 --- a/app/src/main/java/es/verdnatura/domain/ApiUtils.kt +++ b/app/src/main/java/es/verdnatura/domain/ApiUtils.kt @@ -8,8 +8,8 @@ import java.util.concurrent.TimeUnit class ApiUtils { companion object { - // const val BASE_URL:String = "http://192.168.1.104:8009/" - const val BASE_URL:String = "https://app.verdnatura.es/" + //const val BASE_URL:String = "http://192.168.1.100:8009/" + const val BASE_URL:String = "https://app.verdnatura.es/" fun getApiService():VerdnaturaService{ val retrofit = Retrofit.Builder() .baseUrl(BASE_URL) diff --git a/app/src/main/java/es/verdnatura/domain/GetUbicadorUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetUbicadorUserCase.kt index 5a1110af..9ee12c54 100644 --- a/app/src/main/java/es/verdnatura/domain/GetUbicadorUserCase.kt +++ b/app/src/main/java/es/verdnatura/domain/GetUbicadorUserCase.kt @@ -33,6 +33,13 @@ class GetUbicadorUserCase : RestClient() { return restClient!!.itemShelvingMake_multi("json","1",usuario,password,"application/json",params) } + fun shelvingPriorityUpdate(usuario:String,password:String,priority:String,shelving:String) : Call { + val params:ArrayList = ArrayList(); + params.add(priority) + params.add(shelving) + return restClient!!.shelvingPriorityUpdate("json","1",usuario,password,"application/json",params) + } + fun shelvingPark(usuario:String,password:String,shelving:String,parking:String) : Call { val params:ArrayList = ArrayList(); params.add(shelving) diff --git a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt index 7bc2b2a6..4db801ac 100644 --- a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt +++ b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt @@ -340,6 +340,15 @@ interface VerdnaturaService { @Body params: List): Call> + @POST("almacennew/shelvingPriorityUpdate") + fun shelvingPriorityUpdate(@Header("aplicacion") aplicacion: String, + @Header("version") version: String, + @Header("user") user: String, + @Header("pass") pass: String, + @Header("Content-Type") content_type: String, + @Body params: List): + Call + @POST("almacennew/itemShelvingMake") fun itemShelvingMake(@Header("aplicacion") aplicacion: String, @Header("version") version: String, diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt index cf164b86..f3feb108 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt @@ -36,7 +36,7 @@ class AjustesFragment : BaseFragment(Aj override fun onCreate(savedInstanceState: Bundle?) { prefs = activity!!.getSharedPreferences(PREFS_USER,0) customDialog = CustomDialog(requireContext()) - viewModel.inititializeDefaultAjusts(prefs!!.getString(SECTORDESCRIP,"Sin sector").toString(),prefs!!.getInt(SECTORFK,0),prefs!!.getInt(WAREHOUSEFK,0)) + viewModel.inititializeDefaultAjusts(prefs!!.getString(SECTORDESCRIP,getString(R.string.Sinsector)).toString(),prefs!!.getInt(SECTORFK,0),prefs!!.getInt(WAREHOUSEFK,0)) super.onCreate(savedInstanceState) } @@ -62,9 +62,9 @@ class AjustesFragment : BaseFragment(Aj } else if (item.id == 1){ activity!!.onBackPressed() }else if (item.id == 2){ - "No disponible en esta versión".toast(requireContext()) + getString(R.string.Nodisponibleenestaversión).toast(requireContext()) }else if (item.id == 3){ - "No disponible en esta versión".toast(requireContext()) + getString(R.string.Nodisponibleenestaversión).toast(requireContext()) } } }) @@ -75,7 +75,7 @@ class AjustesFragment : BaseFragment(Aj event.getContentIfNotHandled().notNull { splash_progress.visibility = View.INVISIBLE if (it.list != null && it.list.size > 0 && it.list.get(0).isError){ - customDialog.setTitle("Error").setDescription(it.list.get(0).errorMessage).setOkButton("Cerrar"){ + customDialog.setTitle("Error").setDescription(it.list.get(0).errorMessage).setOkButton(getString(R.string.Cerrar)){ customDialog.dismiss() }.show() }else{ @@ -90,7 +90,7 @@ class AjustesFragment : BaseFragment(Aj showDialogSector(listSectores.toArray(array)) }else{ - customDialog.setTitle("Sectores").setDescription("No existes sectores.").setOkButton("Cerrar"){ + customDialog.setTitle("Sectores").setDescription(getString(R.string.Noexistessectores)).setOkButton(getString(R.string.Cerrar)){ customDialog.dismiss() }.show() } @@ -106,7 +106,7 @@ class AjustesFragment : BaseFragment(Aj val builder = AlertDialog.Builder(this.context) - builder.setTitle("Selecciona un sector") + builder.setTitle(getString(R.string.Seleccionaunsector)) builder.setItems(array) { _, which -> val selected = array[which] sectorListVO.forEach { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt index 3faedf4b..9101db92 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt @@ -186,17 +186,17 @@ class ItemCardFragment( itemcard_tag4.text = itemInfo.value7 + " " + itemInfo.origin listItemsRow = ArrayList() listItemsRow.add(ItemCardRowVO(title = "Total",value = itemInfo.total,isEditable = false)) - listItemsRow.add(ItemCardRowVO(title = "Disponible",value = itemInfo.available,isEditable = false)) - listItemsRow.add(ItemCardRowVO(title = "Ubicado",value = itemInfo.enAltillo,isEditable = false)) + listItemsRow.add(ItemCardRowVO(title = getString(R.string.Disponible),value = itemInfo.available,isEditable = false)) + listItemsRow.add(ItemCardRowVO(title = getString(R.string.Ubicado),value = itemInfo.enAltillo,isEditable = false)) //EDITABLES - listItemsRow.add(ItemCardRowVO(title = "SIN UBICAR",value = itemInfo.enNicho,isEditable = true, action = "itemStockUpdate")) - listItemsRow.add(ItemCardRowVO(title = "BUSCAR ITEM",value = "",isEditable = true, action = "buscarItem")) + listItemsRow.add(ItemCardRowVO(title = getString(R.string.SINUBICAR),value = itemInfo.enNicho,isEditable = true, action = "itemStockUpdate")) + listItemsRow.add(ItemCardRowVO(title = getString(R.string.BUSCARITEM),value = "",isEditable = true, action = "buscarItem")) //listItemsRow.add(ItemCardRowVO(title = "NICHO",value = itemInfo.nicho,isEditable = true, action = "itemPlacementSave")) // listItemsRow.add(ItemCardRowVO(title = "RESERVA",value = itemInfo.reserva,isEditable = true, action = "itemPlacementSave")) listItemsRow.add(ItemCardRowVO(title = "GROUPING",value = itemInfo.grouping,isEditable = true, action = "updateGrouping")) listItemsRow.add(ItemCardRowVO(title = "PACKING",value = itemInfo.packing,isEditable = true, action = "updatePacking")) - listItemsRow.add(ItemCardRowVO(title = "MINIMO",value = itemInfo.min,isEditable = true, action = "itemSaveMin")) + listItemsRow.add(ItemCardRowVO(title = getString(R.string.MINIMO),value = itemInfo.min,isEditable = true, action = "itemSaveMin")) listItemsRow.add(ItemCardRowVO(title = "BARCODE",barcodes = itemInfo.barcodes,isEditable = true, action = "toBarcode")) listBarcodes = itemInfo.barcodes as ArrayList diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt index bddf52ba..7b4460b3 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt @@ -432,9 +432,11 @@ class CollectionFragment( ) } mpok!!.start() - "Ticket aparcado".toast(requireContext()) + getString(R.string.Ticketaparcado).toast(requireContext()) }else{ splash_progress.visibility = View.VISIBLE + storedPosition = 0 + storedBackPosition = 0 viewModel.collectionTicketGet(user,password,txtscan,sectorFk) } } @@ -765,7 +767,7 @@ class CollectionFragment( collectionFk = collection.collectionFk, sectorFk = sectorFk ) - "Imprimiendo...".toast(requireContext()) + getString(R.string.Imprimiendo).toast(requireContext()) } private fun addItem(){ @@ -777,11 +779,11 @@ class CollectionFragment( ticketSelected = listPlacementSupply[0].code!! } - customDialogList.setTitle("Agregar artículo para ticket: "+ticketSelected).setOkButton("Agregar"){ + customDialogList.setTitle(getString(R.string.Agregarartículoparaticket)+" "+ticketSelected).setOkButton(getString(R.string.Agregar)){ if (ticketSelected.isNullOrEmpty()){ - "Selecciona un ticket de la lista".toast(requireContext()) + getString(R.string.Seleccionaunticketdelaista).toast(requireContext()) }else if (customDialogList.getValue().isNullOrEmpty() || customDialogList.getValueTwo().isNullOrEmpty()) { - "Todos los campos son obligatorios".toast(requireContext()) + getString(R.string.Todosloscampossonobligatorios).toast(requireContext()) }else{ splash_progress.visibility = View.VISIBLE viewModel.collectionAddItem( @@ -800,7 +802,7 @@ class CollectionFragment( }.setKoButton("Cerrar"){ scanRequest() customDialogList.dismiss() - }.setHintValue("Artículo:").setValue("").setHintValueTwo("Cantidad:").setValueTwo("").show() + }.setHintValue(getString(R.string.Artículo)).setValue("").setHintValueTwo(getString(R.string.Cantidad)).setValueTwo("").show() customDialogList.getEditText().requestFocus() hideKeyboards() @@ -820,9 +822,9 @@ class CollectionFragment( if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) { if (!customDialogList.getValueTwo().isNullOrEmpty()){ if (ticketSelected.isNullOrEmpty()){ - "Selecciona un ticket de la lista".toast(requireContext()) + getString(R.string.Seleccionaunticketdelaista).toast(requireContext()) }else if (customDialogList.getValue().isNullOrEmpty() || customDialogList.getValueTwo().isNullOrEmpty()) { - "Todos los campos son obligatorios".toast(requireContext()) + getString(R.string.Todosloscampossonobligatorios).toast(requireContext()) }else{ splash_progress.visibility = View.VISIBLE viewModel.collectionAddItem( @@ -847,9 +849,9 @@ class CollectionFragment( placementSupplyAdapter = BarcodeAdapter(listPlacementSupply,object: OnBarcodeRowClickListener { override fun onBarcodeRowClickListener(item: BarcodeVO) { - customDialogInput.setTitle("Artículo para Ticket: "+item.code!!) + customDialogInput.setTitle(getString(R.string.ArtículoparaTicket)+" "+item.code!!) ticketSelected = item.code!! - customDialogList.setTitle("Agregar artículo para ticket: "+ticketSelected) + customDialogList.setTitle(getString(R.string.Agregarartículoparaticket)+" "+ticketSelected) } },showDelete = false) @@ -862,7 +864,7 @@ class CollectionFragment( private fun showDisponibility(){ - customDialogInput.setTitle("Ver disponible").setDescription("Escanea etiqueta: ").setOkButton("Buscar"){ + customDialogInput.setTitle(getString(R.string.Verdisponible)).setDescription(getString(R.string.Escaneaetiqueta)).setOkButton(getString(R.string.Buscar)){ splash_progress.visibility = View.VISIBLE hideKeyboards() viewModel.itemGetAvailable( @@ -929,25 +931,25 @@ class CollectionFragment( toolbar_title.text = collection.collectionFk toolbar_subtitle.text = "" +totalMark + "/" + sales.size if (totalMark == sales.size) { - "Colección completa".toast(this.context,Toast.LENGTH_SHORT) + getString(R.string.Coleccióncompleta).toast(this.context,Toast.LENGTH_SHORT) changeTicketState() } } //FALTAS / BASURA / SPLIT private fun showQuantityDialog(position:Int) { - customDialogThreeButtons.setTitle("Nueva cantidad").setDescription("Indica la nueva cantidad y la acción que quieres realizar con el resto.").setValue("") - .setOkButton("Faltas"){ + customDialogThreeButtons.setTitle(getString(R.string.Nuevacantidad)).setDescription(getString(R.string.txtnuevacantidad)).setValue("") + .setOkButton(getString(R.string.Faltas)){ if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){ - "Indica nueva cantidad".toast(requireContext()) + getString(R.string.Indicanuevacantidad).toast(requireContext()) }else{ trash(position,customDialogThreeButtons.getValue()) scanRequest() customDialogThreeButtons.dismiss() } - }.setOkButtonTwo("Basura / Rechazar"){ + }.setOkButtonTwo(getString(R.string.BasuraRechazar)){ if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){ - "Indica nueva cantidad".toast(requireContext()) + getString(R.string.Indicanuevacantidad).toast(requireContext()) }else{ missing(position,customDialogThreeButtons.getValue()) scanRequest() @@ -955,16 +957,16 @@ class CollectionFragment( } }.setOkButtonThree("Split"){ if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){ - "Indica nueva cantidad".toast(requireContext()) + getString(R.string.Indicanuevacantidad).toast(requireContext()) }else{ split(position,customDialogThreeButtons.getValue()) scanRequest() customDialogThreeButtons.dismiss() } - }.setOkButtonAdd("Agregar"){ + }.setOkButtonAdd(getString(R.string.Agregar)){ if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){ - "Indica nueva cantidad".toast(requireContext()) + getString(R.string.Indicanuevacantidad).toast(requireContext()) }else{ increaseQuantity(position,customDialogThreeButtons.getValue()) scanRequest() @@ -1130,7 +1132,7 @@ class CollectionFragment( //OTROS private fun showScanner(index:Int, sale:SaleVO){ - customDialogInput.setTitle(""+sale.itemFk).setDescription("Escanea el carro para el item seleccionado").setOkButton("Aceptar"){ + customDialogInput.setTitle(""+sale.itemFk).setDescription(getString(R.string.Escaneaelcarroparaelitemseleccionado)).setOkButton("Aceptar"){ if (!customDialogInput.getValue().isNullOrEmpty()) { findSale(customDialogInput.getValue(),index) } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt index 82cebca1..9e25cef4 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt @@ -72,23 +72,23 @@ class MainActivity : BaseActivity() , OnPasillerosItemClick GlobalScope.launch(Dispatchers.Main){ val bottomMenuItems : ArrayList = ArrayList() - bottomMenuItems.add(ItemMenuVO(0,title = "Pasilleros",defaultImage = ContextCompat.getDrawable( + bottomMenuItems.add(ItemMenuVO(0,title = getString(R.string.Pasilleros),defaultImage = ContextCompat.getDrawable( applicationContext,R.drawable.ic_device_hub_black_24dp),selectedImage = ContextCompat.getDrawable( applicationContext,R.drawable.ic_device_hub_black_24dp_selected))) - bottomMenuItems.add(ItemMenuVO(1,title = "Sacadores",defaultImage = ContextCompat.getDrawable( + bottomMenuItems.add(ItemMenuVO(1,title = getString(R.string.Sacadores),defaultImage = ContextCompat.getDrawable( applicationContext,R.drawable.ic_local_florist_black_24dp),selectedImage = ContextCompat.getDrawable( applicationContext,R.drawable.ic_local_florist_black_24dp_selected))) - bottomMenuItems.add(ItemMenuVO(2,title = "Controladores",defaultImage = ContextCompat.getDrawable( + bottomMenuItems.add(ItemMenuVO(2,title = getString(R.string.Controladores),defaultImage = ContextCompat.getDrawable( applicationContext,R.drawable.ic_verified_user_black_24dp),selectedImage = ContextCompat.getDrawable( applicationContext,R.drawable.ic_verified_user_black_24dp_selected))) - bottomMenuItems.add(ItemMenuVO(3,title = "Paletizadores",defaultImage = ContextCompat.getDrawable( + bottomMenuItems.add(ItemMenuVO(3,title = getString(R.string.Paletizadores),defaultImage = ContextCompat.getDrawable( applicationContext,R.drawable.ic_local_shipping_black_24dp),selectedImage = ContextCompat.getDrawable( applicationContext,R.drawable.ic_local_shipping_black_24dp_selected))) - bottomMenuItems.add(ItemMenuVO(4,title = "Ajustes",defaultImage = ContextCompat.getDrawable( + bottomMenuItems.add(ItemMenuVO(4,title = getString(R.string.Ajustes),defaultImage = ContextCompat.getDrawable( applicationContext,R.drawable.ic_build_black_24dp),selectedImage = ContextCompat.getDrawable( applicationContext,R.drawable.ic_build_black_24dp_selected))) @@ -125,27 +125,27 @@ class MainActivity : BaseActivity() , OnPasillerosItemClick when (selectedItemMenu?.title) { - "Pasilleros" -> { + getString(R.string.Pasilleros) -> { fm.popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE) addFragment(PasilleroFragment.newInstance(),R.id.main_frame_layout, PasilleroFragment.TAG,false) true } - "Sacadores" -> { + getString(R.string.Sacadores) -> { fm.popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE) addFragment(SacadorFragment.newInstance(),R.id.main_frame_layout, SacadorFragment.TAG,false) true } - "Controladores" -> { + getString(R.string.Controladores) -> { fm.popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE) addFragment(ControladorFragment.newInstance(),R.id.main_frame_layout, ControladorFragment.TAG,false) true } - "Paletizadores" -> { + getString(R.string.Paletizadores) -> { fm.popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE) addFragment(ExpeditionTruckListFragment.newInstance(),R.id.main_frame_layout, ExpeditionTruckListFragment.TAG,false) true } - "Ajustes" -> { + getString(R.string.Ajustes) -> { fm.popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE) addFragment(AjustesFragment.newInstance(),R.id.main_frame_layout, AjustesFragment.TAG,false) } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/adapter/PasillerosAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/adapter/PasillerosAdapter.kt index fea89719..0cc79721 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/adapter/PasillerosAdapter.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/adapter/PasillerosAdapter.kt @@ -1,5 +1,6 @@ package es.verdnatura.presentation.view.feature.pasillero.adapter +import android.content.Context import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView @@ -12,8 +13,9 @@ class PasillerosAdapter ( private val onPasillerosItemClickListener: OnPasillerosItemClickListener ): RecyclerView.Adapter () { - + var context : Context? = null override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PasillerosItemHolder { + this.context = parent.context return PasillerosItemHolder( ItemPasillerosMainMenuBinding.inflate(LayoutInflater.from(parent.context),parent,false) ) @@ -30,12 +32,13 @@ class PasillerosAdapter ( } - class PasillerosItemHolder( + inner class PasillerosItemHolder( val binding: ItemPasillerosMainMenuBinding ) : RecyclerView.ViewHolder(binding.root){ fun bind(item: PasillerosItemVO) { binding.apply { this.item = item + this.title = context?.getString(item.titleToShow) itemImage.setImageResource(item.iconResource) } } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt index ebfe63c6..881d2c05 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt @@ -1,6 +1,7 @@ package es.verdnatura.presentation.view.feature.pasillero.fragment +import android.app.Application import es.verdnatura.R import es.verdnatura.presentation.base.BaseViewModel import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO @@ -16,51 +17,53 @@ class PasilleroViewModel : BaseViewModel() { _pasillerositem.add( PasillerosItemVO(7, R.drawable.ic_streetview_black_24dp, - "Pre Sacador") + "Pre Sacador",R.string.PreSacador) ) _pasillerositem.add( PasillerosItemVO(0, R.drawable.ic_loyalty_black_24dp, - "Consultar artículo") + "Consultar artículo",R.string.ConsultarArticulo) ) _pasillerositem.add( PasillerosItemVO(6, R.drawable.ic_local_parking_orange_24dp, - "Parking") + "Parking",R.string.Parking) ) _pasillerositem.add( PasillerosItemVO(2, R.drawable.ic_visibility_black_24dp, - "Buscar item") + "Buscar item",R.string.BuscarItem) ) _pasillerositem.add( PasillerosItemVO(1, R.drawable.ic_dashboard_black_24dp, - "Ubicador") + "Ubicador",R.string.Ubicador) ) _pasillerositem.add( PasillerosItemVO(3, R.drawable.ic_spa_black_24dp, - "Inventario") + "Inventario",R.string.Inventario) ) _pasillerositem.add( PasillerosItemVO(4, R.drawable.ic_move_to_inbox_black_24dp, - "Faltas") + "Faltas",R.string.Faltas) ) _pasillerositem.add( PasillerosItemVO(5, R.drawable.ic_send_black_24dp, - "Shelving Parking") + "Shelving Parking",R.string.ShelvingParking) ) } + + } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/model/PasillerosItemVO.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/model/PasillerosItemVO.kt index e5d85f1c..3cd9f0a0 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/model/PasillerosItemVO.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/model/PasillerosItemVO.kt @@ -3,5 +3,6 @@ package es.verdnatura.presentation.view.feature.pasillero.model class PasillerosItemVO ( var id: Int = 0, var iconResource: Int = 0, - val title: String = "" + val title: String = "", + val titleToShow:Int = 0 ) \ No newline at end of file diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt index fddfc0dc..e7f34bc1 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt @@ -138,6 +138,19 @@ class UbicadorFragment( return@setOnEditorActionListener false } + edit_prioridad.setOnEditorActionListener { v, actionId, event -> + if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) { + if (!edit_prioridad.text.toString().isNullOrEmpty()){ + viewModel.shelvingPriorityUpdate(user,password,edit_prioridad.text.toString(),shelvingFk) + } + + (activity as MainActivity).hideKeyboard(edit_prioridad) + return@setOnEditorActionListener true + } + + return@setOnEditorActionListener false + } + automatic_img.setOnClickListener { if (!shelvingFk.isNullOrEmpty()) @@ -234,6 +247,8 @@ class UbicadorFragment( } etiquetas = contEtiquetas.toString() toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas + if(it.list.size > 0) + edit_prioridad.setText(it.list[0].priority) splash_progress.visibility = View.GONE adapter = UbicadorAdapter(listItems,onPasillerosItemClickListener = pasillerosItemClickListener!!, onVisibleClickListener = object: OnVisibleClickListener{ diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt index 5bb26069..7aa96ba8 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt @@ -57,6 +57,24 @@ class UbicadorViewModel : BaseViewModel() { }) } + fun shelvingPriorityUpdate(usuario:String,password:String,priority:String,shelving:String){ + getUbicadorUserCase.shelvingPriorityUpdate(usuario,password,priority,shelving).enqueue(object : Callback{ + override fun onFailure(call: Call, t: Throwable) { + _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada shelvingPriorityUpdate") + } + + override fun onResponse(call: Call, response: Response) { + if (response.body() == null){ + _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada shelvingPriorityUpdate") + }else{ + _response.value = ResponseItemVO(isError = false,response = response.body()!!) + } + + } + + }) + } + fun itemShelvingMake(usuario:String,password:String,shelving:String,item:String,deep:String,quantity:String,packing:String,warehouse:String,level:String){ getUbicadorUserCase.itemShelvingMake(usuario,password,shelving,item,deep,quantity,packing,warehouse,level).enqueue(object : Callback{ diff --git a/app/src/main/res/layout/component_custom_edit_dialog.xml b/app/src/main/res/layout/component_custom_edit_dialog.xml index 5b0f575b..d78e3d37 100644 --- a/app/src/main/res/layout/component_custom_edit_dialog.xml +++ b/app/src/main/res/layout/component_custom_edit_dialog.xml @@ -51,7 +51,7 @@ style="@style/InputLineTextSearch" android:layout_width="match_parent" android:backgroundTint="@android:color/white" - android:hint="Nuevo valor" + android:hint="@string/Nuevovalor" android:inputType="text" android:lines="1" android:maxLines="1" diff --git a/app/src/main/res/layout/component_custom_hour.xml b/app/src/main/res/layout/component_custom_hour.xml index 4eca420d..1054f413 100644 --- a/app/src/main/res/layout/component_custom_hour.xml +++ b/app/src/main/res/layout/component_custom_hour.xml @@ -57,7 +57,7 @@ style="@style/InputLineTextSearch" android:layout_width="match_parent" android:backgroundTint="@android:color/white" - android:hint="Hora" + android:hint="@string/Hora" android:inputType="text" android:lines="1" android:maxLines="1" @@ -94,7 +94,7 @@ style="@style/InputLineTextSearch" android:layout_width="match_parent" android:backgroundTint="@android:color/white" - android:hint="Destino" + android:hint="@string/Destino" android:inputType="text" android:lines="1" android:maxLines="1" diff --git a/app/src/main/res/layout/component_custom_three_dialog.xml b/app/src/main/res/layout/component_custom_three_dialog.xml index 5654df03..d2a5a832 100644 --- a/app/src/main/res/layout/component_custom_three_dialog.xml +++ b/app/src/main/res/layout/component_custom_three_dialog.xml @@ -51,7 +51,7 @@ style="@style/InputLineTextSearch" android:layout_width="match_parent" android:backgroundTint="@android:color/white" - android:hint="Nueva cantidad" + android:hint="@string/Nuevacantidad" android:inputType="number" android:lines="1" android:maxLines="1" diff --git a/app/src/main/res/layout/component_custom_ubicador_dialog.xml b/app/src/main/res/layout/component_custom_ubicador_dialog.xml index 52d205b9..9fa0ef61 100644 --- a/app/src/main/res/layout/component_custom_ubicador_dialog.xml +++ b/app/src/main/res/layout/component_custom_ubicador_dialog.xml @@ -87,7 +87,7 @@ style="@style/InputLineTextSearch" android:layout_width="match_parent" android:backgroundTint="@android:color/white" - android:hint="Etiquetas" + android:hint="@string/Etiquetas" android:inputType="number" android:lines="1" android:maxLines="1" @@ -108,7 +108,7 @@ style="@style/InputLineTextSearch" android:layout_width="match_parent" android:backgroundTint="@android:color/white" - android:hint="Visible" + android:hint="@string/Visible" android:inputType="number" android:lines="1" android:maxLines="1" diff --git a/app/src/main/res/layout/fragment_ajustes.xml b/app/src/main/res/layout/fragment_ajustes.xml index fdcacb22..a8611206 100644 --- a/app/src/main/res/layout/fragment_ajustes.xml +++ b/app/src/main/res/layout/fragment_ajustes.xml @@ -35,11 +35,11 @@ + android:layout_marginRight="@dimen/default_layout_margin" /> @@ -42,7 +42,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" - android:text="Rutas" + android:text="@string/Ruta" android:textColor="@color/verdnatura_white" android:textSize="@dimen/body2" /> diff --git a/app/src/main/res/layout/fragment_expedition_pallet_detail.xml b/app/src/main/res/layout/fragment_expedition_pallet_detail.xml index a39fb156..df817394 100644 --- a/app/src/main/res/layout/fragment_expedition_pallet_detail.xml +++ b/app/src/main/res/layout/fragment_expedition_pallet_detail.xml @@ -31,7 +31,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="@color/verdnatura_pumpkin_orange" - android:text="Pallet: " + android:text="@string/Pallet" android:gravity="center" android:textSize="@dimen/h6"/> @@ -52,7 +52,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" - android:text="Ruta" + android:text="@string/Ruta" android:textColor="@color/verdnatura_white" android:textSize="@dimen/body2" /> @@ -61,7 +61,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" - android:text="Cajas" + android:text="@string/Cajas" android:textColor="@color/verdnatura_white" android:textSize="@dimen/body2" /> diff --git a/app/src/main/res/layout/fragment_expedition_scan.xml b/app/src/main/res/layout/fragment_expedition_scan.xml index 7ee7d9fd..7de6699b 100644 --- a/app/src/main/res/layout/fragment_expedition_scan.xml +++ b/app/src/main/res/layout/fragment_expedition_scan.xml @@ -54,7 +54,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" - android:text="Ruta" + android:text="@string/Ruta" android:textColor="@color/verdnatura_white" android:textSize="@dimen/body2" /> @@ -63,7 +63,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" - android:text="Ticket" + android:text="@string/Ticket" android:textColor="@color/verdnatura_white" android:textSize="@dimen/body2" /> @@ -72,7 +72,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" - android:text="Caja" + android:text="@string/Cajas" android:textColor="@color/verdnatura_white" android:textSize="@dimen/body2" /> diff --git a/app/src/main/res/layout/fragment_expedition_truck_list.xml b/app/src/main/res/layout/fragment_expedition_truck_list.xml index 21acc6a0..8d71acd8 100644 --- a/app/src/main/res/layout/fragment_expedition_truck_list.xml +++ b/app/src/main/res/layout/fragment_expedition_truck_list.xml @@ -42,7 +42,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" - android:text="Destino" + android:text="@string/Destino" android:textColor="@color/verdnatura_white" android:textSize="@dimen/body2" /> diff --git a/app/src/main/res/layout/fragment_faltas.xml b/app/src/main/res/layout/fragment_faltas.xml index 13587285..485634d8 100644 --- a/app/src/main/res/layout/fragment_faltas.xml +++ b/app/src/main/res/layout/fragment_faltas.xml @@ -35,7 +35,7 @@ style="@style/InputLineTextSearch" android:layout_width="match_parent" android:backgroundTint="@android:color/white" - android:hint="Filtro" + android:hint="@string/Filtro" android:inputType="number" android:lines="1" android:maxLines="1" @@ -70,7 +70,7 @@ + android:textStyle="bold" + android:layout_marginEnd="@dimen/layout_margin_min"/> + android:textStyle="bold" + android:layout_marginEnd="@dimen/layout_margin_min"/> + android:textStyle="bold" + android:layout_marginEnd="@dimen/layout_margin_min"/> + android:textStyle="bold" + android:layout_marginEnd="@dimen/layout_margin_min"/> @@ -50,7 +50,7 @@ android:layout_weight="1" android:background="@color/verdnatura_white" android:ems="10" - android:hint="etiqueta" + android:hint="@string/Etiquetas" android:inputType="number" android:padding="8dp" /> @@ -63,7 +63,7 @@ android:layout_weight="1" android:background="@color/verdnatura_white" android:ems="10" - android:hint="cantidad" + android:hint="@string/cantidad" android:inputType="number" android:padding="8dp" /> @@ -73,7 +73,7 @@ android:id="@+id/textView19" android:layout_width="match_parent" android:layout_height="wrap_content" - android:text="Carro de origen:" + android:text="@string/carrodeorigen" android:textColor="@color/verdnatura_white" android:textSize="18sp" /> @@ -87,14 +87,14 @@ android:padding="8dp" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" - android:hint="carro de origen"/> + android:hint="@string/carrodeorigen"/> @@ -107,14 +107,14 @@ android:background="@color/verdnatura_white" android:padding="8dp" android:layout_marginTop="10dp" - android:hint="carro destino"/> + android:hint="@string/Carrodestino"/>