Add confirm dialog for multiple deletion. Closes #155

This commit is contained in:
len 2016-05-08 14:58:21 +02:00
parent a0f7761a37
commit 7f5879ed6f
2 changed files with 9 additions and 1 deletions

View File

@ -282,7 +282,14 @@ class ChaptersFragment : BaseRxFragment<ChaptersPresenter>(), ActionMode.Callbac
R.id.action_mark_as_read -> markAsRead(getSelectedChapters()) R.id.action_mark_as_read -> markAsRead(getSelectedChapters())
R.id.action_mark_as_unread -> markAsUnread(getSelectedChapters()) R.id.action_mark_as_unread -> markAsUnread(getSelectedChapters())
R.id.action_download -> downloadChapters(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 else -> return false
} }
return true return true

View File

@ -228,6 +228,7 @@
<string name="download_10">Download next 10 chapters</string> <string name="download_10">Download next 10 chapters</string>
<string name="download_all">Download all</string> <string name="download_all">Download all</string>
<string name="download_unread">Download unread</string> <string name="download_unread">Download unread</string>
<string name="confirm_delete_chapters">Are you sure you want to delete selected chapters?</string>
<!-- MyAnimeList fragment --> <!-- MyAnimeList fragment -->
<string name="reading">Reading</string> <string name="reading">Reading</string>