aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/drawable-hdpi-v11/stat_notify_download.pngbin0 -> 300 bytes
-rw-r--r--res/drawable-hdpi/stat_notify_download.pngbin0 -> 350 bytes
-rw-r--r--res/drawable-mdpi-v11/stat_notify_download.pngbin0 -> 234 bytes
-rw-r--r--res/drawable-mdpi/stat_notify_download.pngbin0 -> 272 bytes
-rw-r--r--res/drawable-xhdpi-v11/stat_notify_download.pngbin0 -> 379 bytes
-rw-r--r--res/drawable-xhdpi/stat_notify_download.pngbin0 -> 404 bytes
-rw-r--r--res/drawable-xxhdpi-v11/stat_notify_download.pngbin0 -> 531 bytes
-rw-r--r--res/drawable-xxhdpi/stat_notify_download.pngbin0 -> 558 bytes
-rw-r--r--src/github/daneren2005/dsub/activity/DownloadActivity.java6
-rw-r--r--src/github/daneren2005/dsub/activity/MainActivity.java3
-rw-r--r--src/github/daneren2005/dsub/fragments/DownloadFragment.java7
-rw-r--r--src/github/daneren2005/dsub/service/DownloadServiceImpl.java11
-rw-r--r--src/github/daneren2005/dsub/util/Util.java2
13 files changed, 28 insertions, 1 deletions
diff --git a/res/drawable-hdpi-v11/stat_notify_download.png b/res/drawable-hdpi-v11/stat_notify_download.png
new file mode 100644
index 00000000..48ca6924
--- /dev/null
+++ b/res/drawable-hdpi-v11/stat_notify_download.png
Binary files differ
diff --git a/res/drawable-hdpi/stat_notify_download.png b/res/drawable-hdpi/stat_notify_download.png
new file mode 100644
index 00000000..aa1b6c92
--- /dev/null
+++ b/res/drawable-hdpi/stat_notify_download.png
Binary files differ
diff --git a/res/drawable-mdpi-v11/stat_notify_download.png b/res/drawable-mdpi-v11/stat_notify_download.png
new file mode 100644
index 00000000..4164e0fa
--- /dev/null
+++ b/res/drawable-mdpi-v11/stat_notify_download.png
Binary files differ
diff --git a/res/drawable-mdpi/stat_notify_download.png b/res/drawable-mdpi/stat_notify_download.png
new file mode 100644
index 00000000..4c2a22de
--- /dev/null
+++ b/res/drawable-mdpi/stat_notify_download.png
Binary files differ
diff --git a/res/drawable-xhdpi-v11/stat_notify_download.png b/res/drawable-xhdpi-v11/stat_notify_download.png
new file mode 100644
index 00000000..96ceb383
--- /dev/null
+++ b/res/drawable-xhdpi-v11/stat_notify_download.png
Binary files differ
diff --git a/res/drawable-xhdpi/stat_notify_download.png b/res/drawable-xhdpi/stat_notify_download.png
new file mode 100644
index 00000000..bd4cb567
--- /dev/null
+++ b/res/drawable-xhdpi/stat_notify_download.png
Binary files differ
diff --git a/res/drawable-xxhdpi-v11/stat_notify_download.png b/res/drawable-xxhdpi-v11/stat_notify_download.png
new file mode 100644
index 00000000..b2dc5651
--- /dev/null
+++ b/res/drawable-xxhdpi-v11/stat_notify_download.png
Binary files differ
diff --git a/res/drawable-xxhdpi/stat_notify_download.png b/res/drawable-xxhdpi/stat_notify_download.png
new file mode 100644
index 00000000..9d9a7f3e
--- /dev/null
+++ b/res/drawable-xxhdpi/stat_notify_download.png
Binary files differ
diff --git a/src/github/daneren2005/dsub/activity/DownloadActivity.java b/src/github/daneren2005/dsub/activity/DownloadActivity.java
index 447bbb34..d8ebb98a 100644
--- a/src/github/daneren2005/dsub/activity/DownloadActivity.java
+++ b/src/github/daneren2005/dsub/activity/DownloadActivity.java
@@ -38,6 +38,7 @@ import github.daneren2005.dsub.domain.MusicDirectory;
import github.daneren2005.dsub.service.DownloadFile;
import github.daneren2005.dsub.service.MusicService;
import github.daneren2005.dsub.service.MusicServiceFactory;
+import github.daneren2005.dsub.util.Constants;
import github.daneren2005.dsub.util.SilentBackgroundTask;
import github.daneren2005.dsub.util.Util;
import java.util.LinkedList;
@@ -57,6 +58,11 @@ public class DownloadActivity extends SubsonicActivity {
if (findViewById(R.id.download_container) != null && savedInstanceState == null) {
currentFragment = new DownloadFragment();
+ if(getIntent().hasExtra(Constants.INTENT_EXTRA_NAME_DOWNLOAD_VIEW)) {
+ Bundle args = new Bundle();
+ args.putBoolean(Constants.INTENT_EXTRA_NAME_DOWNLOAD_VIEW, true);
+ currentFragment.setArguments(args);
+ }
currentFragment.setPrimaryFragment(true);
getSupportFragmentManager().beginTransaction().add(R.id.download_container, currentFragment, currentFragment.getSupportTag() + "").commit();
}
diff --git a/src/github/daneren2005/dsub/activity/MainActivity.java b/src/github/daneren2005/dsub/activity/MainActivity.java
index 8aa68b3d..9dbc2b5e 100644
--- a/src/github/daneren2005/dsub/activity/MainActivity.java
+++ b/src/github/daneren2005/dsub/activity/MainActivity.java
@@ -57,6 +57,9 @@ public class MainActivity extends SubsonicActivity {
getIntent().removeExtra(Constants.INTENT_EXTRA_NAME_DOWNLOAD);
Intent intent = new Intent();
intent.setClass(this, DownloadActivity.class);
+ if(getIntent().hasExtra(Constants.INTENT_EXTRA_NAME_DOWNLOAD_VIEW)) {
+ intent.putExtra(Constants.INTENT_EXTRA_NAME_DOWNLOAD_VIEW, true);
+ }
startActivity(intent);
}
setContentView(R.layout.main);
diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
index 72186ff1..bf47e95e 100644
--- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java
+++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
@@ -120,6 +120,13 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
startFlipped = true;
}
}
+ Bundle args = getArguments();
+ if(args != null) {
+ if(args.getBoolean(Constants.INTENT_EXTRA_NAME_DOWNLOAD_VIEW)) {
+ startFlipped = true;
+ nowPlaying = false;
+ }
+ }
}
@Override
diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 26ca7f11..2df1f30a 100644
--- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -115,6 +115,8 @@ public class DownloadServiceImpl extends Service implements DownloadService {
private PowerManager.WakeLock wakeLock;
private boolean keepScreenOn;
private int cachedPosition = 0;
+ private long downloadRevision;
+ private boolean downloadOngoing = false;
private static boolean equalizerAvailable;
private static boolean visualizerAvailable;
@@ -1423,6 +1425,15 @@ public class DownloadServiceImpl extends Service implements DownloadService {
}
}
+ if(!backgroundDownloadList.isEmpty() && downloadRevision != revision) {
+ Util.showDownloadingNotification(this, this, currentDownloading, backgroundDownloadList.size(), handler);
+ downloadRevision = revision;
+ downloadOngoing = true;
+ } else if(backgroundDownloadList.isEmpty() && downloadOngoing) {
+ Util.hideDownloadingNotification(this, this, handler);
+ downloadOngoing = false;
+ }
+
// Delete obsolete .partial and .complete files.
cleanup();
}
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java
index ce3621fb..f5638110 100644
--- a/src/github/daneren2005/dsub/util/Util.java
+++ b/src/github/daneren2005/dsub/util/Util.java
@@ -936,7 +936,7 @@ public final class Util {
public static void showDownloadingNotification(final Context context, final DownloadServiceImpl downloadService, DownloadFile file, int size, Handler handler) {
NotificationCompat.Builder builder;
builder = new NotificationCompat.Builder(context)
- .setSmallIcon(R.drawable.downloading)
+ .setSmallIcon(R.drawable.stat_notify_download)
.setContentTitle("Downloading " + size + " songs")
.setContentText("Current: " + file.getSong().getTitle())
.setProgress(10, 5, true);