aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-12-01 22:15:34 -0800
committerScott Jackson <daneren2005@gmail.com>2014-12-01 22:15:34 -0800
commitc76ad76fd3abd8b64ce91a8557618b969a8f7658 (patch)
tree92da5e7dfa5cb80f7e674237b5cd11f3c2805031
parent3f28cdaaa53cfcd592409f869f2e051704f90e06 (diff)
downloaddsub-c76ad76fd3abd8b64ce91a8557618b969a8f7658.tar.gz
dsub-c76ad76fd3abd8b64ce91a8557618b969a8f7658.tar.bz2
dsub-c76ad76fd3abd8b64ce91a8557618b969a8f7658.zip
Change download status to a percentage
-rw-r--r--src/github/daneren2005/dsub/view/SongView.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/view/SongView.java b/src/github/daneren2005/dsub/view/SongView.java
index 630f747f..2fbaedc3 100644
--- a/src/github/daneren2005/dsub/view/SongView.java
+++ b/src/github/daneren2005/dsub/view/SongView.java
@@ -231,7 +231,9 @@ public class SongView extends UpdateView implements Checkable {
}
if (downloadFile.isDownloading() && !downloadFile.isDownloadCancelled() && partialFileExists) {
- statusTextView.setText(Util.formatLocalizedBytes(partialFile.length(), getContext()));
+ double percentage = (partialFile.length() * 100.0) / downloadFile.getEstimatedSize();
+ percentage = Math.min(percentage, 100);
+ statusTextView.setText((int)percentage + " %");
if(!rightImage) {
statusImageView.setVisibility(View.VISIBLE);
rightImage = true;