diff options
-rw-r--r-- | subsonic-android/res/layout/select_album_header.xml | 13 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/subsonic-android/res/layout/select_album_header.xml b/subsonic-android/res/layout/select_album_header.xml index 63e91887..3af34a99 100644 --- a/subsonic-android/res/layout/select_album_header.xml +++ b/subsonic-android/res/layout/select_album_header.xml @@ -55,6 +55,19 @@ android:textSize="10sp" android:singleLine="true" android:ellipsize="none"/> + + <TextView + android:text="0:00" + android:id="@+id/select_album_song_length" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/select_album_song_count" + android:layout_toRightOf="@+id/select_album_art" + android:paddingRight="4dip" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textSize="10sp" + android:singleLine="true" + android:ellipsize="none"/> </RelativeLayout> diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 1e4bfc07..8cd66f5f 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -643,12 +643,17 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter int songCount = 0;
Set<String> artists = new HashSet<String>();
+ Integer totalDuration = 0;
for (MusicDirectory.Entry entry : entries) {
if (!entry.isDirectory()) {
songCount++;
if (entry.getArtist() != null) {
artists.add(entry.getArtist());
}
+ Integer duration = entry.getDuration();
+ if(duration != null) {
+ totalDuration += duration;
+ }
}
}
@@ -663,6 +668,9 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter TextView songCountView = (TextView) header.findViewById(R.id.select_album_song_count);
String s = context.getResources().getQuantityString(R.plurals.select_album_n_songs, songCount, songCount);
songCountView.setText(s.toUpperCase());
+
+ TextView songLengthView = (TextView) header.findViewById(R.id.select_album_song_length);
+ songLengthView.setText(Util.formatDuration(totalDuration));
if(add) {
return header;
|