diff options
author | daneren2005 <daneren2005@gmail.com> | 2013-08-22 09:00:28 -0700 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2013-08-22 09:00:28 -0700 |
commit | 2efcba0e7cc1c7216db2d2cf8fc5a363f75e4810 (patch) | |
tree | dbbc1e8a7aa3ba63c802acc96cb4828e22d0b9d2 | |
parent | 080bafb06fdc9a48a4f8c107addbd9e5d72fb811 (diff) | |
download | dsub-2efcba0e7cc1c7216db2d2cf8fc5a363f75e4810.tar.gz dsub-2efcba0e7cc1c7216db2d2cf8fc5a363f75e4810.tar.bz2 dsub-2efcba0e7cc1c7216db2d2cf8fc5a363f75e4810.zip |
Format duration as -:-- when length is 0
-rw-r--r-- | src/github/daneren2005/dsub/fragments/DownloadFragment.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java index bd5669f0..f6aa15fe 100644 --- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java +++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java @@ -980,7 +980,11 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe int millisTotal = duration == null ? 0 : duration;
positionTextView.setText(Util.formatDuration(millisPlayed / 1000));
- durationTextView.setText(Util.formatDuration(millisTotal / 1000));
+ if(millisTotal > 0) {
+ durationTextView.setText(Util.formatDuration(millisTotal / 1000));
+ } else {
+ durationTextView.setText("-:--");
+ }
progressBar.setMax(millisTotal == 0 ? 100 : millisTotal); // Work-around for apparent bug.
if(!seekInProgress) {
progressBar.setProgress(millisPlayed);
|