Closed hamza0786 closed 2 months ago
To automatically delete the downloaded file from the RecyclerView, you can observe the Flow of DownloadModel list and check the status field. When the status is SUCCESS, you can remove the item from the RecyclerView adapter.
Something like this:
downloadModelList.collect { list ->
val filteredList = list.filter { it.status != Status.SUCCESS }
adapter.setItems(filteredList)
}
i am getting this when i paste your code in observe method.
and remember i only want to delete the downloaded item view from recyclerview not the downloaded file itself from the storage.
Not like this, that was for reference, do like this
ketch.observeDownloads().collect { list -> val filteredList = list.filter { it.status != Status.SUCCESS } adapter.submitList(filteredList) }
Thank you very much for helping me out brother!
Hi! How to automatically delete the download when finished from recyclerview?