Simplify confusing string with two plurals
This commit is contained in:
parent
434cd2b79f
commit
897889923c
|
@ -95,16 +95,13 @@ public class EpisodeMultiSelectActionHandler {
|
||||||
|
|
||||||
private void deleteChecked() {
|
private void deleteChecked() {
|
||||||
int countHasMedia = 0;
|
int countHasMedia = 0;
|
||||||
int countNoMedia = 0;
|
|
||||||
for (FeedItem feedItem : selectedItems) {
|
for (FeedItem feedItem : selectedItems) {
|
||||||
if (feedItem.hasMedia() && feedItem.getMedia().isDownloaded()) {
|
if (feedItem.hasMedia() && feedItem.getMedia().isDownloaded()) {
|
||||||
countHasMedia++;
|
countHasMedia++;
|
||||||
DBWriter.deleteFeedMediaOfItem(activity, feedItem.getMedia().getId());
|
DBWriter.deleteFeedMediaOfItem(activity, feedItem.getMedia().getId());
|
||||||
} else {
|
|
||||||
countNoMedia++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showMessageMore(R.plurals.deleted_multi_episode_batch_label, countNoMedia, countHasMedia);
|
showMessage(R.plurals.deleted_multi_episode_batch_label, countHasMedia);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showMessage(@PluralsRes int msgId, int numItems) {
|
private void showMessage(@PluralsRes int msgId, int numItems) {
|
||||||
|
@ -112,14 +109,6 @@ public class EpisodeMultiSelectActionHandler {
|
||||||
.getQuantityString(msgId, numItems, numItems), Snackbar.LENGTH_LONG);
|
.getQuantityString(msgId, numItems, numItems), Snackbar.LENGTH_LONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showMessageMore(@PluralsRes int msgId, int countNoMedia, int countHasMedia) {
|
|
||||||
activity.showSnackbarAbovePlayer(activity.getResources()
|
|
||||||
.getQuantityString(msgId,
|
|
||||||
(countHasMedia + countNoMedia),
|
|
||||||
(countHasMedia + countNoMedia), countHasMedia),
|
|
||||||
Snackbar.LENGTH_LONG);
|
|
||||||
}
|
|
||||||
|
|
||||||
private long[] getSelectedIds() {
|
private long[] getSelectedIds() {
|
||||||
long[] checkedIds = new long[selectedItems.size()];
|
long[] checkedIds = new long[selectedItems.size()];
|
||||||
for (int i = 0; i < selectedItems.size(); ++i) {
|
for (int i = 0; i < selectedItems.size(); ++i) {
|
||||||
|
|
|
@ -202,8 +202,8 @@
|
||||||
<string name="delete_failed">Unable to delete file. Rebooting the device could help.</string>
|
<string name="delete_failed">Unable to delete file. Rebooting the device could help.</string>
|
||||||
<string name="delete_episode_label">Delete Episode</string>
|
<string name="delete_episode_label">Delete Episode</string>
|
||||||
<plurals name="deleted_multi_episode_batch_label">
|
<plurals name="deleted_multi_episode_batch_label">
|
||||||
<item quantity="one">%d episode selected, %d download deleted.</item>
|
<item quantity="one">1 downloaded episode deleted.</item>
|
||||||
<item quantity="other">%d episodes selected, %d download(s) deleted.</item>
|
<item quantity="other">%d downloaded episodes deleted.</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
<string name="remove_new_flag_label">Remove \"new\" flag</string>
|
<string name="remove_new_flag_label">Remove \"new\" flag</string>
|
||||||
<string name="removed_new_flag_label">Removed \"new\" flag</string>
|
<string name="removed_new_flag_label">Removed \"new\" flag</string>
|
||||||
|
|
Loading…
Reference in New Issue