This commit is contained in:
Sergio De la torre 2023-06-19 13:55:42 +02:00
parent 5bdf4ab290
commit 485dd17f88
1 changed files with 5 additions and 1 deletions

View File

@ -296,13 +296,17 @@ class LoadUnloadFragment(
lifecycleScope.launch { lifecycleScope.launch {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
db.expedicionDao().insert(list.filter { it.routeFk == route } db.expedicionDao().insert(list.filter { it.routeFk == route }
.filter { it.addressFk == addressFk }) )
myList = db.expedicionDao().getAll(route) as MutableList<ExpeditionInfoLoadUnload> myList = db.expedicionDao().getAll(route) as MutableList<ExpeditionInfoLoadUnload>
// myList = list as MutableList<ExpeditionInfoLoadUnload> // myList = list as MutableList<ExpeditionInfoLoadUnload>
} }
if (addressFk != 0) { if (addressFk != 0) {
myList = myList =
myList.filter { it.addressFk == addressFk } as MutableList<ExpeditionInfoLoadUnload> myList.filter { it.addressFk == addressFk } as MutableList<ExpeditionInfoLoadUnload>
}else{
myList.filter{
it.routeFk == route
}
} }
adapter = ExpeditionLoadUnloadAdapter(myList) adapter = ExpeditionLoadUnloadAdapter(myList)
binding.expeditionloadunloadRecyclerview.adapter = adapter binding.expeditionloadunloadRecyclerview.adapter = adapter