aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-03-21 23:35:18 -0700
committerScott Jackson <daneren2005@gmail.com>2014-03-21 23:35:18 -0700
commitfc97be950bae9d18e98bb0a0cfa4dcff8d1737af (patch)
treeb3de44857c0a001ce6415bf2030bf6e158d3f9aa
parent89a25eb7653fc351c5519f35ca5e09c9ece53eea (diff)
downloaddsub-fc97be950bae9d18e98bb0a0cfa4dcff8d1737af.tar.gz
dsub-fc97be950bae9d18e98bb0a0cfa4dcff8d1737af.tar.bz2
dsub-fc97be950bae9d18e98bb0a0cfa4dcff8d1737af.zip
Just remove download speed, sucky approximation anyways
-rw-r--r--res/values-es/strings.xml1
-rw-r--r--res/values-hu/strings.xml3
-rw-r--r--res/values/strings.xml3
-rw-r--r--src/github/daneren2005/dsub/service/DownloadService.java16
-rw-r--r--src/github/daneren2005/dsub/util/Util.java11
5 files changed, 6 insertions, 28 deletions
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 2b7a62b8..0b3233e0 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -194,7 +194,6 @@
<string name="download.downloading_summary">En este momento: %1$s</string>
<string name="download.downloading_summary_expanded">Actual: %1$s
\nTamaño medio: %2$s
- \nVelocidad media: %3$s kbps
</string>
<string name="download.failed_to_load">Error al cargar</string>
diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml
index cb8df267..9bf9a811 100644
--- a/res/values-hu/strings.xml
+++ b/res/values-hu/strings.xml
@@ -195,8 +195,7 @@
<string name="download.downloading_title">%1$d dal letöltése</string>
<string name="download.downloading_summary">Aktuális: %1$s</string>
<string name="download.downloading_summary_expanded">Aktuális: %1$s
- \nBecsült méret: %2$s
- \nÁtlagos sebesség: %3$s kbps</string>
+ \nBecsült méret: %2$s</string>
<string name="download.failed_to_load">Failed to load</string>
<string name="sync.title">DSub: Új média érhető el!</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 55784d31..59557509 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -195,8 +195,7 @@
<string name="download.downloading_title">Downloading %1$d songs</string>
<string name="download.downloading_summary">Current: %1$s</string>
<string name="download.downloading_summary_expanded">Current: %1$s
- \nEstimated Size: %2$s
- \nAverage Speed: %3$s kbps</string>
+ \nEstimated Size: %2$s</string>
<string name="download.failed_to_load">Failed to load</string>
<string name="sync.title">DSub: New media is available</string>
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java
index cb2fdcb2..9c7cb459 100644
--- a/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/src/github/daneren2005/dsub/service/DownloadService.java
@@ -130,7 +130,6 @@ public class DownloadService extends Service {
private int cachedPosition = 0;
private long downloadRevision;
private boolean downloadOngoing = false;
- private DownloadFile lastDownloaded = null;
private AudioEffectsController effectsController;
private boolean showVisualization;
@@ -1592,25 +1591,12 @@ public class DownloadService extends Service {
}
if(!backgroundDownloadList.isEmpty()) {
- DownloadFile speedFile = null;
- // Updating existing notification
- if(downloadOngoing) {
- // Changing download, use speed of last DownloadFile
- if(revision != downloadRevision && lastDownloaded != null) {
- speedFile = lastDownloaded;
- } else {
- // Updated mid-download
- speedFile = currentDownloading;
- }
- }
- Util.showDownloadingNotification(this, currentDownloading, backgroundDownloadList.size(), speedFile);
+ Util.showDownloadingNotification(this, currentDownloading, backgroundDownloadList.size());
downloadRevision = revision;
- lastDownloaded = currentDownloading;
downloadOngoing = true;
} else if(backgroundDownloadList.isEmpty() && downloadOngoing) {
Util.hideDownloadingNotification(this);
downloadOngoing = false;
- lastDownloaded = null;
}
// Delete obsolete .partial and .complete files.
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java
index 72886329..4243c853 100644
--- a/src/github/daneren2005/dsub/util/Util.java
+++ b/src/github/daneren2005/dsub/util/Util.java
@@ -1113,12 +1113,12 @@ public final class Util {
DSubWidgetProvider.notifyInstances(context, downloadService, false);
}
- public static void showDownloadingNotification(final Context context, DownloadFile file, int size, DownloadFile speedFile) {
+ public static void showDownloadingNotification(final Context context, DownloadFile file, int size) {
Intent cancelIntent = new Intent(context, DownloadService.class);
cancelIntent.setAction(DownloadService.CANCEL_DOWNLOADS);
PendingIntent cancelPI = PendingIntent.getService(context, 0, cancelIntent, 0);
- String currentDownloading, currentSize, speed;
+ String currentDownloading, currentSize;
if(file != null) {
currentDownloading = file.getSong().getTitle();
currentSize = Util.formatBytes(file.getEstimatedSize());
@@ -1126,11 +1126,6 @@ public final class Util {
currentDownloading = "none";
currentSize = "0";
}
- if(speedFile != null) {
- speed = Long.toString(speedFile.getBytesPerSecond() / 1024);
- } else {
- speed = "0";
- }
NotificationCompat.Builder builder;
builder = new NotificationCompat.Builder(context)
@@ -1138,7 +1133,7 @@ public final class Util {
.setContentTitle(context.getResources().getString(R.string.download_downloading_title, size))
.setContentText(context.getResources().getString(R.string.download_downloading_summary, currentDownloading))
.setStyle(new NotificationCompat.BigTextStyle()
- .bigText(context.getResources().getString(R.string.download_downloading_summary_expanded, currentDownloading, currentSize, speed)))
+ .bigText(context.getResources().getString(R.string.download_downloading_summary_expanded, currentDownloading, currentSize)))
.setProgress(10, 5, true)
.setOngoing(true)
.addAction(R.drawable.notification_close,