Commit 89988103b255abbc58d7b7b3246f4d9787a7ef69
1 parent
8ed3753b48
Exists in
master
17092020 2000
Showing
1 changed file
with
18 additions
and
14 deletions
Show diff stats
app/src/main/java/com/focasoftware/deboinventariov20/UI/main/MainFragment.kt
| ... | ... | @@ -22,7 +22,6 @@ import kotlinx.coroutines.GlobalScope |
| 22 | 22 | import kotlinx.coroutines.async |
| 23 | 23 | import kotlinx.coroutines.launch |
| 24 | 24 | import java.util.* |
| 25 | -import java.util.Locale.filter | |
| 26 | 25 | |
| 27 | 26 | class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener { |
| 28 | 27 | private lateinit var inventarios: List<InvHead> |
| ... | ... | @@ -34,7 +33,6 @@ class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener |
| 34 | 33 | private lateinit var navController: NavController |
| 35 | 34 | private lateinit var sharedPreferences: SharedPreferences |
| 36 | 35 | private var cantidadInventarios: Int = 0 |
| 37 | - private var adapterFilter: InventarioListAdapter? = null | |
| 38 | 36 | |
| 39 | 37 | override fun onCreate(savedInstanceState: Bundle?) { |
| 40 | 38 | super.onCreate(savedInstanceState) |
| ... | ... | @@ -132,18 +130,24 @@ class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener |
| 132 | 130 | } |
| 133 | 131 | } |
| 134 | 132 | |
| 135 | -// cbVentas.setOnClickListener { | |
| 136 | -// if (cbVentas.isChecked) { | |
| 137 | -// rcInventario.apply { | |
| 138 | -// adapter = viewAdapter | |
| 139 | -// layoutManager = viewManager | |
| 140 | -// } | |
| 141 | -// adapterFilter. | |
| 142 | -// adapterFilter?.filter?.filter("Deposito") | |
| 143 | -// adapterFilter?.notifyDataSetChanged() | |
| 144 | -// viewAdapter.notifyDataSetChanged() | |
| 145 | -// } | |
| 146 | -// } | |
| 133 | + cbVentas.setOnClickListener { | |
| 134 | + if (cbVentas.isChecked) { | |
| 135 | + listIvn2.clear() | |
| 136 | + inventarios.forEach { | |
| 137 | + if (it.lugar==false) { | |
| 138 | + listIvn2.add(it) | |
| 139 | + } | |
| 140 | + } | |
| 141 | + } else { | |
| 142 | + listIvn2.clear() | |
| 143 | + listIvn2.addAll(inventarios) | |
| 144 | + } | |
| 145 | + rcInventario.apply { | |
| 146 | + adapter = viewAdapter | |
| 147 | + layoutManager = viewManager | |
| 148 | + } | |
| 149 | + viewAdapter.notifyDataSetChanged() | |
| 150 | + } | |
| 147 | 151 | return v |
| 148 | 152 | } |
| 149 | 153 |