From 7f5879ed6f261c5384560fbce81ff16ae8121ea4 Mon Sep 17 00:00:00 2001 From: len Date: Sun, 8 May 2016 14:58:21 +0200 Subject: [PATCH] Add confirm dialog for multiple deletion. Closes #155 --- .../tachiyomi/ui/manga/chapter/ChaptersFragment.kt | 9 ++++++++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt index 8d866268d..a6c799b85 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt @@ -282,7 +282,14 @@ class ChaptersFragment : BaseRxFragment(), ActionMode.Callbac R.id.action_mark_as_read -> markAsRead(getSelectedChapters()) R.id.action_mark_as_unread -> markAsUnread(getSelectedChapters()) R.id.action_download -> downloadChapters(getSelectedChapters()) - R.id.action_delete -> deleteChapters(getSelectedChapters()) + R.id.action_delete -> { + MaterialDialog.Builder(activity) + .content(R.string.confirm_delete_chapters) + .positiveText(android.R.string.yes) + .negativeText(android.R.string.no) + .onPositive { dialog, action -> deleteChapters(getSelectedChapters()) } + .show() + } else -> return false } return true diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a050264dd..b66e32f07 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -228,6 +228,7 @@ Download next 10 chapters Download all Download unread + Are you sure you want to delete selected chapters? Reading