From e18125420beb462db90d5ef561d01440f9e532bf Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Tue, 10 Sep 2024 07:14:54 +0200 Subject: [PATCH] feat: refactorResponse PasillerosItem refs #7827 --- .../pasillero/adapter/PasillerosAdapter.kt | 100 ++--- .../pasillero/fragment/PasilleroFragment.kt | 8 +- .../pasillero/fragment/PasilleroViewModel.kt | 397 ++++-------------- .../pasillero/model/PasillerosItemVO.kt | 16 +- 4 files changed, 109 insertions(+), 412 deletions(-) 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 dc7d2234..0f9eb855 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,6 +1,5 @@ package es.verdnatura.presentation.view.feature.pasillero.adapter -import android.content.Context import android.os.Build import android.view.LayoutInflater import android.view.ViewGroup @@ -15,96 +14,53 @@ import es.verdnatura.domain.toast import es.verdnatura.presentation.common.OnPasillerosItemClickListener import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO -class PasillerosAdapter ( +class PasillerosAdapter( private val items: List, private val onPasillerosItemClickListener: OnPasillerosItemClickListener, - private val isMenuInit:Boolean + private val isMenuInit: Boolean +) : RecyclerView.Adapter() { -): RecyclerView.Adapter () { - - var context : Context? = null override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PasillerosItemHolder { - this.context = parent.context - - - val binding: ViewDataBinding = DataBindingUtil.inflate( - LayoutInflater.from(parent.context), - viewType, - parent, - false) - - - - return if (isMenuInit){ - PasillerosItemHolder(binding as ItemMainMenuBinding) - }else{ - PasillerosItemHolder(binding as ItemPasillerosMainMenuBinding) - } - + val layoutInflater = LayoutInflater.from(parent.context) + val binding: ViewDataBinding = + DataBindingUtil.inflate(layoutInflater, viewType, parent, false) + return PasillerosItemHolder(binding) } - override fun getItemViewType(position: Int): Int { - if (isMenuInit) return R.layout.item_main_menu - else{ - return R.layout.item_pasilleros_main_menu - } + override fun getItemViewType(position: Int) = + if (isMenuInit) R.layout.item_main_menu else R.layout.item_pasilleros_main_menu - // return super.getItemViewType(position) - - } - - override fun getItemCount() =items.size + override fun getItemCount() = items.size override fun onBindViewHolder(holder: PasillerosItemHolder, position: Int) { holder.bind(items[position]) holder.binding.root.setOnClickListener { - onPasillerosItemClickListener.onPasillerosItemClickListener(items[position],"") + onPasillerosItemClickListener.onPasillerosItemClickListener(items[position], "") } - } - - inner class PasillerosItemHolder( - val binding: ViewDataBinding - - ) : RecyclerView.ViewHolder(binding.root){ - - + inner class PasillerosItemHolder(val binding: ViewDataBinding) : + RecyclerView.ViewHolder(binding.root) { fun bind(item: PasillerosItemVO) { + binding.setVariable(BR.item, item) + binding.setVariable(BR.title, binding.root.context.getString(item.title!!)) - binding.setVariable(BR.item,item) - binding.setVariable(BR.title, item.title) - - - if (isMenuInit) - { - - try { - (binding as ItemMainMenuBinding).itemImage.setImageResource(item.iconResource) - }catch(exception:Exception){ - exception.toast(context) - } - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - (binding as ItemMainMenuBinding).itemImage.tooltipText=item.description - } - - } - else{ - - try { - (binding as ItemPasillerosMainMenuBinding).itemImage.setImageResource(item.iconResource) - }catch(exception:Exception){ - exception.toast(context) - } - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - (binding as ItemPasillerosMainMenuBinding).itemImage.tooltipText=item.description - } - + val itemImage = if (isMenuInit) { + (binding as ItemMainMenuBinding).itemImage + } else { + (binding as ItemPasillerosMainMenuBinding).itemImage } + try { + itemImage.setImageResource(item.iconResource) + } catch (exception: Exception) { + exception.toast(binding.root.context) + } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + itemImage.tooltipText = binding.root.context.getString(item.description!!) + } } } } \ No newline at end of file diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroFragment.kt index 52e79c63..85aa0f39 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroFragment.kt @@ -106,8 +106,8 @@ class PasilleroFragment( viewModel.inititializeDefaultDataInit( PasillerosItemVO( R.drawable.photo_camera, - requireContext().getString(R.string.titlePhotos), - requireContext().getString(R.string.titlePhotos) + R.string.titlePhotos, + R.string.titlePhotos ) ) } @@ -116,10 +116,8 @@ class PasilleroFragment( viewModel.inititializeDefaultDataInit( PasillerosItemVO( R.drawable.ic_picker_ui, - requireContext().getString(R.string.titlePickers), - requireContext().getString( + R.string.titlePickers, R.string.titlePickersDescrip - ) ) ) 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 677dadb9..7378e38e 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 @@ -32,13 +32,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { workerActivityAdd(CodeWorkerAction.STORAGE) _pasillerositem.add( PasillerosItemVO( - 0, - R.drawable.ic_item, - contextApp.getString(R.string.titleItemConsult), - R.string.titleItemConsult, - contextApp.getString( - R.string.titleItemConsultDescrip - ) + R.drawable.ic_item, R.string.titleItemConsult, R.string.titleItemConsultDescrip ) ) @@ -48,70 +42,53 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { PasillerosItemVO( 6, R.drawable.ic_local_parking_orange_24dp, - contextApp.getString(R.string.Parking), + R.string.Parking), R.string.Parking, - contextApp.getString(R.string.titleParkingDescrip) + R.string.titleParkingDescrip) ) ) */ _pasillerositem.add( PasillerosItemVO( - 2, R.drawable.ic_visibility_black_24dp, - contextApp.getString(R.string.titleItemSearch), R.string.titleItemSearch, - contextApp.getString( - R.string.titleItemSearchDescrip - ) + R.string.titleItemSearchDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 1, R.drawable.ic_dashboard_black_24dp, - contextApp.getString(R.string.titleUbicator), R.string.titleUbicator, - contextApp.getString( - R.string.titleUbicatorDescrip - ) + R.string.titleUbicatorDescrip + ) ) //tarea 7855 - /* _pasillerositem.add( - PasillerosItemVO( - 1, - R.drawable.ic_scan_prepared, - contextApp.getString(R.string.scanPreparedExpedition), - R.string.scanPreparedExpedition, - contextApp.getString(R.string.scanPreparedExpedition) - ) - )*/ + /* _pasillerositem.add( + PasillerosItemVO( + R.drawable.ic_scan_prepared, + R.string.scanPreparedExpedition), + R.string.scanPreparedExpedition) + ) + )*/ _pasillerositem.add( PasillerosItemVO( - 3, R.drawable.ic_spa_black_24dp, - contextApp.getString(R.string.titleInventory), R.string.titleInventory, - contextApp.getString( - R.string.titleInventoryDescrip - ) + R.string.titleInventoryDescrip ) ) //Tarea 5891 _pasillerositem.add( PasillerosItemVO( - 3, R.drawable.ic_inventory_parking, - contextApp.getString(R.string.titleInventoryParking), R.string.titleInventoryParking, - contextApp.getString( - R.string.titleInventoryParkingDescrip - ) + R.string.titleInventoryParkingDescrip ) ) @@ -119,9 +96,9 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { PasillerosItemVO( 100, R.drawable.ic_category, - contextApp.getString(R.string.titleChangeCategory), + R.string.titleChangeCategory), R.string.titleChangeCategory, - contextApp.getString( + R.string.titleChangeCategory ) ) @@ -129,49 +106,27 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { _pasillerositem.add( PasillerosItemVO( - 7, R.drawable.worker_mistake, - contextApp.getString(R.string.titleWorkerMistake), R.string.titleWorkerMistake, - contextApp.getString( - R.string.titleWorkerMistakeDescrip - ) + R.string.titleWorkerMistakeDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 41, - R.drawable.ic_historical_menu, - contextApp.getString(R.string.historicals), - R.string.historicals, - contextApp.getString( - R.string.historicalsDescrip - ) + R.drawable.ic_historical_menu, R.string.historicals, R.string.historicalsDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 41, - R.drawable.day_of_sale, - contextApp.getString(R.string.titleDayOfSale), - R.string.titleDayOfSale, - contextApp.getString( - R.string.titleDayDescrip - ) + R.drawable.day_of_sale, R.string.titleDayOfSale, R.string.titleDayDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 1, - R.drawable.ic_shopping_self, - contextApp.getString(R.string.selfConsumption), - R.string.titleSelfConsumption, - contextApp.getString( - R.string.titleSelfConsumption - ) + R.drawable.ic_shopping_self, R.string.selfConsumption, R.string.titleSelfConsumption ) ) @@ -181,81 +136,52 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { workerActivityAdd(CodeWorkerAction.PALLETIZING) _pasillerositem.add( PasillerosItemVO( - 30, R.drawable.pallet_shipping_selected, - contextApp.getString(R.string.titlePalletizar), R.string.titlePalletizar, - contextApp.getString( - R.string.titlePalletDescrip - ) + R.string.titlePalletDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 30, R.drawable.ic_pallet_scan_expedition, - contextApp.getString(R.string.titleScanPalletizar), R.string.titleScanPalletizar, - contextApp.getString( - R.string.titleScanPalletDescrip - ) + R.string.titleScanPalletDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 30, - R.drawable.lift, - contextApp.getString(R.string.scanPlatform), - R.string.scanPlatform, - contextApp.getString( - R.string.titleScanPlatform - ) + R.drawable.lift, R.string.scanPlatform, R.string.titleScanPlatform ) ) _pasillerositem.add( PasillerosItemVO( - 50, R.drawable.ic_expedition, - contextApp.getString(R.string.titleExpeditionState), R.string.titleExpeditionState, - contextApp.getString(R.string.titleExpeditionDescrip) + R.string.titleExpeditionDescrip ) + ) _pasillerositem.add( PasillerosItemVO( - 31, - R.drawable.ic_cmr, - contextApp.getString(R.string.titleCMRState), - R.string.titleCMRState, - contextApp.getString(R.string.titleCMRDescrip) + R.drawable.ic_cmr, R.string.titleCMRState, R.string.titleCMRDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 40, - R.drawable.barcode_scan, - contextApp.getString(R.string.titleExpeditionScan), - R.string.titleExpeditionScan, - contextApp.getString( - R.string.titleExpScanDescrip - ) + R.drawable.barcode_scan, R.string.titleExpeditionScan, R.string.titleExpScanDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 32, R.drawable.buffer_outline, - contextApp.getString(R.string.titleBufferManegement), R.string.titleBufferManegement, - contextApp.getString( - R.string.titleBufferMangDescrip - ) + R.string.titleBufferMangDescrip ) ) @@ -263,9 +189,9 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { PasillerosItemVO( 33, R.drawable.qrcode_scan, - contextApp.getString(R.string.titleQrReader), + R.string.titleQrReader), R.string.titleQrReader, - contextApp.getString(R.string.titleQrDescrip) + R.string.titleQrDescrip) ) )*/ @@ -275,76 +201,44 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { _pasillerositem.add( PasillerosItemVO( - 30, - R.drawable.buffer_empty, - contextApp.getString(R.string.titleBufferEmpty), - R.string.titleBufferEmpty, - contextApp.getString( - R.string.titleBufferEmptyDescrip - ) + R.drawable.buffer_empty, R.string.titleBufferEmpty, R.string.titleBufferEmptyDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 31, - R.drawable.buffer_fill, - contextApp.getString(R.string.titleBufferFill), - R.string.titleBufferFill, - contextApp.getString( - R.string.titleBufferFillDescrip - ) + R.drawable.buffer_fill, R.string.titleBufferFill, R.string.titleBufferFillDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 32, R.drawable.buffer_accumulation, - contextApp.getString(R.string.titleBufferAccumulate), R.string.titleBufferAccumulate, - contextApp.getString( - R.string.titleBufferAccDescrip - ) + R.string.titleBufferAccDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 31, - R.drawable.buffer_off, - contextApp.getString(R.string.titleBufferOff), - R.string.titleBufferOff, - contextApp.getString( - R.string.titleBufferOffDescrip - ) + R.drawable.buffer_off, R.string.titleBufferOff, R.string.titleBufferOffDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 31, R.drawable.buffer_flejado, - contextApp.getString(R.string.titleBufferStrapping), R.string.titleBufferStrapping, - contextApp.getString( - R.string.titleBufferStrapDescrip - ) + R.string.titleBufferStrapDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 45, - R.drawable.buffer_load, - contextApp.getString(R.string.titleBufferload), - R.string.titleBufferload, - contextApp.getString( - R.string.titleBufferLoadDescrip - ) + R.drawable.buffer_load, R.string.titleBufferload, R.string.titleBufferLoadDescrip ) ) } @@ -357,33 +251,24 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { } else { _pasillerositem.add( PasillerosItemVO( - 30, R.drawable.ic_previous_menu, - contextApp.getString(R.string.titlePrevious), R.string.titlePrevious, - contextApp.getString(R.string.titlePreviousDescription) + R.string.titlePreviousDescription ) ) _pasillerositem.add( PasillerosItemVO( - 7, R.drawable.ic_corridor_ui, - contextApp.getString(R.string.titleCorridors), R.string.titleCorridors, - contextApp.getString(R.string.titleCorridorsDescrip) + R.string.titleCorridorsDescrip ) ) //precontrol _pasillerositem.add( PasillerosItemVO( - 7, - R.drawable.ic_picker_ui, - contextApp.getString(R.string.titlePickers), - R.string.titlePickers, - contextApp.getString( - R.string.titlePickersDescrip - ) + R.drawable.ic_picker_ui, R.string.titlePickers, R.string.titlePickersDescrip + ) ) //val working_in_testMenu = false @@ -391,23 +276,15 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { if (userId == 19591) { _pasillerositem.add( PasillerosItemVO( - 7, - R.drawable.ic_picker_ui, - contextApp.getString(R.string.sacador_test), - R.string.sacador_test, - contextApp.getString( - R.string.sacador_test - ) + R.drawable.ic_picker_ui, R.string.sacador_test, R.string.sacador_test ) ) if (userId == 19591) { _pasillerositem.add( PasillerosItemVO( - 7, R.drawable.ic_picker_helper, - contextApp.getString(R.string.pickerHelper), R.string.pickerHelper, - contextApp.getString(R.string.pickerHelperDescrip) + R.string.pickerHelperDescrip ) ) } @@ -415,57 +292,39 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { _pasillerositem.add( PasillerosItemVO( - 10, R.drawable.ic_controller_ui, - contextApp.getString(R.string.titleControllers), R.string.titleControllers, - contextApp.getString( - R.string.titleControlDescrip - ) + R.string.titleControlDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 0, R.drawable.ic_pallet_ui, - contextApp.getString(R.string.titlePalletizers), R.string.titlePalletizers, - contextApp.getString( - R.string.titlePalletizDescrip - ) + R.string.titlePalletizDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 6, - R.drawable.ic_claim_ui, - contextApp.getString(R.string.titleClaims), - R.string.titleClaims, - contextApp.getString(R.string.titleClaimsDescrip) + R.drawable.ic_claim_ui, R.string.titleClaims, R.string.titleClaimsDescrip ) ) //Tarea 4678 _pasillerositem.add( PasillerosItemVO( - 6, - R.drawable.ic_delivery_truck, - contextApp.getString(R.string.titleDelivery), - R.string.titleDelivery, - contextApp.getString(R.string.titleDelivery) + R.drawable.ic_delivery_truck, R.string.titleDelivery, R.string.titleDelivery ) ) _pasillerositem.add( PasillerosItemVO( - 6, R.drawable.ic_troncales, - contextApp.getString(R.string.titleDeliveryTruck), R.string.titleDeliveryTruck, - contextApp.getString(R.string.titleDeliveryTruck) + R.string.titleDeliveryTruck ) ) @@ -473,30 +332,20 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { _pasillerositem.add( PasillerosItemVO( - 6, R.drawable.ic_packaging_entries, - contextApp.getString(R.string.titlePackaging), R.string.titlePackaging, - contextApp.getString(R.string.titlePackagingDescrip) + R.string.titlePackagingDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 6, - R.drawable.photo_camera, - contextApp.getString(R.string.titlePhotos), - R.string.titlePhotos, - contextApp.getString(R.string.titlePhotos) + R.drawable.photo_camera, R.string.titlePhotos, R.string.titlePhotos ) ) _pasillerositem.add( PasillerosItemVO( - 50, - R.drawable.ic_other, - contextApp.getString(R.string.titleOther), - R.string.titleOther, - contextApp.getString(R.string.titleOther) + R.drawable.ic_other, R.string.titleOther, R.string.titleOther ) ) @@ -504,11 +353,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { if (workingInTest) { _pasillerositem.add( PasillerosItemVO( - 6, - R.drawable.ic_star_ko, - contextApp.getString(R.string.testing), - R.string.testing, - contextApp.getString(R.string.testing) + R.drawable.ic_star_ko, R.string.testing, R.string.testing ) ) } @@ -519,26 +364,14 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { workerActivityAdd(CodeWorkerAction.CLAIM) _pasillerositem.add( PasillerosItemVO( - 30, - R.drawable.ic_claims, - contextApp.getString(R.string.titleClaimUbication), - R.string.titleClaimUbication, - contextApp.getString( - R.string.titleClaimDescrip - ) + R.drawable.ic_claims, R.string.titleClaimUbication, R.string.titleClaimDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 1, - R.drawable.ic_reubication, - contextApp.getString(R.string.titleReUbicator), - R.string.titleReUbicator, - contextApp.getString( - R.string.titleReubicatorDescrip - ) + R.drawable.ic_reubication, R.string.titleReUbicator, R.string.titleReubicatorDescrip ) ) @@ -547,11 +380,9 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { fun inititializeDefaultDelivery() { _pasillerositem.add( PasillerosItemVO( - 6, R.drawable.ic_delivery_truck, - contextApp.getString(R.string.titleDeliveryRoute), R.string.titleDeliveryRoute, - contextApp.getString(R.string.titleDeliveryRoute) + R.string.titleDeliveryRoute ) ) @@ -561,11 +392,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { _pasillerositem.add( PasillerosItemVO( - 6, - R.drawable.ic_troncales, - contextApp.getString(R.string.titleDeliveryTruck), - R.string.titleDeliveryTruck, - contextApp.getString(R.string.titleDeliveryTruck) + R.drawable.ic_troncales, R.string.titleDeliveryTruck, R.string.titleDeliveryTruck ) ) @@ -578,26 +405,18 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { // if (userId == 19591 || userId == 18404 || userId == 9) { _pasillerositem.add( PasillerosItemVO( - 7, R.drawable.ic_previous_presacador, - contextApp.getString(R.string.titlePrePickerTest), R.string.titlePrePickerTest, - contextApp.getString( - R.string.titlePickerDescrip - ) + R.string.titlePickerDescrip ) ) //} } else { _pasillerositem.add( PasillerosItemVO( - 7, R.drawable.ic_previous_presacador, - contextApp.getString(R.string.titlePrePicker), R.string.titlePrePicker, - contextApp.getString( - R.string.titlePickerDescrip - ) + R.string.titlePickerDescrip ) ) } @@ -605,39 +424,25 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { _pasillerositem.add( PasillerosItemVO( - 7, - R.drawable.ic_previous_precontrol, - contextApp.getString(R.string.titlePreControl), - R.string.titlePreControl, - contextApp.getString( - R.string.titlePreControlDescrip - ) + R.drawable.ic_previous_precontrol, R.string.titlePreControl, + + R.string.titlePreControlDescrip ) ) if (userId == 19591) { _pasillerositem.add( PasillerosItemVO( - 7, R.drawable.ic_previous_precontrol, - contextApp.getString(R.string.titlePreControlTest), R.string.titlePreControlTest, - contextApp.getString( - R.string.titlePreControlDescrip - ) + R.string.titlePreControlDescrip ) ) } _pasillerositem.add( PasillerosItemVO( - 10, - R.drawable.ic_ticket, - contextApp.getString(R.string.titleShowTicket), - R.string.titleShowTicket, - contextApp.getString( - R.string.titleShowTicketDescrip - ) + R.drawable.ic_ticket, R.string.titleShowTicket, R.string.titleShowTicketDescrip ) ) @@ -647,37 +452,23 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { workerActivityAdd(CodeWorkerAction.ON_CHECKING) _pasillerositem.add( PasillerosItemVO( - 7, R.drawable.ic_verified_user_black_24dp_selected, - contextApp.getString(R.string.titleControllersAction), R.string.titleControllersAction, - contextApp.getString( - R.string.titleCheckerDescrip - ) + R.string.titleCheckerDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 1, R.drawable.ic_review_boxpicking, - contextApp.getString(R.string.reviewBoxPicking), R.string.reviewBoxPicking, - contextApp.getString( - R.string.reviewBoxPicking - ) + R.string.reviewBoxPicking ) ) _pasillerositem.add( PasillerosItemVO( - 1, - R.drawable.ic_advance_ticket, - contextApp.getString(R.string.ticketAdvance), - R.string.ticketAdvance, - contextApp.getString( - R.string.ticketAdvanceDescrip - ) + R.drawable.ic_advance_ticket, R.string.ticketAdvance, R.string.ticketAdvanceDescrip ) ) @@ -686,13 +477,9 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { _pasillerositem.add( PasillerosItemVO( - 7, R.drawable.ic_packing_mistake, - contextApp.getString(R.string.titlePackingMistake), R.string.titlePackingMistake, - contextApp.getString( - R.string.titlePackingMistakeDescrip - ) + R.string.titlePackingMistakeDescrip ) ) @@ -702,13 +489,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { _pasillerositem.add( PasillerosItemVO( - 1, - R.drawable.ic_packaging, - contextApp.getString(R.string.titlePackingHolland), - R.string.titlePackingHolland, - contextApp.getString( - R.string.titleUbicatorDescrip - ) + R.drawable.ic_packaging, R.string.titlePackingHolland, R.string.titleUbicatorDescrip ) ) @@ -717,49 +498,33 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { fun inititializeDefaultHistorical() { _pasillerositem.add( PasillerosItemVO( - 10, R.drawable.revision_icon, - contextApp.getString(R.string.titleShelvingHistorical), R.string.titleShelvingHistorical, - contextApp.getString( - R.string.titleShelvingHistDescrip - ) + R.string.titleShelvingHistDescrip ) ) _pasillerositem.add( PasillerosItemVO( - 7, R.drawable.ic_history_orange, - contextApp.getString(R.string.titleLogShelving), R.string.titleLogShelving, - contextApp.getString( - R.string.titleLogShelvingDescrip - ) + R.string.titleLogShelvingDescrip ) ) //Tarea 5186 _pasillerositem.add( PasillerosItemVO( - 7, R.drawable.ic_parking_previa, - contextApp.getString(R.string.titleParkingTicketPrevia), R.string.titleParkingTicketPrevia, - contextApp.getString( - R.string.titleParkingTicketPrevia - ) + R.string.titleParkingTicketPrevia ) ) _pasillerositem.add( PasillerosItemVO( - 22, R.drawable.car_info, - contextApp.getString(R.string.titleHistoricalVehicle), R.string.titleHistoricalVehicle, - contextApp.getString( - R.string.titleHistVehicleDescrip - ) + R.string.titleHistVehicleDescrip ) ) @@ -769,24 +534,14 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { codeActivity: CodeWorkerAction ) { //Tarea 6078 - salix.workerActivityAdd(WorkerActionSalix(codeActivity.toString())) + salix.workerActivityAdd(WorkerActionSalix(codeActivity.toString())) - .enqueue(object : SalixCallback(contextApp) { - override fun onSuccess(response: Response) { - } - - }) - - } - - fun workerActivityList( - ) { - - salix.workerActivityList().enqueue(object : SalixCallback(contextApp) { + .enqueue(object : SalixCallback(contextApp) { override fun onSuccess(response: Response) { - _response.value = ResponseItemVO(isError = false, response = response.message()) } + }) + } } 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 49367859..3cab305f 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,12 +3,7 @@ package es.verdnatura.presentation.view.feature.pasillero.model import es.verdnatura.domain.ConstAndValues class PasillerosItemVO( - var id: Int = 0, - var iconResource: Int = 0, - val title: String = "", - val titleToShow: Int = 0, - val description: String = "" - + var iconResource: Int = 0, val title: Int? = null, val description: Int? = null ) data class WorkerActionSalix( @@ -16,13 +11,6 @@ data class WorkerActionSalix( ) enum class CodeWorkerAction { - CLAIM, - DELIVERY, - ON_CHECKING, - ON_PREPARATION, - PREVIOUS, - PALLETIZING, - STOP, - STORAGE + CLAIM, DELIVERY, ON_CHECKING, ON_PREPARATION, PREVIOUS, PALLETIZING, STOP, STORAGE } \ No newline at end of file