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