aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2012-12-14 20:17:12 -0800
committerScott Jackson <daneren2005@gmail.com>2012-12-14 20:17:12 -0800
commit96dd7206b3ce02a2474394e392f6c268e45c3e15 (patch)
tree75123258f26da7c666cc161aa005878ff47ab0f3
parent6571db53c69e594d658881e1ac1c7fc79b4828c8 (diff)
downloaddsub-96dd7206b3ce02a2474394e392f6c268e45c3e15.tar.gz
dsub-96dd7206b3ce02a2474394e392f6c268e45c3e15.tar.bz2
dsub-96dd7206b3ce02a2474394e392f6c268e45c3e15.zip
Added song info to now playing song context menu as well
-rw-r--r--subsonic-android/res/menu/nowplaying_context.xml5
-rw-r--r--subsonic-android/res/menu/nowplaying_context_offline.xml5
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java3
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java24
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SubsonicTabActivity.java24
5 files changed, 37 insertions, 24 deletions
diff --git a/subsonic-android/res/menu/nowplaying_context.xml b/subsonic-android/res/menu/nowplaying_context.xml
index 82ef2e8b..f42c3644 100644
--- a/subsonic-android/res/menu/nowplaying_context.xml
+++ b/subsonic-android/res/menu/nowplaying_context.xml
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/menu_info"
+ android:title="@string/common.info"
+ />
+
<item
android:id="@+id/menu_show_album"
android:title="@string/download.menu_show_album"/>
diff --git a/subsonic-android/res/menu/nowplaying_context_offline.xml b/subsonic-android/res/menu/nowplaying_context_offline.xml
index 25d5031b..78fa6ba8 100644
--- a/subsonic-android/res/menu/nowplaying_context_offline.xml
+++ b/subsonic-android/res/menu/nowplaying_context_offline.xml
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/menu_info"
+ android:title="@string/common.info"
+ />
+
<item
android:id="@+id/menu_show_album"
android:title="@string/download.menu_show_album"/>
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();