в моем getFilter в recyclerViewAdapter notifyDataSetChanged не работает productList имеет 2 элемента filterListResult имеет 1 элемент
return object : Filter() {
override fun performFiltering(constraint: CharSequence?): FilterResults {
val charSearch = constraint.toString()
if (charSearch.isEmpty())
filterListResult = productsList
else {
val resultList= ArrayList<ProductEntity>()
lists.size
for (row in lists){
if(row.productName.toLowerCase().contains(charSearch.toLowerCase()))
resultList.add(row)
}
filterListResult = resultList
}
val filterResults = FilterResults()
filterResults.values = filterListResult
// notifyDataSetChanged()
return filterResults
}
override fun publishResults(constraint: CharSequence?, results: FilterResults?) {
filterListResult = results!!.values as List<ProductEntity>
productsList = filterListResult
notifyDataSetChanged()
}
весь мой код в моем github https://github.com/frolix/TestApp/blob/master/app/src/main/java/com/example/testappfinal/adapter/ProductListAdapter.kt