change subtitle "items added:"

This commit is contained in:
veliymolfar 2020-03-03 10:49:56 +02:00
parent baa4c87c8d
commit 0849d736b9
2 changed files with 2 additions and 27 deletions

View file

@ -14,9 +14,7 @@
<string name="importing_from">Importing data from %1$s</string>
<string name="shared_string_importing">Importing</string>
<string name="checking_for_duplicate_description">OsmAnd check %1$s for duplicates with existing items in the application.\n\nIt may take some time.</string>
<string name="added_one_item">Added: %1$s item</string>
<string name="added_two_items">Added: %1$s items</string>
<string name="added_five_items">Added: %1$s items</string>
<string name="items_added">Items added: %1$s</string>
<string name="shared_string_quick_action">Quick action</string>
<string name="shared_string_import_complete">Import complete</string>
<string name="import_complete_description">All data from the %1$s is imported, you can use buttons below to open needed part of the application to manage it.</string>

View file

@ -60,7 +60,7 @@ public class ImportedSettingsItemsAdapter extends
listener.onItemClick(currentItem.getType());
}
});
setupSubTitle(holder.subTitle, currentItem.getItems().size());
holder.subTitle.setText(String.format(app.getString(R.string.items_added), String.valueOf(currentItem.getItems().size())));
switch (currentItem.getType()) {
case PROFILE:
@ -94,29 +94,6 @@ public class ImportedSettingsItemsAdapter extends
}
}
private void setupSubTitle(TextView subTitle, int count) {
int stringRes;
if (count > 100)
count %= 100;
if (count > 20)
count %= 10;
switch (count) {
case 1:
stringRes = R.string.added_one_item;
break;
case 2:
case 3:
case 4:
stringRes = R.string.added_two_items;
break;
default:
stringRes = R.string.added_five_items;
break;
}
subTitle.setText(String.format(app.getString(stringRes), String.valueOf(count)));
}
@Override
public int getItemCount() {
return items.size();