Tell how many messages will be deleted

This commit is contained in:
M66B 2019-01-28 06:14:45 +00:00
parent 6c944f4aec
commit 1535af0027
2 changed files with 7 additions and 2 deletions

View File

@ -1138,8 +1138,9 @@ public class FragmentMessages extends FragmentBase {
} }
private void onActionDeleteSelection() { private void onActionDeleteSelection() {
int count = selectionTracker.getSelection().size();
new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner()) new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner())
.setMessage(R.string.title_ask_delete_selected) .setMessage(getResources().getQuantityString(R.plurals.title_deleting_messages, count, count))
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {

View File

@ -47,6 +47,11 @@
<item quantity="other">Move %1$d messages to %2$s?</item> <item quantity="other">Move %1$d messages to %2$s?</item>
</plurals> </plurals>
<plurals name="title_deleting_messages">
<item quantity="one">Delete %1$d message permanently?</item>
<item quantity="other">Delete %1$d messages permanently?</item>
</plurals>
<plurals name="title_ask_spam"> <plurals name="title_ask_spam">
<item quantity="one">Report %1$d message as spam?</item> <item quantity="one">Report %1$d message as spam?</item>
<item quantity="other">Report %1$d messages as spam?</item> <item quantity="other">Report %1$d messages as spam?</item>
@ -322,7 +327,6 @@
<string name="title_attachment_unavailable">Some attachments are not downloaded and will not be added, continue?</string> <string name="title_attachment_unavailable">Some attachments are not downloaded and will not be added, continue?</string>
<string name="title_image_unavailable">Some images are not downloaded and will not be added, continue?</string> <string name="title_image_unavailable">Some images are not downloaded and will not be added, continue?</string>
<string name="title_ask_delete">Delete message permanently?</string> <string name="title_ask_delete">Delete message permanently?</string>
<string name="title_ask_delete_selected">Delete selected messages permanently?</string>
<string name="title_ask_delete_answer">Delete reply template permanently?</string> <string name="title_ask_delete_answer">Delete reply template permanently?</string>
<string name="title_ask_delete_rule">Delete rule permanently?</string> <string name="title_ask_delete_rule">Delete rule permanently?</string>
<string name="title_ask_discard">Discard draft?</string> <string name="title_ask_discard">Discard draft?</string>