aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-11-14 10:24:41 -0800
committerdaneren2005 <daneren2005@gmail.com>2013-11-14 10:24:41 -0800
commit6a6f300c700967d4347fe7c12f5134886902be28 (patch)
tree276fb38158e2013ea1eb435280af3761787e8831 /src/github/daneren2005
parentc2606da30d155dc6da275dcb236b10d181c78d65 (diff)
downloaddsub-6a6f300c700967d4347fe7c12f5134886902be28.tar.gz
dsub-6a6f300c700967d4347fe7c12f5134886902be28.tar.bz2
dsub-6a6f300c700967d4347fe7c12f5134886902be28.zip
Make sure that onDownloadList/Current/Progress changed don't run at same time
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/fragments/DownloadFragment.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
index 91fda9b1..a35e7c42 100644
--- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java
+++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java
@@ -986,6 +986,11 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
setSubtitle(context.getResources().getString(R.string.download_playing_out_of, currentPlayingIndex, size));
onDownloadListChangedTask = null;
+ if(onCurrentChangedTask != null) {
+ onCurrentChangedTask.execute();
+ } else if(onProgressChangedTask != null) {
+ onProgressChangedTask.execute();
+ }
}
};
onDownloadListChangedTask.execute();
@@ -1024,9 +1029,15 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
setSubtitle(null);
}
onCurrentChangedTask = null;
+ if(onProgressChangedTask != null) {
+ onProgressChangedTask.execute();
+ }
}
};
- onCurrentChangedTask.execute();
+
+ if(onDownloadListChangedTask == null) {
+ onCurrentChangedTask.execute();
+ }
}
private void onProgressChanged() {
@@ -1119,7 +1130,9 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
onProgressChangedTask = null;
}
};
- onProgressChangedTask.execute();
+ if(onDownloadListChangedTask == null && onCurrentChangedTask == null) {
+ onProgressChangedTask.execute();
+ }
}
private void changeProgress(final int ms) {