aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-08-09 12:20:02 -0700
committerScott Jackson <daneren2005@gmail.com>2015-08-09 12:20:02 -0700
commit01f6eb5e7f1b66e4bbba63debe018947d96f981e (patch)
tree197680819c4c18f6c1fc07c0473ed1a568682882 /app/src
parent9facf300386936ef21e103df479e4d84f27767cb (diff)
downloaddsub-01f6eb5e7f1b66e4bbba63debe018947d96f981e.tar.gz
dsub-01f6eb5e7f1b66e4bbba63debe018947d96f981e.tar.bz2
dsub-01f6eb5e7f1b66e4bbba63debe018947d96f981e.zip
Fix repeat not updating
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java40
1 files changed, 20 insertions, 20 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
index cc4fd9f0..bc645e0c 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
@@ -117,10 +117,9 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
private ImageButton bookmarkButton;
private ImageButton rateBadButton;
private ImageButton rateGoodButton;
- private View mainLayout;
+
private ScheduledExecutorService executorService;
private DownloadFile currentPlaying;
- private long currentRevision;
private int swipeDistance;
private int swipeVelocity;
private ScheduledFuture<?> hideControlsFuture;
@@ -159,8 +158,6 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
rootView = inflater.inflate(R.layout.download, container, false);
setTitle(R.string.button_bar_now_playing);
- mainLayout = rootView.findViewById(R.id.download_layout);
-
WindowManager w = context.getWindowManager();
Display d = w.getDefaultDisplay();
swipeDistance = (d.getWidth() + d.getHeight()) * PERCENTAGE_OF_SCREEN_FOR_SWIPE / 100;
@@ -220,7 +217,6 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
DownloadService downloadService = getDownloadService();
downloadService.remove(downloadFile);
songListAdapter.removeItem(downloadFile);
- currentRevision = downloadService.getDownloadListUpdateRevision();
}
});
touchHelper.attachToRecyclerView(playlistView);
@@ -371,6 +367,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
default:
break;
}
+ updateRepeatButton();
setControlsVisible(true);
}
});
@@ -808,6 +805,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
downloadService.startRemoteScan();
downloadService.addOnSongChangedListener(NowPlayingFragment.this, true);
}
+ updateRepeatButton();
}
});
}
@@ -1329,21 +1327,6 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
}
emptyTextView.setVisibility(songs.isEmpty() ? View.VISIBLE : View.GONE);
- currentRevision = downloadService.getDownloadListUpdateRevision();
-
- switch (downloadService.getRepeatMode()) {
- case OFF:
- repeatButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.media_button_repeat_off));
- break;
- case ALL:
- repeatButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.media_button_repeat_all));
- break;
- case SINGLE:
- repeatButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.media_button_repeat_single));
- break;
- default:
- break;
- }
if(scrollWhenLoaded) {
scrollToCurrent();
@@ -1434,4 +1417,21 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
break;
}
}
+
+ public void updateRepeatButton() {
+ DownloadService downloadService = getDownloadService();
+ switch (downloadService.getRepeatMode()) {
+ case OFF:
+ repeatButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.media_button_repeat_off));
+ break;
+ case ALL:
+ repeatButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.media_button_repeat_all));
+ break;
+ case SINGLE:
+ repeatButton.setImageResource(DrawableTint.getDrawableRes(context, R.attr.media_button_repeat_single));
+ break;
+ default:
+ break;
+ }
+ }
}