diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-06-28 12:39:15 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-06-28 12:39:15 -0700 |
commit | b24f517aed50fcd72613c5b9b57bab760464ac65 (patch) | |
tree | 42ff0783611fb70366f4d5d0fdda31a59bc559db | |
parent | 8f32ac4778ceebe754970b98cdc928de2ebf9b60 (diff) | |
download | dsub-b24f517aed50fcd72613c5b9b57bab760464ac65.tar.gz dsub-b24f517aed50fcd72613c5b9b57bab760464ac65.tar.bz2 dsub-b24f517aed50fcd72613c5b9b57bab760464ac65.zip |
Trigger UI update immediately after changing fragments
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 3 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/view/UpdateView.java | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 4a87fd39..5a643daa 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -67,6 +67,8 @@ import github.daneren2005.dsub.util.SilentBackgroundTask; import github.daneren2005.dsub.util.LoadingTask;
import github.daneren2005.dsub.util.UserUtil;
import github.daneren2005.dsub.util.Util;
+import github.daneren2005.dsub.view.UpdateView;
+
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -124,6 +126,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR @Override
public void onResume() {
super.onResume();
+ UpdateView.triggerUpdate();
}
@Override
diff --git a/src/github/daneren2005/dsub/view/UpdateView.java b/src/github/daneren2005/dsub/view/UpdateView.java index 66f34471..5278f83a 100644 --- a/src/github/daneren2005/dsub/view/UpdateView.java +++ b/src/github/daneren2005/dsub/view/UpdateView.java @@ -123,6 +123,14 @@ public class UpdateView extends LinearLayout { }, "UpdateView").start();
}
+ public static synchronized void triggerUpdate() {
+ if(backgroundHandler != null) {
+ uiHandler.removeCallbacksAndMessages(null);
+ backgroundHandler.removeCallbacksAndMessages(null);
+ uiHandler.post(updateRunnable);
+ }
+ }
+
private static void updateAll() {
try {
// If nothing can see this, stop updating
|