From 48b6a05198889ac4a3f594c4715cb83d1a58d3a7 Mon Sep 17 00:00:00 2001 From: daneren2005 Date: Tue, 12 Nov 2013 16:35:27 -0800 Subject: Add position to bookmark view --- src/github/daneren2005/dsub/view/BookmarkAdapter.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/github/daneren2005/dsub/view/BookmarkAdapter.java b/src/github/daneren2005/dsub/view/BookmarkAdapter.java index 2ee8a31d..2ea7bf73 100644 --- a/src/github/daneren2005/dsub/view/BookmarkAdapter.java +++ b/src/github/daneren2005/dsub/view/BookmarkAdapter.java @@ -38,7 +38,8 @@ public class BookmarkAdapter extends ArrayAdapter { } public View getView(int position, View convertView, ViewGroup parent) { - MusicDirectory.Entry entry = getItem(position).getEntry(); + Bookmark bookmark = getItem(position); + MusicDirectory.Entry entry = bookmark.getEntry(); SongView view; if (convertView != null) { view = (SongView) convertView; @@ -46,6 +47,12 @@ public class BookmarkAdapter extends ArrayAdapter { view = new SongView(activity); } view.setObject(entry, false); + + // Add current position to duration + TextView durationTextView = (TextView) view.findViewById(R.id.song_duration); + String duration = durationTextView.getText().toString(); + durationTextView.setText(Util.formatDuration(bookmark.getPosition()) + " / " + duration); + return view; } } -- cgit v1.2.3