alert dialog cancel button

This commit is contained in:
rebelonion 2024-01-21 00:26:22 -06:00
parent 5d8cf8a605
commit 8e93f66ba8
3 changed files with 10 additions and 3 deletions

View file

@ -380,6 +380,7 @@ class EpisodeAdapter(
binding.itemDownloadStatus.visibility = View.GONE binding.itemDownloadStatus.visibility = View.GONE
// Show download icon // Show download icon
binding.itemDownload.setImageResource(R.drawable.ic_circle_add) binding.itemDownload.setImageResource(R.drawable.ic_circle_add)
binding.itemDownload.rotation = 0f
} }
} }

View file

@ -309,7 +309,7 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
val subtitleNames = subtitles.map { it.language } val subtitleNames = subtitles.map { it.language }
var subtitleToDownload: Subtitle? = null var subtitleToDownload: Subtitle? = null
if (subtitles.isNotEmpty()) { if (subtitles.isNotEmpty()) {
AlertDialog.Builder(context, R.style.MyPopup) val alertDialog = AlertDialog.Builder(context, R.style.MyPopup)
.setTitle("Download Subtitle") .setTitle("Download Subtitle")
.setSingleChoiceItems( .setSingleChoiceItems(
subtitleNames.toTypedArray(), subtitleNames.toTypedArray(),
@ -333,9 +333,8 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
snackString("No Video Selected") snackString("No Video Selected")
} }
} }
.setNegativeButton("Cancel") { dialog, _ -> .setNegativeButton("Skip") { dialog, _ ->
subtitleToDownload = null subtitleToDownload = null
dialog.dismiss()
if (selectedVideo != null) { if (selectedVideo != null) {
Helper.startAnimeDownloadService( Helper.startAnimeDownloadService(
currActivity()!!, currActivity()!!,
@ -349,8 +348,14 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
} else { } else {
snackString("No Video Selected") snackString("No Video Selected")
} }
dialog.dismiss()
}
.setNeutralButton("Cancel") { dialog, _ ->
subtitleToDownload = null
dialog.dismiss()
} }
.show() .show()
alertDialog.window?.setDimAmount(0.8f)
} else { } else {
if (selectedVideo != null) { if (selectedVideo != null) {

View file

@ -167,6 +167,7 @@ class MangaChapterAdapter(
} else { } else {
// Show download icon // Show download icon
binding.itemDownload.setImageResource(R.drawable.ic_circle_add) binding.itemDownload.setImageResource(R.drawable.ic_circle_add)
binding.itemDownload.rotation = 0f
} }
} }