Commit 6296a679 authored by Edward Wang's avatar Edward Wang Committed by Sébastien Toque
Browse files

AudioPlaylistAdaptor: Account for plurals


Signed-off-by: Sébastien Toque's avatarSébastien Toque <xilasz@gmail.com>
parent 0142f770
......@@ -31,6 +31,10 @@
<string name="unknown_artist">Unknown Artist</string>
<string name="unknown_album">Unknown Album</string>
<string name="songs">Songs</string>
<plurals name="songs">
<item quantity="one">1 song</item>
<item quantity="other">%d songs</item>
</plurals>
<string name="artists">Artists</string>
<string name="albums">Albums</string>
<string name="genres">Genres</string>
......
......@@ -25,6 +25,7 @@ import java.util.HashMap;
import java.util.List;
import android.content.Context;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -82,8 +83,8 @@ public class AudioPlaylistAdapter extends ArrayAdapter<String> {
String name = mTitles.get(position);
ArrayList<Media> list = mPlaylists.get(name);
holder.title.setText(name);
holder.text.setText(R.string.songs);
holder.text.setText(list.size() + " " + holder.text.getText());
Resources res = getContext().getResources();
holder.text.setText(res.getQuantityString(R.plurals.songs, list.size(), list.size()));
return v;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment