From 3e2998185b9cdd9c5cf4a87ce5b3bea866b89a55 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 28 Jul 2014 09:36:31 -0700 Subject: Only update bottom bar if revision updates --- .../daneren2005/dsub/activity/SubsonicFragmentActivity.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/github/daneren2005') diff --git a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index 9845411a..33adcb37 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -80,6 +80,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity { private TextView artistView; private ImageButton startButton; private long lastBackPressTime = 0; + private long currentRevision = -1; @Override public void onCreate(Bundle savedInstanceState) { @@ -406,11 +407,19 @@ public class SubsonicFragmentActivity extends SubsonicActivity { } private void update() { - if (getDownloadService() == null) { + DownloadService downloadService = getDownloadService(); + if (downloadService == null) { return; } + + long revision = downloadService.getDownloadListUpdateRevision(); + if(currentRevision == revision) { + return; + } else { + currentRevision = revision; + } - DownloadFile current = getDownloadService().getCurrentPlaying(); + DownloadFile current = downloadService.getCurrentPlaying(); if(current == null) { trackView.setText("Title"); artistView.setText("Artist"); -- cgit v1.2.3