From fc97be950bae9d18e98bb0a0cfa4dcff8d1737af Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 21 Mar 2014 23:35:18 -0700 Subject: Just remove download speed, sucky approximation anyways --- res/values-es/strings.xml | 1 - res/values-hu/strings.xml | 3 +-- res/values/strings.xml | 3 +-- src/github/daneren2005/dsub/service/DownloadService.java | 16 +--------------- src/github/daneren2005/dsub/util/Util.java | 11 +++-------- 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 @@ En este momento: %1$s Actual: %1$s \nTamaño medio: %2$s - \nVelocidad media: %3$s kbps Error al cargar 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 @@ %1$d dal letöltése Aktuális: %1$s Aktuális: %1$s - \nBecsült méret: %2$s - \nÁtlagos sebesség: %3$s kbps + \nBecsült méret: %2$s Failed to load DSub: Új média érhető el! 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 @@ Downloading %1$d songs Current: %1$s Current: %1$s - \nEstimated Size: %2$s - \nAverage Speed: %3$s kbps + \nEstimated Size: %2$s Failed to load DSub: New media is available 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, -- cgit v1.2.3