warning menu when deleting episode

auto hide desc if ep is downloaded(looked verybad when both was on)
This commit is contained in:
aayush262 2024-01-23 01:10:51 +05:30
parent a58f8fa76b
commit 625c7d738b
2 changed files with 27 additions and 4 deletions

View file

@ -218,7 +218,16 @@ class MangaChapterAdapter(
fragment.onMangaChapterStopDownloadClick(chapterNumber)
return@setOnClickListener
} else if (downloadedChapters.contains(chapterNumber)) {
fragment.onMangaChapterRemoveDownloadClick(chapterNumber)
val builder = AlertDialog.Builder(currContext(), R.style.MyPopup)
builder.setTitle("Delete Chapter")
builder.setMessage("Are you sure you want to delete ${chapterNumber}?")
builder.setPositiveButton("Yes") { _, _ ->
fragment.onMangaChapterRemoveDownloadClick(chapterNumber)
}
builder.setNegativeButton("No") { _, _ ->
}
val dialog = builder.show()
dialog.window?.setDimAmount(0.8f)
return@setOnClickListener
} else {
fragment.onMangaChapterDownloadClick(chapterNumber)