From 681584458f9aecf230544d6fbec6e3a3f5167cb2 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 28 Sep 2012 20:48:11 -0700 Subject: Add background download/cache method to rest of app --- subsonic-android/res/menu/select_album_context.xml | 5 +++++ subsonic-android/res/menu/select_artist_context.xml | 5 +++++ .../github/daneren2005/dsub/activity/SearchActivity.java | 11 +++++++---- .../daneren2005/dsub/activity/SelectAlbumActivity.java | 13 ++++++++----- .../daneren2005/dsub/activity/SelectArtistActivity.java | 11 +++++++---- .../daneren2005/dsub/activity/SubsonicTabActivity.java | 15 ++++++++------- 6 files changed, 40 insertions(+), 20 deletions(-) (limited to 'subsonic-android') diff --git a/subsonic-android/res/menu/select_album_context.xml b/subsonic-android/res/menu/select_album_context.xml index a43ef78a..95ff22ca 100644 --- a/subsonic-android/res/menu/select_album_context.xml +++ b/subsonic-android/res/menu/select_album_context.xml @@ -17,6 +17,11 @@ /> + + diff --git a/subsonic-android/res/menu/select_artist_context.xml b/subsonic-android/res/menu/select_artist_context.xml index c1b201f7..17f12162 100644 --- a/subsonic-android/res/menu/select_artist_context.xml +++ b/subsonic-android/res/menu/select_artist_context.xml @@ -15,6 +15,11 @@ android:id="@+id/artist_menu_play_last" android:title="@string/common.play_last" /> + + > task = new ModalBackgroundTask>(this, false) { private static final int MAX_SONGS = 500; @@ -279,8 +275,13 @@ public class SubsonicTabActivity extends SherlockActivity { downloadService.clear(); } warnIfNetworkOrStorageUnavailable(); - downloadService.download(songs, save, autoplay, false, shuffle); - Util.startActivityWithoutTransition(SubsonicTabActivity.this, DownloadActivity.class); + if(!background) { + downloadService.download(songs, save, autoplay, false, shuffle); + Util.startActivityWithoutTransition(SubsonicTabActivity.this, DownloadActivity.class); + } + else { + downloadService.downloadBackground(songs, save); + } } } }; -- cgit v1.2.3