aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-08-05 08:03:26 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-08-05 08:03:26 -0700
commitdde001058b613e75a3e71e238231a299dcde0b56 (patch)
treebe79249ea0549eb2d473d9561ca905f5f341d8da
parent6426e8d7ba1a31ba400e65956edb912c2c8aeb00 (diff)
downloaddsub-dde001058b613e75a3e71e238231a299dcde0b56.tar.gz
dsub-dde001058b613e75a3e71e238231a299dcde0b56.tar.bz2
dsub-dde001058b613e75a3e71e238231a299dcde0b56.zip
Put back toast for position change in song
-rw-r--r--src/github/daneren2005/dsub/fragments/DownloadFragment.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
index 94c2a02a..1940d426 100644
--- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java
+++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
@@ -103,6 +103,7 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
private ScheduledFuture<?> hideControlsFuture;
private SongListAdapter songListAdapter;
private SilentBackgroundTask<Void> onProgressChangedTask;
+ private boolean seekInProgress = false;
/**
* Called when the activity is first created.
@@ -378,6 +379,7 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
@Override
protected void done(Void result) {
+ seekInProgress = false;
DownloadFragment.this.onProgressChanged();
}
}.execute();
@@ -385,12 +387,15 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
@Override
public void onStartTrackingTouch(final SeekBar seekBar) {
-
+ seekInProgress = true;
}
@Override
- public void onProgressChanged(final SeekBar seekBar, final int progress, final boolean fromUser) {
-
+ public void onProgressChanged(final SeekBar seekBar, final int position, final boolean fromUser) {
+ if (fromUser) {
+ Util.toast(context, Util.formatDuration(position / 1000), true);
+ setControlsVisible(true);
+ }
}
});
playlistView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@@ -976,7 +981,9 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
positionTextView.setText(Util.formatDuration(millisPlayed / 1000));
durationTextView.setText(Util.formatDuration(millisTotal / 1000));
progressBar.setMax(millisTotal == 0 ? 100 : millisTotal); // Work-around for apparent bug.
- progressBar.setProgress(millisPlayed);
+ if(!seekInProgress) {
+ progressBar.setProgress(millisPlayed);
+ }
progressBar.setEnabled(currentPlaying.isWorkDone() || isJukeboxEnabled);
} else {
positionTextView.setText("0:00");