diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-07-28 19:29:28 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-07-28 19:29:28 -0700 |
commit | 81570c6ce1aa73de1f8b5fdd190fc755c421f5c5 (patch) | |
tree | 7b3984ab78c618a676b06145d7c59c8d79a91f23 /src | |
parent | dbc03b1be00abbec09204ea018f7d8e0e6d28a20 (diff) | |
download | dsub-81570c6ce1aa73de1f8b5fdd190fc755c421f5c5.tar.gz dsub-81570c6ce1aa73de1f8b5fdd190fc755c421f5c5.tar.bz2 dsub-81570c6ce1aa73de1f8b5fdd190fc755c421f5c5.zip |
Fix relying on revision to update bottom bar
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index 33adcb37..feec5149 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -80,7 +80,8 @@ public class SubsonicFragmentActivity extends SubsonicActivity { private TextView artistView;
private ImageButton startButton;
private long lastBackPressTime = 0;
- private long currentRevision = -1;
+ private DownloadFile currentPlaying;
+ private PlayerState currentState;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -411,15 +412,16 @@ public class SubsonicFragmentActivity extends SubsonicActivity { if (downloadService == null) {
return;
}
-
- long revision = downloadService.getDownloadListUpdateRevision();
- if(currentRevision == revision) {
+
+ DownloadFile current = downloadService.getCurrentPlaying();
+ PlayerState state = downloadService.getPlayerState();
+ if(current == currentPlaying && state == currentState) {
return;
} else {
- currentRevision = revision;
+ currentPlaying = current;
+ currentState = state;
}
- DownloadFile current = downloadService.getCurrentPlaying();
if(current == null) {
trackView.setText("Title");
artistView.setText("Artist");
@@ -431,7 +433,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity { trackView.setText(song.getTitle());
artistView.setText(song.getArtist());
getImageLoader().loadImage(coverArtView, song, false, false);
- int[] attrs = new int[] {(getDownloadService().getPlayerState() == PlayerState.STARTED) ? R.attr.media_button_pause : R.attr.media_button_start};
+ int[] attrs = new int[] {(state == PlayerState.STARTED) ? R.attr.media_button_pause : R.attr.media_button_start};
TypedArray typedArray = this.obtainStyledAttributes(attrs);
startButton.setImageResource(typedArray.getResourceId(0, 0));
typedArray.recycle();
|