refs #6873 feat:modify filter
This commit is contained in:
parent
d9031969b0
commit
e0c9fc7c60
|
@ -84,7 +84,7 @@ class HistoricoArticuloFragment(
|
|||
when (item) {
|
||||
iconReload.drawable -> viewModelwithFilter("all")
|
||||
iconGargabe.drawable -> {
|
||||
viewModelwithFilter("contenedor")
|
||||
viewModelwithFilter("merma")
|
||||
item.setTint(getColor(context!!, verdnatura_pumpkin_orange))
|
||||
}
|
||||
|
||||
|
@ -173,16 +173,11 @@ class HistoricoArticuloFragment(
|
|||
listHistoric.clear()
|
||||
listHistoryAux.clear()
|
||||
lista.forEach {
|
||||
if (filter.equals("all")) {
|
||||
listHistoric.add(it)
|
||||
} else {
|
||||
if (it.name?.contains(filter, true)!!) {
|
||||
if (filter == "all" || (filter == "falta" && it.name?.contains(filter, true) == true) || (filter != "falta" && it.name?.contains("merma", true) == true && !it.name?.contains("falta", true)!!)) {
|
||||
listHistoric.add(it)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
adapter = HistoricoAdapter(listHistoric)
|
||||
binding.historicoRecyclerview.adapter = adapter
|
||||
binding.historicoRecyclerview.layoutManager =
|
||||
|
|
Loading…
Reference in New Issue