[Android] DirectoryAdapter: Don't label every file as a song

Edward Wang git at videolan.org
Sun Dec 2 16:11:31 CET 2012


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sun Dec  2 10:10:59 2012 -0500| [1beb291afea3fd539136239c606deae1baf92883] | committer: Edward Wang

DirectoryAdapter: Don't label every file as a song

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=1beb291afea3fd539136239c606deae1baf92883
---

 vlc-android/res/values/strings.xml                         |    4 ++++
 vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java |   10 +++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 93e98a6..920dc3d 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -54,6 +54,10 @@
         <item quantity="one">1 subfolder</item>
         <item quantity="other">%d subfolders</item>
     </plurals>
+    <plurals name="mediafiles_quantity">
+        <item quantity="one">1 media file</item>
+        <item quantity="other">%d media files</item>
+    </plurals>
 
     <string name="internal_memory">Internal memory</string>
     <string name="parent_folder">Up to parent folder</string>
diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
index 65cc8a0..4e41bf3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
@@ -277,19 +277,19 @@ public class DirectoryAdapter extends BaseAdapter {
             holderText = context.getString(R.string.parent_folder);
         else if(!selectedNode.isFile()) {
             int folderCount = selectedNode.subfolderCount();
-            int songCount = selectedNode.subfilesCount();
+            int mediaFileCount = selectedNode.subfilesCount();
             holderText = "";
 
             if(folderCount > 0)
                 holderText += context.getResources().getQuantityString(
                         R.plurals.subfolders_quantity, folderCount, folderCount
                 );
-            if(folderCount > 0 && songCount > 0)
+            if(folderCount > 0 && mediaFileCount > 0)
                 holderText += ", ";
-            if(songCount > 0)
+            if(mediaFileCount > 0)
                 holderText += context.getResources().getQuantityString(
-                        R.plurals.songs_quantity, songCount, songCount
-                );
+                        R.plurals.mediafiles_quantity, mediaFileCount,
+                        mediaFileCount);
         }
         holder.text.setText(holderText);
         if(selectedNode.isFile())



More information about the Android mailing list