basic offline manga fragment
This commit is contained in:
parent
c75df942f2
commit
91d869005c
14 changed files with 502 additions and 32 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue