aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-01-19 17:59:17 -0800
committerScott Jackson <daneren2005@gmail.com>2015-01-19 17:59:17 -0800
commit9062e725205761215b61d019af6e49869487c32e (patch)
treefa53059fdf626e3324dbc41fde6f3971093ce485 /src
parent3e7603a1f3a6b79b64a9a5eda68cfa0de5df1394 (diff)
parentd0ac7ea39ee09aee45d02b21be8b8a0a68887bf9 (diff)
downloaddsub-9062e725205761215b61d019af6e49869487c32e.tar.gz
dsub-9062e725205761215b61d019af6e49869487c32e.tar.bz2
dsub-9062e725205761215b61d019af6e49869487c32e.zip
Merge remote-tracking branch 'origin/DLNA' into DLNA
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/fragments/NowPlayingFragment.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java
index b5d3e392..c0f528de 100644
--- a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java
+++ b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java
@@ -84,12 +84,9 @@ import github.daneren2005.dsub.activity.SubsonicActivity;
public class NowPlayingFragment extends SubsonicFragment implements OnGestureListener {
private static final String TAG = NowPlayingFragment.class.getSimpleName();
-
- public static final int DIALOG_SAVE_PLAYLIST = 100;
private static final int PERCENTAGE_OF_SCREEN_FOR_SWIPE = 10;
- private static final int COLOR_BUTTON_ENABLED = Color.rgb(51, 181, 229);
- private static final int COLOR_BUTTON_DISABLED = Color.rgb(206, 213, 211);
private static final int INCREMENT_TIME = 5000;
+ private static final int SERVICE_BACKOFF = 200;
private static final int ACTION_PREVIOUS = 1;
private static final int ACTION_NEXT = 2;
@@ -873,6 +870,21 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
}
if(downloadService != null) {
downloadService.startRemoteScan();
+ } else {
+ // Make sure to call remote scan once the service is ready
+ final Runnable waitForService = new Runnable() {
+ @Override
+ public void run() {
+ DownloadService service = getDownloadService();
+ if(service != null) {
+ service.startRemoteScan();
+ } else {
+ handler.postDelayed(this, SERVICE_BACKOFF);
+ }
+ }
+ };
+
+ handler.postDelayed(waitForService, SERVICE_BACKOFF);
}
}
@@ -1009,7 +1021,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
lengthBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- if(fromUser) {
+ if (fromUser) {
int length = getMinutes(progress);
lengthBox.setText(Util.formatDuration(length));
seekBar.setProgress(progress);