From 96dd7206b3ce02a2474394e392f6c268e45c3e15 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 14 Dec 2012 20:17:12 -0800 Subject: Added song info to now playing song context menu as well --- .../dsub/activity/DownloadActivity.java | 3 +++ .../dsub/activity/SelectAlbumActivity.java | 24 ---------------------- .../dsub/activity/SubsonicTabActivity.java | 24 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 24 deletions(-) (limited to 'subsonic-android/src/github/daneren2005') diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java index abb6f6bd..78e4e44c 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java @@ -657,6 +657,9 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi songs.add(song.getSong()); addToPlaylist(songs); return true; + case R.id.menu_info: + displaySongInfo(song.getSong()); + return true; default: return false; } diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java index 105bb5c5..9ca1744f 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java @@ -731,28 +731,4 @@ public class SelectAlbumActivity extends SubsonicTabActivity { } }.execute(); } - - private void displaySongInfo(final MusicDirectory.Entry song) { - String msg = "Artist: " + song.getArtist() + "\nAlbum: " + song.getAlbum(); - if(!song.getGenre().isEmpty()) { - msg += "\nGenre: " + song.getGenre(); - } - if(song.getYear() != null && song.getYear() != 0) { - msg += "\nYear: " + song.getYear(); - } - msg += "\nFormat: " + song.getSuffix(); - if(song.getBitRate() != null && song.getBitRate() != 0) { - msg += "\nBitrate: " + song.getBitRate() + " kpbs"; - } - if(song.getDuration() != null && song.getDuration() != 0) { - msg += "\nLength: " + Util.formatDuration(song.getDuration()); - } - msg += "\nSize: " + Util.formatBytes(song.getSize()); - - new AlertDialog.Builder(this) - .setIcon(android.R.drawable.ic_dialog_alert) - .setTitle(song.getTitle()) - .setMessage(msg) - .show(); - } } diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicTabActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicTabActivity.java index c6edeef9..19e01045 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicTabActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicTabActivity.java @@ -484,6 +484,30 @@ public class SubsonicTabActivity extends SherlockActivity { AlertDialog dialog = builder.create(); dialog.show(); } + + public void displaySongInfo(final MusicDirectory.Entry song) { + String msg = "Artist: " + song.getArtist() + "\nAlbum: " + song.getAlbum(); + if(!song.getGenre().isEmpty()) { + msg += "\nGenre: " + song.getGenre(); + } + if(song.getYear() != null && song.getYear() != 0) { + msg += "\nYear: " + song.getYear(); + } + msg += "\nFormat: " + song.getSuffix(); + if(song.getBitRate() != null && song.getBitRate() != 0) { + msg += "\nBitrate: " + song.getBitRate() + " kpbs"; + } + if(song.getDuration() != null && song.getDuration() != 0) { + msg += "\nLength: " + Util.formatDuration(song.getDuration()); + } + msg += "\nSize: " + Util.formatBytes(song.getSize()); + + new AlertDialog.Builder(this) + .setIcon(android.R.drawable.ic_dialog_alert) + .setTitle(song.getTitle()) + .setMessage(msg) + .show(); + } private void setUncaughtExceptionHandler() { Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler(); -- cgit v1.2.3