I do search of items and every time I fetch from server When I search "o" it works and then "ot" it works again and as a result of "o" search I have let's say 20 items and in case "ot" I have 10 items which are part of that 20 items and I do remove t in EditText it shows 20 items only the recyclerview scroll indicator is in the middle Here is my Code for diffUtil
ListAdapter<Asset, SearchAdapter.ViewHolder>(object : DiffUtil.ItemCallback<Asset>() {
override fun areItemsTheSame(oldItem: Asset, newItem: Asset): Boolean {
return oldItem.assetId == newItem.assetId && oldItem.originalTitle ==newItem.originalTitle
}
override fun areContentsTheSame(oldItem: Asset, newItem: Asset): Boolean {
return oldItem == newItem
}
}
viewModel.searchAssets.observe(viewLifecycleOwner, Observer {
searchAdapter.submitList(it)
})
Here you can see the video I have filmed https://drive.google.com/drive/folders/1ia5y9TtL0PSAM1M4hVBILWcdSK1BDyKI?usp=sharing