feat: refactorResponse PasillerosItem refs #7827

This commit is contained in:
Sergio De la torre 2024-09-10 07:14:54 +02:00
parent 8052477b7f
commit e18125420b
4 changed files with 109 additions and 412 deletions

View File

@ -1,6 +1,5 @@
package es.verdnatura.presentation.view.feature.pasillero.adapter package es.verdnatura.presentation.view.feature.pasillero.adapter
import android.content.Context
import android.os.Build import android.os.Build
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
@ -15,96 +14,53 @@ import es.verdnatura.domain.toast
import es.verdnatura.presentation.common.OnPasillerosItemClickListener import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
class PasillerosAdapter ( class PasillerosAdapter(
private val items: List<PasillerosItemVO>, private val items: List<PasillerosItemVO>,
private val onPasillerosItemClickListener: OnPasillerosItemClickListener, private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
private val isMenuInit:Boolean private val isMenuInit: Boolean
) : RecyclerView.Adapter<PasillerosAdapter.PasillerosItemHolder>() {
): RecyclerView.Adapter<PasillerosAdapter.PasillerosItemHolder> () {
var context : Context? = null
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PasillerosItemHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PasillerosItemHolder {
this.context = parent.context val layoutInflater = LayoutInflater.from(parent.context)
val binding: ViewDataBinding =
DataBindingUtil.inflate(layoutInflater, viewType, parent, false)
val binding: ViewDataBinding = DataBindingUtil.inflate( return PasillerosItemHolder(binding)
LayoutInflater.from(parent.context),
viewType,
parent,
false)
return if (isMenuInit){
PasillerosItemHolder(binding as ItemMainMenuBinding)
}else{
PasillerosItemHolder(binding as ItemPasillerosMainMenuBinding)
}
} }
override fun getItemViewType(position: Int): Int { override fun getItemViewType(position: Int) =
if (isMenuInit) return R.layout.item_main_menu if (isMenuInit) R.layout.item_main_menu else R.layout.item_pasilleros_main_menu
else{
return 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) { override fun onBindViewHolder(holder: PasillerosItemHolder, position: Int) {
holder.bind(items[position]) holder.bind(items[position])
holder.binding.root.setOnClickListener { holder.binding.root.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(items[position],"") onPasillerosItemClickListener.onPasillerosItemClickListener(items[position], "")
} }
} }
inner class PasillerosItemHolder(val binding: ViewDataBinding) :
inner class PasillerosItemHolder( RecyclerView.ViewHolder(binding.root) {
val binding: ViewDataBinding
) : RecyclerView.ViewHolder(binding.root){
fun bind(item: PasillerosItemVO) { fun bind(item: PasillerosItemVO) {
binding.setVariable(BR.item, item)
binding.setVariable(BR.title, binding.root.context.getString(item.title!!))
binding.setVariable(BR.item,item) val itemImage = if (isMenuInit) {
binding.setVariable(BR.title, item.title) (binding as ItemMainMenuBinding).itemImage
} else {
(binding as ItemPasillerosMainMenuBinding).itemImage
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
}
} }
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!!)
}
} }
} }
} }

View File

@ -106,8 +106,8 @@ class PasilleroFragment(
viewModel.inititializeDefaultDataInit( viewModel.inititializeDefaultDataInit(
PasillerosItemVO( PasillerosItemVO(
R.drawable.photo_camera, R.drawable.photo_camera,
requireContext().getString(R.string.titlePhotos), R.string.titlePhotos,
requireContext().getString(R.string.titlePhotos) R.string.titlePhotos
) )
) )
} }
@ -116,10 +116,8 @@ class PasilleroFragment(
viewModel.inititializeDefaultDataInit( viewModel.inititializeDefaultDataInit(
PasillerosItemVO( PasillerosItemVO(
R.drawable.ic_picker_ui, R.drawable.ic_picker_ui,
requireContext().getString(R.string.titlePickers), R.string.titlePickers,
requireContext().getString(
R.string.titlePickersDescrip R.string.titlePickersDescrip
)
) )
) )

View File

@ -32,13 +32,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
workerActivityAdd(CodeWorkerAction.STORAGE) workerActivityAdd(CodeWorkerAction.STORAGE)
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
0, R.drawable.ic_item, R.string.titleItemConsult, R.string.titleItemConsultDescrip
R.drawable.ic_item,
contextApp.getString(R.string.titleItemConsult),
R.string.titleItemConsult,
contextApp.getString(
R.string.titleItemConsultDescrip
)
) )
) )
@ -48,70 +42,53 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
PasillerosItemVO( PasillerosItemVO(
6, 6,
R.drawable.ic_local_parking_orange_24dp, R.drawable.ic_local_parking_orange_24dp,
contextApp.getString(R.string.Parking), R.string.Parking),
R.string.Parking, R.string.Parking,
contextApp.getString(R.string.titleParkingDescrip) R.string.titleParkingDescrip)
) )
) )
*/ */
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
2,
R.drawable.ic_visibility_black_24dp, R.drawable.ic_visibility_black_24dp,
contextApp.getString(R.string.titleItemSearch),
R.string.titleItemSearch, R.string.titleItemSearch,
contextApp.getString( R.string.titleItemSearchDescrip
R.string.titleItemSearchDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
1,
R.drawable.ic_dashboard_black_24dp, R.drawable.ic_dashboard_black_24dp,
contextApp.getString(R.string.titleUbicator),
R.string.titleUbicator, R.string.titleUbicator,
contextApp.getString( R.string.titleUbicatorDescrip
R.string.titleUbicatorDescrip
)
) )
) )
//tarea 7855 //tarea 7855
/* _pasillerositem.add( /* _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
1, R.drawable.ic_scan_prepared,
R.drawable.ic_scan_prepared, R.string.scanPreparedExpedition),
contextApp.getString(R.string.scanPreparedExpedition), R.string.scanPreparedExpedition)
R.string.scanPreparedExpedition, )
contextApp.getString(R.string.scanPreparedExpedition) )*/
)
)*/
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
3,
R.drawable.ic_spa_black_24dp, R.drawable.ic_spa_black_24dp,
contextApp.getString(R.string.titleInventory),
R.string.titleInventory, R.string.titleInventory,
contextApp.getString( R.string.titleInventoryDescrip
R.string.titleInventoryDescrip
)
) )
) )
//Tarea 5891 //Tarea 5891
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
3,
R.drawable.ic_inventory_parking, R.drawable.ic_inventory_parking,
contextApp.getString(R.string.titleInventoryParking),
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( PasillerosItemVO(
100, 100,
R.drawable.ic_category, R.drawable.ic_category,
contextApp.getString(R.string.titleChangeCategory), R.string.titleChangeCategory),
R.string.titleChangeCategory, R.string.titleChangeCategory,
contextApp.getString(
R.string.titleChangeCategory R.string.titleChangeCategory
) )
) )
@ -129,49 +106,27 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7,
R.drawable.worker_mistake, R.drawable.worker_mistake,
contextApp.getString(R.string.titleWorkerMistake),
R.string.titleWorkerMistake, R.string.titleWorkerMistake,
contextApp.getString( R.string.titleWorkerMistakeDescrip
R.string.titleWorkerMistakeDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
41, R.drawable.ic_historical_menu, R.string.historicals, R.string.historicalsDescrip
R.drawable.ic_historical_menu,
contextApp.getString(R.string.historicals),
R.string.historicals,
contextApp.getString(
R.string.historicalsDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
41, R.drawable.day_of_sale, R.string.titleDayOfSale, R.string.titleDayDescrip
R.drawable.day_of_sale,
contextApp.getString(R.string.titleDayOfSale),
R.string.titleDayOfSale,
contextApp.getString(
R.string.titleDayDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
1, R.drawable.ic_shopping_self, R.string.selfConsumption, R.string.titleSelfConsumption
R.drawable.ic_shopping_self,
contextApp.getString(R.string.selfConsumption),
R.string.titleSelfConsumption,
contextApp.getString(
R.string.titleSelfConsumption
)
) )
) )
@ -181,81 +136,52 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
workerActivityAdd(CodeWorkerAction.PALLETIZING) workerActivityAdd(CodeWorkerAction.PALLETIZING)
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
30,
R.drawable.pallet_shipping_selected, R.drawable.pallet_shipping_selected,
contextApp.getString(R.string.titlePalletizar),
R.string.titlePalletizar, R.string.titlePalletizar,
contextApp.getString( R.string.titlePalletDescrip
R.string.titlePalletDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
30,
R.drawable.ic_pallet_scan_expedition, R.drawable.ic_pallet_scan_expedition,
contextApp.getString(R.string.titleScanPalletizar),
R.string.titleScanPalletizar, R.string.titleScanPalletizar,
contextApp.getString( R.string.titleScanPalletDescrip
R.string.titleScanPalletDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
30, R.drawable.lift, R.string.scanPlatform, R.string.titleScanPlatform
R.drawable.lift,
contextApp.getString(R.string.scanPlatform),
R.string.scanPlatform,
contextApp.getString(
R.string.titleScanPlatform
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
50,
R.drawable.ic_expedition, R.drawable.ic_expedition,
contextApp.getString(R.string.titleExpeditionState),
R.string.titleExpeditionState, R.string.titleExpeditionState,
contextApp.getString(R.string.titleExpeditionDescrip) R.string.titleExpeditionDescrip
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
31, R.drawable.ic_cmr, R.string.titleCMRState, R.string.titleCMRDescrip
R.drawable.ic_cmr,
contextApp.getString(R.string.titleCMRState),
R.string.titleCMRState,
contextApp.getString(R.string.titleCMRDescrip)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
40, R.drawable.barcode_scan, R.string.titleExpeditionScan, R.string.titleExpScanDescrip
R.drawable.barcode_scan,
contextApp.getString(R.string.titleExpeditionScan),
R.string.titleExpeditionScan,
contextApp.getString(
R.string.titleExpScanDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
32,
R.drawable.buffer_outline, R.drawable.buffer_outline,
contextApp.getString(R.string.titleBufferManegement),
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( PasillerosItemVO(
33, 33,
R.drawable.qrcode_scan, R.drawable.qrcode_scan,
contextApp.getString(R.string.titleQrReader), 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( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
30, R.drawable.buffer_empty, R.string.titleBufferEmpty, R.string.titleBufferEmptyDescrip
R.drawable.buffer_empty,
contextApp.getString(R.string.titleBufferEmpty),
R.string.titleBufferEmpty,
contextApp.getString(
R.string.titleBufferEmptyDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
31, R.drawable.buffer_fill, R.string.titleBufferFill, R.string.titleBufferFillDescrip
R.drawable.buffer_fill,
contextApp.getString(R.string.titleBufferFill),
R.string.titleBufferFill,
contextApp.getString(
R.string.titleBufferFillDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
32,
R.drawable.buffer_accumulation, R.drawable.buffer_accumulation,
contextApp.getString(R.string.titleBufferAccumulate),
R.string.titleBufferAccumulate, R.string.titleBufferAccumulate,
contextApp.getString( R.string.titleBufferAccDescrip
R.string.titleBufferAccDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
31, R.drawable.buffer_off, R.string.titleBufferOff, R.string.titleBufferOffDescrip
R.drawable.buffer_off,
contextApp.getString(R.string.titleBufferOff),
R.string.titleBufferOff,
contextApp.getString(
R.string.titleBufferOffDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
31,
R.drawable.buffer_flejado, R.drawable.buffer_flejado,
contextApp.getString(R.string.titleBufferStrapping),
R.string.titleBufferStrapping, R.string.titleBufferStrapping,
contextApp.getString( R.string.titleBufferStrapDescrip
R.string.titleBufferStrapDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
45, R.drawable.buffer_load, R.string.titleBufferload, R.string.titleBufferLoadDescrip
R.drawable.buffer_load,
contextApp.getString(R.string.titleBufferload),
R.string.titleBufferload,
contextApp.getString(
R.string.titleBufferLoadDescrip
)
) )
) )
} }
@ -357,33 +251,24 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
} else { } else {
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
30,
R.drawable.ic_previous_menu, R.drawable.ic_previous_menu,
contextApp.getString(R.string.titlePrevious),
R.string.titlePrevious, R.string.titlePrevious,
contextApp.getString(R.string.titlePreviousDescription) R.string.titlePreviousDescription
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7,
R.drawable.ic_corridor_ui, R.drawable.ic_corridor_ui,
contextApp.getString(R.string.titleCorridors),
R.string.titleCorridors, R.string.titleCorridors,
contextApp.getString(R.string.titleCorridorsDescrip) R.string.titleCorridorsDescrip
) )
) )
//precontrol //precontrol
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7, R.drawable.ic_picker_ui, R.string.titlePickers, R.string.titlePickersDescrip
R.drawable.ic_picker_ui,
contextApp.getString(R.string.titlePickers),
R.string.titlePickers,
contextApp.getString(
R.string.titlePickersDescrip
)
) )
) )
//val working_in_testMenu = false //val working_in_testMenu = false
@ -391,23 +276,15 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
if (userId == 19591) { if (userId == 19591) {
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7, R.drawable.ic_picker_ui, R.string.sacador_test, R.string.sacador_test
R.drawable.ic_picker_ui,
contextApp.getString(R.string.sacador_test),
R.string.sacador_test,
contextApp.getString(
R.string.sacador_test
)
) )
) )
if (userId == 19591) { if (userId == 19591) {
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7,
R.drawable.ic_picker_helper, R.drawable.ic_picker_helper,
contextApp.getString(R.string.pickerHelper),
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( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
10,
R.drawable.ic_controller_ui, R.drawable.ic_controller_ui,
contextApp.getString(R.string.titleControllers),
R.string.titleControllers, R.string.titleControllers,
contextApp.getString( R.string.titleControlDescrip
R.string.titleControlDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
0,
R.drawable.ic_pallet_ui, R.drawable.ic_pallet_ui,
contextApp.getString(R.string.titlePalletizers),
R.string.titlePalletizers, R.string.titlePalletizers,
contextApp.getString( R.string.titlePalletizDescrip
R.string.titlePalletizDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
6, R.drawable.ic_claim_ui, R.string.titleClaims, R.string.titleClaimsDescrip
R.drawable.ic_claim_ui,
contextApp.getString(R.string.titleClaims),
R.string.titleClaims,
contextApp.getString(R.string.titleClaimsDescrip)
) )
) )
//Tarea 4678 //Tarea 4678
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
6, R.drawable.ic_delivery_truck, R.string.titleDelivery, R.string.titleDelivery
R.drawable.ic_delivery_truck,
contextApp.getString(R.string.titleDelivery),
R.string.titleDelivery,
contextApp.getString(R.string.titleDelivery)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
6,
R.drawable.ic_troncales, R.drawable.ic_troncales,
contextApp.getString(R.string.titleDeliveryTruck),
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( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
6,
R.drawable.ic_packaging_entries, R.drawable.ic_packaging_entries,
contextApp.getString(R.string.titlePackaging),
R.string.titlePackaging, R.string.titlePackaging,
contextApp.getString(R.string.titlePackagingDescrip) R.string.titlePackagingDescrip
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
6, R.drawable.photo_camera, R.string.titlePhotos, R.string.titlePhotos
R.drawable.photo_camera,
contextApp.getString(R.string.titlePhotos),
R.string.titlePhotos,
contextApp.getString(R.string.titlePhotos)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
50, R.drawable.ic_other, R.string.titleOther, R.string.titleOther
R.drawable.ic_other,
contextApp.getString(R.string.titleOther),
R.string.titleOther,
contextApp.getString(R.string.titleOther)
) )
) )
@ -504,11 +353,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
if (workingInTest) { if (workingInTest) {
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
6, R.drawable.ic_star_ko, R.string.testing, R.string.testing
R.drawable.ic_star_ko,
contextApp.getString(R.string.testing),
R.string.testing,
contextApp.getString(R.string.testing)
) )
) )
} }
@ -519,26 +364,14 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
workerActivityAdd(CodeWorkerAction.CLAIM) workerActivityAdd(CodeWorkerAction.CLAIM)
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
30, R.drawable.ic_claims, R.string.titleClaimUbication, R.string.titleClaimDescrip
R.drawable.ic_claims,
contextApp.getString(R.string.titleClaimUbication),
R.string.titleClaimUbication,
contextApp.getString(
R.string.titleClaimDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
1, R.drawable.ic_reubication, R.string.titleReUbicator, R.string.titleReubicatorDescrip
R.drawable.ic_reubication,
contextApp.getString(R.string.titleReUbicator),
R.string.titleReUbicator,
contextApp.getString(
R.string.titleReubicatorDescrip
)
) )
) )
@ -547,11 +380,9 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
fun inititializeDefaultDelivery() { fun inititializeDefaultDelivery() {
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
6,
R.drawable.ic_delivery_truck, R.drawable.ic_delivery_truck,
contextApp.getString(R.string.titleDeliveryRoute),
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( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
6, R.drawable.ic_troncales, R.string.titleDeliveryTruck, R.string.titleDeliveryTruck
R.drawable.ic_troncales,
contextApp.getString(R.string.titleDeliveryTruck),
R.string.titleDeliveryTruck,
contextApp.getString(R.string.titleDeliveryTruck)
) )
) )
@ -578,26 +405,18 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
// if (userId == 19591 || userId == 18404 || userId == 9) { // if (userId == 19591 || userId == 18404 || userId == 9) {
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7,
R.drawable.ic_previous_presacador, R.drawable.ic_previous_presacador,
contextApp.getString(R.string.titlePrePickerTest),
R.string.titlePrePickerTest, R.string.titlePrePickerTest,
contextApp.getString( R.string.titlePickerDescrip
R.string.titlePickerDescrip
)
) )
) )
//} //}
} else { } else {
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7,
R.drawable.ic_previous_presacador, R.drawable.ic_previous_presacador,
contextApp.getString(R.string.titlePrePicker),
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( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7, R.drawable.ic_previous_precontrol, R.string.titlePreControl,
R.drawable.ic_previous_precontrol,
contextApp.getString(R.string.titlePreControl), R.string.titlePreControlDescrip
R.string.titlePreControl,
contextApp.getString(
R.string.titlePreControlDescrip
)
) )
) )
if (userId == 19591) { if (userId == 19591) {
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7,
R.drawable.ic_previous_precontrol, R.drawable.ic_previous_precontrol,
contextApp.getString(R.string.titlePreControlTest),
R.string.titlePreControlTest, R.string.titlePreControlTest,
contextApp.getString( R.string.titlePreControlDescrip
R.string.titlePreControlDescrip
)
) )
) )
} }
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
10, R.drawable.ic_ticket, R.string.titleShowTicket, R.string.titleShowTicketDescrip
R.drawable.ic_ticket,
contextApp.getString(R.string.titleShowTicket),
R.string.titleShowTicket,
contextApp.getString(
R.string.titleShowTicketDescrip
)
) )
) )
@ -647,37 +452,23 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
workerActivityAdd(CodeWorkerAction.ON_CHECKING) workerActivityAdd(CodeWorkerAction.ON_CHECKING)
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7,
R.drawable.ic_verified_user_black_24dp_selected, R.drawable.ic_verified_user_black_24dp_selected,
contextApp.getString(R.string.titleControllersAction),
R.string.titleControllersAction, R.string.titleControllersAction,
contextApp.getString( R.string.titleCheckerDescrip
R.string.titleCheckerDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
1,
R.drawable.ic_review_boxpicking, R.drawable.ic_review_boxpicking,
contextApp.getString(R.string.reviewBoxPicking),
R.string.reviewBoxPicking, R.string.reviewBoxPicking,
contextApp.getString( R.string.reviewBoxPicking
R.string.reviewBoxPicking
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
1, R.drawable.ic_advance_ticket, R.string.ticketAdvance, R.string.ticketAdvanceDescrip
R.drawable.ic_advance_ticket,
contextApp.getString(R.string.ticketAdvance),
R.string.ticketAdvance,
contextApp.getString(
R.string.ticketAdvanceDescrip
)
) )
) )
@ -686,13 +477,9 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7,
R.drawable.ic_packing_mistake, R.drawable.ic_packing_mistake,
contextApp.getString(R.string.titlePackingMistake),
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( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
1, R.drawable.ic_packaging, R.string.titlePackingHolland, R.string.titleUbicatorDescrip
R.drawable.ic_packaging,
contextApp.getString(R.string.titlePackingHolland),
R.string.titlePackingHolland,
contextApp.getString(
R.string.titleUbicatorDescrip
)
) )
) )
@ -717,49 +498,33 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
fun inititializeDefaultHistorical() { fun inititializeDefaultHistorical() {
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
10,
R.drawable.revision_icon, R.drawable.revision_icon,
contextApp.getString(R.string.titleShelvingHistorical),
R.string.titleShelvingHistorical, R.string.titleShelvingHistorical,
contextApp.getString( R.string.titleShelvingHistDescrip
R.string.titleShelvingHistDescrip
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7,
R.drawable.ic_history_orange, R.drawable.ic_history_orange,
contextApp.getString(R.string.titleLogShelving),
R.string.titleLogShelving, R.string.titleLogShelving,
contextApp.getString( R.string.titleLogShelvingDescrip
R.string.titleLogShelvingDescrip
)
) )
) )
//Tarea 5186 //Tarea 5186
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
7,
R.drawable.ic_parking_previa, R.drawable.ic_parking_previa,
contextApp.getString(R.string.titleParkingTicketPrevia),
R.string.titleParkingTicketPrevia, R.string.titleParkingTicketPrevia,
contextApp.getString( R.string.titleParkingTicketPrevia
R.string.titleParkingTicketPrevia
)
) )
) )
_pasillerositem.add( _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
22,
R.drawable.car_info, R.drawable.car_info,
contextApp.getString(R.string.titleHistoricalVehicle),
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 codeActivity: CodeWorkerAction
) { ) {
//Tarea 6078 //Tarea 6078
salix.workerActivityAdd(WorkerActionSalix(codeActivity.toString())) salix.workerActivityAdd(WorkerActionSalix(codeActivity.toString()))
.enqueue(object : SalixCallback<Any>(contextApp) { .enqueue(object : SalixCallback<Any>(contextApp) {
override fun onSuccess(response: Response<Any>) {
}
})
}
fun workerActivityList(
) {
salix.workerActivityList().enqueue(object : SalixCallback<Any>(contextApp) {
override fun onSuccess(response: Response<Any>) { override fun onSuccess(response: Response<Any>) {
_response.value = ResponseItemVO(isError = false, response = response.message())
} }
}) })
} }
} }

View File

@ -3,12 +3,7 @@ package es.verdnatura.presentation.view.feature.pasillero.model
import es.verdnatura.domain.ConstAndValues import es.verdnatura.domain.ConstAndValues
class PasillerosItemVO( class PasillerosItemVO(
var id: Int = 0, var iconResource: Int = 0, val title: Int? = null, val description: Int? = null
var iconResource: Int = 0,
val title: String = "",
val titleToShow: Int = 0,
val description: String = ""
) )
data class WorkerActionSalix( data class WorkerActionSalix(
@ -16,13 +11,6 @@ data class WorkerActionSalix(
) )
enum class CodeWorkerAction { enum class CodeWorkerAction {
CLAIM, CLAIM, DELIVERY, ON_CHECKING, ON_PREPARATION, PREVIOUS, PALLETIZING, STOP, STORAGE
DELIVERY,
ON_CHECKING,
ON_PREPARATION,
PREVIOUS,
PALLETIZING,
STOP,
STORAGE
} }