From 1f1b9010476e30811218c39b002d885e6ba65d6f Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Tue, 31 Oct 2023 10:55:22 +0100 Subject: [PATCH] refs #6073 reordenar menus --- .../feature/main/activity/MainActivity.kt | 43 +- .../pasillero/fragment/PasilleroViewModel.kt | 427 ++++++++++-------- .../main/res/drawable/ic_historical_menu.xml | 10 + app/src/main/res/drawable/ic_historicals.xml | 9 + app/src/main/res/drawable/ic_other.xml | 9 + .../main/res/drawable/ic_parking_previa.xml | 9 + app/src/main/res/drawable/ic_previous.xml | 9 + 7 files changed, 304 insertions(+), 212 deletions(-) create mode 100644 app/src/main/res/drawable/ic_historical_menu.xml create mode 100644 app/src/main/res/drawable/ic_historicals.xml create mode 100644 app/src/main/res/drawable/ic_other.xml create mode 100644 app/src/main/res/drawable/ic_parking_previa.xml create mode 100644 app/src/main/res/drawable/ic_previous.xml 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 c628032b..c91ceb17 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 @@ -37,7 +37,6 @@ import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFra import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPicker import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPickerNew import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPreChecker -import es.verdnatura.presentation.view.feature.collection.fragment.CollectionShowTicketFragment import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorFragment import es.verdnatura.presentation.view.feature.controlador.fragment.WebFragment import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoFragment @@ -556,6 +555,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL when (item.title) { + //BUFFERS getString(R.string.titlePalletizar) -> { addFragmentOnTop(ExpeditionTruckListFragment.newInstance()) @@ -570,10 +570,27 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL ) ) + } + getString(R.string.historicals) -> { + addFragmentOnTop( + PasilleroFragment.newInstance(item.title, isInitMenu = false), + ) } getString(R.string.titleControllers) -> { + addFragmentOnTop( + PasilleroFragment.newInstance(item.title, isInitMenu = false), + ) + } + + getString(R.string.titleOther) -> { + addFragmentOnTop( + PasilleroFragment.newInstance(item.title, isInitMenu = false), + ) + } + + getString(R.string.titleChecker) -> { addFragmentOnTop(ControladorFragment.newInstance()) } @@ -581,7 +598,12 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL addFragmentOnTop( PasilleroFragment.newInstance(item.title, isInitMenu = false), ) + } + getString(R.string.titlePrevious) -> { + addFragmentOnTop( + PasilleroFragment.newInstance(item.title, isInitMenu = false), + ) } getString(R.string.titleExpeditionState) -> { @@ -680,7 +702,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL addFragmentOnTop(AutomaticAddItemFragmentTEST.newInstance(entryPoint, item.title)) } - getString(R.string.titleChecker) -> { + getString(R.string.titleControllersAction) -> { addFragmentOnTop(AutomaticAddItemFragment.newInstance(entryPoint, item.title)) } @@ -803,12 +825,12 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL } getString(R.string.titleDelivery) -> { + addFragmentOnTop( - PasilleroFragment.newInstance( - getString(R.string.titleDelivery), - isInitMenu = false - ) + RoutesFragment.newInstance(getString(R.string.titleDeliveryRoute)), + getString(R.string.titleDeliverySummary) ) + } @@ -973,7 +995,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL getString( R.string.titleInfo ) - ) || backEntry!!.contains(getString(R.string.titleDeliverySummary)) + ) ) { finish() } @@ -1048,9 +1070,6 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL addFragmentOnTop(EndSacadorFragment.newInstance(collection, type)) } - "SHOWTICKET" -> { - addFragmentOnTop(CollectionShowTicketFragment.newInstance(collection, type)) - } //Tarea 4711 "PRECHECKER" -> { addFragmentOnTop(CollectionFragmentPreChecker.newInstance(collection, type)) @@ -1188,7 +1207,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL super.onUserInteraction() if ((System.currentTimeMillis() / 1000 / 3600) - myTimeUserInteraction > 4) { - myTimeUserInteraction = System.currentTimeMillis() / 1000 /3600 + myTimeUserInteraction = System.currentTimeMillis() / 1000 / 3600 val loginViewModel = LoginViewModel(application as MobileApplication) loginViewModel.deviceLog_addSalix( app = getString(R.string.logAppName), @@ -1197,7 +1216,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL serialnumber = (application as MobileApplication).serialNumber, userFk = (application as MobileApplication).userId!! - ) + ) } 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 0a76cf2c..683ca822 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 @@ -13,63 +13,35 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { val pasillerositem: List get() = _pasillerositem + fun inititializeDefaultData() { - /* _pasillerositem.add( - PasillerosItemVO(20, - R.drawable.barcode_scan, - "Visor web",R.string.SmarttagAssociate) - */ - /* _pasillerositem.add( - PasillerosItemVO(20, - R.drawable.barcode_scan, - "Asociar Sacador SmartTags",R.string.SmarttagAssociate) - ) */ - /* _pasillerositem.add( - PasillerosItemVO(21, - R.drawable.barcode_scan, - "Registrar SmartTags",R.string.SmarttagRegister) - ) - */ + /* _pasillerositem.add( + PasillerosItemVO( + 7, + R.drawable.ic_streetview_black_24dp, + contextApp.getString(R.string.titlePrePicker), + R.string.titlePrePicker, + contextApp.getString( + R.string.titlePickerDescrip + ) + ) + ) + //sergio para que aparezca el nuevo menu - _pasillerositem.add( - PasillerosItemVO( - 7, - R.drawable.ic_streetview_black_24dp, - contextApp.getString(R.string.titlePrePicker), - R.string.titlePrePicker, - contextApp.getString( - R.string.titlePickerDescrip + _pasillerositem.add( + PasillerosItemVO( + 10, + R.drawable.ic_ticket, + contextApp.getString(R.string.titleShowTicket), + R.string.titleShowTicket, + contextApp.getString( + R.string.titleShowTicketDescrip + ) ) - ) - ) - //precontrol - _pasillerositem.add( - PasillerosItemVO( - 7, - R.drawable.ic_verified_user_black_24dp_selected, - contextApp.getString(R.string.titlePreControl), - R.string.titlePreControl, - contextApp.getString( - R.string.titlePreControlDescrip - ) - ) - ) - - //sergio para que aparezca el nuevo menu - _pasillerositem.add( - PasillerosItemVO( - 10, - R.drawable.ic_ticket, - contextApp.getString(R.string.titleShowTicket), - R.string.titleShowTicket, - contextApp.getString( - R.string.titleShowTicketDescrip - ) - ) - ) + )*/ _pasillerositem.add( PasillerosItemVO( @@ -84,6 +56,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { ) +/* _pasillerositem.add( PasillerosItemVO( @@ -94,6 +67,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { contextApp.getString(R.string.titleParkingDescrip) ) ) +*/ _pasillerositem.add( PasillerosItemVO( @@ -119,44 +93,6 @@ 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 - ) - ) - ) - - - //Tarea 5651 - _pasillerositem.add( - PasillerosItemVO( - 1, - R.drawable.ic_advance_ticket, - contextApp.getString(R.string.ticketAdvance), - R.string.ticketAdvance, - contextApp.getString( - R.string.ticketAdvanceDescrip - ) - ) - ) - - - _pasillerositem.add( - PasillerosItemVO( - 1, - R.drawable.ic_reubication, - contextApp.getString(R.string.titleReUbicator), - R.string.titleReUbicator, - contextApp.getString( - R.string.titleReubicatorDescrip - ) - ) - ) _pasillerositem.add( PasillerosItemVO( @@ -193,53 +129,20 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { ) ) ) - //tarea 4585 + + _pasillerositem.add( PasillerosItemVO( - 7, - R.drawable.ic_packing_mistake, - contextApp.getString(R.string.titlePackingMistake), - R.string.titlePackingMistake, + 41, + R.drawable.ic_historical_menu, + contextApp.getString(R.string.historicals), + R.string.historicals, contextApp.getString( - R.string.titlePackingMistakeDescrip + R.string.historicalsDescrip ) ) ) - _pasillerositem.add( - PasillerosItemVO( - 10, - R.drawable.revision_icon, - contextApp.getString(R.string.titleShelvingHistorical), - R.string.titleShelvingHistorical, - contextApp.getString( - 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 - ) - ) - ) - - _pasillerositem.add( - PasillerosItemVO( - 22, - R.drawable.car_info, - contextApp.getString(R.string.titleHistoricalVehicle), - R.string.titleHistoricalVehicle, - contextApp.getString( - R.string.titleHistVehicleDescrip - ) - ) - ) _pasillerositem.add( PasillerosItemVO( 41, @@ -265,6 +168,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { } + fun inititializeDefaultPallet() { _pasillerositem.add( @@ -313,7 +217,6 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { ) ) - //Tarea #3986 _pasillerositem.add( PasillerosItemVO( 31, @@ -349,7 +252,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { ) - _pasillerositem.add( + /* _pasillerositem.add( PasillerosItemVO( 33, R.drawable.qrcode_scan, @@ -357,7 +260,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { R.string.titleQrReader, contextApp.getString(R.string.titleQrDescrip) ) - ) + )*/ } @@ -440,6 +343,18 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { } fun inititializeDefaultDataInit() { + + + _pasillerositem.add( + PasillerosItemVO( + 30, + R.drawable.ic_previous, + contextApp.getString(R.string.titlePrevious), + R.string.titlePrevious, + contextApp.getString(R.string.titlePreviousDescription) + ) + ) + _pasillerositem.add( PasillerosItemVO( 7, @@ -476,17 +391,18 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { ) } //sergio para que aparezca el nuevo menu - _pasillerositem.add( - PasillerosItemVO( - 10, - R.drawable.ic_controller_ui, - contextApp.getString(R.string.titleControllers), - R.string.titleControllers, - contextApp.getString( - R.string.titleControlDescrip + + _pasillerositem.add( + PasillerosItemVO( + 10, + R.drawable.ic_controller_ui, + contextApp.getString(R.string.titleControllers), + R.string.titleControllers, + contextApp.getString( + R.string.titleControlDescrip + ) ) ) - ) _pasillerositem.add( PasillerosItemVO( @@ -501,7 +417,6 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { ) - _pasillerositem.add( PasillerosItemVO( 6, @@ -545,6 +460,16 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { ) ) + _pasillerositem.add( + PasillerosItemVO( + 50, + R.drawable.ic_other, + contextApp.getString(R.string.titleOther), + R.string.titleOther, + contextApp.getString(R.string.titleOther) + ) + ) + val working_in_test = false if (working_in_test) { _pasillerositem.add( @@ -575,68 +500,24 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { ) + _pasillerositem.add( + PasillerosItemVO( + 1, + R.drawable.ic_reubication, + contextApp.getString(R.string.titleReUbicator), + R.string.titleReUbicator, + contextApp.getString( + R.string.titleReubicatorDescrip + ) + ) + ) + + + } fun inititializeDefaultDelivery() { - /* _pasillerositem.add( - PasillerosItemVO( - 30, - R.drawable.expedition_find, - contextApp.getString(R.string.titleLog), - R.string.titleLog, - contextApp.getString( - R.string.titleLogDescrip - ) - ) - ) - _pasillerositem.add( - PasillerosItemVO( - 30, - R.drawable.ic_info, - contextApp.getString(R.string.titleInfo), - R.string.titleInfo, - contextApp.getString( - R.string.titleInfoDescription - ) - ) - ) - /* _pasillerositem.add( - PasillerosItemVO( - 30, - R.drawable.ic_delivery_truck, - contextApp.getString(R.string.titleLoadTruck), - R.string.titleLoadTruckInfo, - contextApp.getString( - R.string.titleLoadTruckInfo - ) - ) - ) - - _pasillerositem.add( - PasillerosItemVO( - 30, - R.drawable.ic_delivery_truck, - contextApp.getString(R.string.titleUnLoadTruck), - R.string.titleUnLoadTruckInfo, - contextApp.getString( - R.string.titleUnLoadTruckInfo - ) - ) - ) - */ - - _pasillerositem.add( - PasillerosItemVO( - 6, - R.drawable.ic_delivery_truck, - contextApp.getString(R.string.titleDeliverySummary), - R.string.titleDeliverySummary, - contextApp.getString(R.string.titleDeliverySummary) - ) - ) - */ - _pasillerositem.add( PasillerosItemVO( @@ -649,4 +530,150 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) { ) } + + fun inititializeDefaultPrevia() { + + _pasillerositem.add( + PasillerosItemVO( + 7, + R.drawable.ic_streetview_black_24dp, + contextApp.getString(R.string.titlePrePicker), + R.string.titlePrePicker, + contextApp.getString( + R.string.titlePickerDescrip + ) + ) + ) + _pasillerositem.add( + PasillerosItemVO( + 7, + R.drawable.ic_verified_user_black_24dp_selected, + contextApp.getString(R.string.titlePreControl), + R.string.titlePreControl, + contextApp.getString( + R.string.titlePreControlDescrip + ) + ) + ) + + _pasillerositem.add( + PasillerosItemVO( + 10, + R.drawable.ic_ticket, + contextApp.getString(R.string.titleShowTicket), + R.string.titleShowTicket, + contextApp.getString( + R.string.titleShowTicketDescrip + ) + ) + ) + + } + + fun inititializeDefaultChecker() { + + + _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 + ) + ) + ) + + _pasillerositem.add( + PasillerosItemVO( + 1, + R.drawable.ic_advance_ticket, + contextApp.getString(R.string.ticketAdvance), + R.string.ticketAdvance, + contextApp.getString( + R.string.ticketAdvanceDescrip + ) + ) + ) + + _pasillerositem.add( + PasillerosItemVO( + 7, + R.drawable.ic_packing_mistake, + contextApp.getString(R.string.titlePackingMistake), + R.string.titlePackingMistake, + contextApp.getString( + R.string.titlePackingMistakeDescrip + ) + ) + ) + + } + fun inititializeDefaultOther() { + + _pasillerositem.add( + PasillerosItemVO( + 1, + R.drawable.ic_packaging, + contextApp.getString(R.string.titlePackingHolland), + R.string.titlePackingHolland, + contextApp.getString( + R.string.titleUbicatorDescrip + ) + ) + ) + + } + fun inititializeDefaultHistorical() { + _pasillerositem.add( + PasillerosItemVO( + 10, + R.drawable.revision_icon, + contextApp.getString(R.string.titleShelvingHistorical), + R.string.titleShelvingHistorical, + contextApp.getString( + 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 + ) + ) + ) + + //Tarea 5186 + /* _pasillerositem.add( + PasillerosItemVO( + 7, + R.drawable.ic_parking_previa, + contextApp.getString(R.string.titleParkingTicketPrevia), + R.string.titleParkingTicketPrevia, + contextApp.getString( + R.string.titleParkingTicketPrevia + ) + ) + )*/ + + _pasillerositem.add( + PasillerosItemVO( + 22, + R.drawable.car_info, + contextApp.getString(R.string.titleHistoricalVehicle), + R.string.titleHistoricalVehicle, + contextApp.getString( + R.string.titleHistVehicleDescrip + ) + ) + ) + + + } } diff --git a/app/src/main/res/drawable/ic_historical_menu.xml b/app/src/main/res/drawable/ic_historical_menu.xml new file mode 100644 index 00000000..08e205b4 --- /dev/null +++ b/app/src/main/res/drawable/ic_historical_menu.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_historicals.xml b/app/src/main/res/drawable/ic_historicals.xml new file mode 100644 index 00000000..af1bb2f3 --- /dev/null +++ b/app/src/main/res/drawable/ic_historicals.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_other.xml b/app/src/main/res/drawable/ic_other.xml new file mode 100644 index 00000000..40644aed --- /dev/null +++ b/app/src/main/res/drawable/ic_other.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_parking_previa.xml b/app/src/main/res/drawable/ic_parking_previa.xml new file mode 100644 index 00000000..be26e199 --- /dev/null +++ b/app/src/main/res/drawable/ic_parking_previa.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_previous.xml b/app/src/main/res/drawable/ic_previous.xml new file mode 100644 index 00000000..5f82543e --- /dev/null +++ b/app/src/main/res/drawable/ic_previous.xml @@ -0,0 +1,9 @@ + + +