feat: refs#6659 JetPackScreens
This commit is contained in:
parent
f499915ef4
commit
e78dfdac0e
|
@ -14,6 +14,7 @@ import es.verdnatura.presentation.view.feature.collection.fragment.CollectionVie
|
|||
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoViewModel
|
||||
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleViewModel
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleViewModelCompose
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.fragment.HistoricoArticuloViewModel
|
||||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.ShelvingLogViewModel
|
||||
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
|
||||
|
@ -23,6 +24,7 @@ import es.verdnatura.presentation.view.feature.packingHolland.fragment.PackingHo
|
|||
import es.verdnatura.presentation.view.feature.paletizador.fragment.CmrExpeditionPalletViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionPalletDetailViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionScanSorterViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionScanSorterViewModelCompose
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionScanViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionStateViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionTruckListViewModel
|
||||
|
@ -36,6 +38,7 @@ import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorViewModel
|
|||
import es.verdnatura.presentation.view.feature.sacador.fragment.showticket.ShowTicketViewModel
|
||||
import es.verdnatura.presentation.view.feature.ticket.fragment.TicketViewModel
|
||||
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
|
||||
import es.verdnatura.presentation.view.feature.workermistake.fragment.WorkerMistakeViewModel
|
||||
import org.koin.android.ext.koin.androidApplication
|
||||
import org.koin.android.ext.koin.androidContext
|
||||
import org.koin.androidx.viewmodel.dsl.viewModel
|
||||
|
@ -43,9 +46,9 @@ import org.koin.dsl.module
|
|||
|
||||
val viewModelModule = module {
|
||||
|
||||
/* viewModel {
|
||||
WorkermistakeViewModel()
|
||||
}*/
|
||||
viewModel {
|
||||
WorkerMistakeViewModel(androidApplication())
|
||||
}
|
||||
|
||||
// Login
|
||||
viewModel {
|
||||
|
@ -60,6 +63,9 @@ val viewModelModule = module {
|
|||
viewModel {
|
||||
DayOfSaleViewModel(androidContext())
|
||||
}
|
||||
viewModel {
|
||||
DayOfSaleViewModelCompose(androidApplication())
|
||||
}
|
||||
|
||||
// Pasilleros / Item Card
|
||||
viewModel {
|
||||
|
@ -107,6 +113,10 @@ val viewModelModule = module {
|
|||
ExpeditionScanSorterViewModel(androidContext())
|
||||
}
|
||||
|
||||
viewModel {
|
||||
ExpeditionScanSorterViewModelCompose(androidApplication())
|
||||
}
|
||||
|
||||
|
||||
viewModel {
|
||||
CmrExpeditionPalletViewModel(androidContext())
|
||||
|
|
|
@ -6,6 +6,7 @@ object VerdnaturaColors {
|
|||
|
||||
val OrangeSalix = Color(0xFFEC8916)
|
||||
val BlackCustomDialog = Color(0xFF1A1A1A)
|
||||
val BlackTextInput = Color(0xFF666666)
|
||||
val White = Color(0xFFFFFFFF)
|
||||
|
||||
// Colores principales
|
||||
|
|
|
@ -5,7 +5,6 @@ import android.os.Bundle
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.ComposeView
|
||||
import androidx.fragment.app.Fragment
|
||||
import es.verdnatura.R
|
||||
|
@ -27,9 +26,7 @@ class BuscarItemFragmentCompose(
|
|||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
|
||||
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
|
||||
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
|
@ -55,7 +52,6 @@ class BuscarItemFragmentCompose(
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
itemFk?.let {
|
||||
viewModel.getIdFromCodeSalix(it.toString())
|
||||
}
|
||||
|
@ -75,56 +71,4 @@ class BuscarItemFragmentCompose(
|
|||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun SetView() {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*Como estaba
|
||||
LocationScreen(
|
||||
items = uiState.items.map {
|
||||
LocationItem(
|
||||
parking = it.shelving.parking!!.code,
|
||||
matricula = it.shelving.code,
|
||||
visible = it.visible.toString(),
|
||||
reserve = it.available.toString(),
|
||||
priority = it.shelving.priority.toString(),
|
||||
fecha = it.created,
|
||||
sector = it.shelving.parking.sector.description
|
||||
)
|
||||
},
|
||||
onTextChange = { input ->
|
||||
viewModel.getIdFromCodeSalix(input)
|
||||
},
|
||||
titleToolBar = if (uiState.itemFk != null) {
|
||||
getString(
|
||||
R.string.itemsTotal,
|
||||
uiState.itemFk,
|
||||
getString(R.string.visibleTotal),
|
||||
uiState.items.sumOf { it.visible }
|
||||
)
|
||||
} else getString(R.string.getubication),
|
||||
onBackClick = { (context as MainActivity).onMyBackPressed() },
|
||||
onLongClick = { item -> item.sector.toast(requireContext()) },
|
||||
onClick = { item ->
|
||||
pasillerosItemClickListener?.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(title = R.string.titleUbicator),
|
||||
item.matricula
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class BuscarItemViewModelFactory(private val context: Application) : ViewModelProvider.Factory {
|
||||
override fun <T : ViewModel> create(modelClass: Class<T>): T {
|
||||
if (modelClass.isAssignableFrom(BuscarItemComposeViewModel::class.java)) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return BuscarItemComposeViewModel(context) as T
|
||||
}
|
||||
throw IllegalArgumentException("Unknown ViewModel class")
|
||||
}
|
||||
}*/
|
||||
|
|
Loading…
Reference in New Issue