basic offline manga fragment

This commit is contained in:
Finnley Somdahl 2023-11-05 02:17:49 -06:00
parent c75df942f2
commit 91d869005c
14 changed files with 502 additions and 32 deletions

View file

@ -80,6 +80,16 @@ class MangaChapterAdapter(
}
}
fun removeDownload(chapterNumber: String) {
activeDownloads.remove(chapterNumber)
downloadedChapters.remove(chapterNumber)
// Find the position of the chapter and notify only that item
val position = arr.indexOfFirst { it.number == chapterNumber }
if (position != -1) {
notifyItemChanged(position)
}
}
inner class ChapterListViewHolder(val binding: ItemChapterListBinding) : RecyclerView.ViewHolder(binding.root) {
fun bind(chapterNumber: String) {
if (activeDownloads.contains(chapterNumber)) {