Commit c44c351a authored by Sébastien Toque's avatar Sébastien Toque

Display artist & album in the audio list

parent 2a9efd1f
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:layout_marginTop="5dip"
android:text="@string/title"
android:textColor="#ffffff"
android:textSize="20dip" />
<TextView
android:id="@+id/artist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:layout_marginBottom="5dip"
android:text="@string/artist"
android:textColor="#888888"
android:textSize="14dip" />
</LinearLayout>
\ No newline at end of file
......@@ -43,7 +43,7 @@ public class AudioBrowserActivity extends Activity {
mHeader = (HorizontalScrollView) findViewById(R.id.header);
mAudioController = AudioServiceController.getInstance();
mSongsAdapter = new AudioSongsListAdapter(this, android.R.layout.simple_list_item_1);
mSongsAdapter = new AudioSongsListAdapter(this, R.layout.audio_browser_item);
ListView songsList = (ListView) findViewById(R.id.songs_list);
songsList.setAdapter(mSongsAdapter);
......
......@@ -31,14 +31,17 @@ public class AudioSongsListAdapter extends ArrayAdapter<Media> {
View v = convertView;
if (v == null) {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = inflater.inflate(android.R.layout.simple_list_item_1, parent, false);
v = inflater.inflate(R.layout.audio_browser_item, parent, false);
holder = new ViewHolder();
holder.text = (TextView) v.findViewById(android.R.id.text1);
holder.title = (TextView) v.findViewById(R.id.title);
holder.artist = (TextView) v.findViewById(R.id.artist);
v.setTag(holder);
} else
holder = (ViewHolder) v.getTag();
holder.text.setText(getItem(position).getTitle());
Media media = getItem(position);
holder.title.setText(media.getTitle());
holder.artist.setText(media.getArtist() + " - " + media.getAlbum());
return v;
}
......@@ -51,6 +54,7 @@ public class AudioSongsListAdapter extends ArrayAdapter<Media> {
}
static class ViewHolder {
TextView text;
TextView title;
TextView artist;
}
}
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