aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/filemanager/ui/widgets/SelectionView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/cyanogenmod/filemanager/ui/widgets/SelectionView.java')
-rw-r--r--src/com/cyanogenmod/filemanager/ui/widgets/SelectionView.java40
1 files changed, 10 insertions, 30 deletions
diff --git a/src/com/cyanogenmod/filemanager/ui/widgets/SelectionView.java b/src/com/cyanogenmod/filemanager/ui/widgets/SelectionView.java
index 19cb33c7..630b6b04 100644
--- a/src/com/cyanogenmod/filemanager/ui/widgets/SelectionView.java
+++ b/src/com/cyanogenmod/filemanager/ui/widgets/SelectionView.java
@@ -124,38 +124,18 @@ public class SelectionView extends LinearLayout {
}
// Get the string
- if (folders == 1 && files == 0) {
- return getContext().getString(R.string.selection_one_folder, Integer.valueOf(folders));
+ String nFoldersString = getContext().getResources().getQuantityString(R.plurals.n_folders, folders, folders);
+ String nFilesString = getContext().getResources().getQuantityString(R.plurals.n_files, files, files);
+
+ if (files == 0) {
+ return getContext().getString(R.string.selection_folders_or_files, nFoldersString);
}
- if (folders > 1 && files == 0) {
- return getContext().getString(
- R.string.selection_other_folders, Integer.valueOf(folders));
- }
- if (folders == 0 && files == 1) {
- return getContext().getString(R.string.selection_one_file, Integer.valueOf(files));
- }
- if (folders == 0 && files > 1) {
- return getContext().getString(
- R.string.selection_other_files, Integer.valueOf(files));
- }
- if (folders == 1 && files == 1) {
- return getContext().getString(
- R.string.selection_one_folder_one_file,
- Integer.valueOf(folders), Integer.valueOf(files));
- }
- if (folders > 1 && files == 1) {
- return getContext().getString(
- R.string.selection_other_folders_one_file,
- Integer.valueOf(folders), Integer.valueOf(files));
- }
- if (folders == 1 && files > 1) {
- return getContext().getString(
- R.string.selection_one_folder_other_files,
- Integer.valueOf(folders), Integer.valueOf(files));
+
+ if (folders == 0) {
+ return getContext().getString(R.string.selection_folders_or_files, nFilesString);
}
- return getContext().getString(
- R.string.selection_other_folders_other_files,
- Integer.valueOf(folders), Integer.valueOf(files));
+
+ return getContext().getString(R.string.selection_folders_and_files, nFoldersString, nFilesString);
}
/**