Synchronize Butterknife / Eventbus
This commit is contained in:
parent
6eef71c4c0
commit
c3050740a8
|
@ -176,8 +176,10 @@ public class HistoryBrowseActivity extends AppCompatActivity {
|
|||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (HistoryBrowseActivity.this) {
|
||||
updateGUI("EventAutosensCalculationFinished");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class LoopFragment extends SubscriberFragment {
|
|||
clearGUI();
|
||||
final Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(() -> lastRunView.setText(ev.text));
|
||||
activity.runOnUiThread(() -> { synchronized (LoopFragment.this) { lastRunView.setText(ev.text); } });
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,6 +89,7 @@ public class LoopFragment extends SubscriberFragment {
|
|||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(() -> {
|
||||
synchronized (LoopFragment.this) {
|
||||
LoopPlugin.LastRun lastRun = LoopPlugin.lastRun;
|
||||
if (lastRun != null) {
|
||||
requestView.setText(lastRun.request != null ? lastRun.request.toSpanned() : "");
|
||||
|
@ -110,6 +111,7 @@ public class LoopFragment extends SubscriberFragment {
|
|||
}
|
||||
constraintsView.setText(constraints);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -117,6 +119,7 @@ public class LoopFragment extends SubscriberFragment {
|
|||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(() -> {
|
||||
synchronized (LoopFragment.this) {
|
||||
requestView.setText("");
|
||||
constraintsProcessedView.setText("");
|
||||
sourceView.setText("");
|
||||
|
@ -124,6 +127,7 @@ public class LoopFragment extends SubscriberFragment {
|
|||
lastEnactView.setText("");
|
||||
tbrSetByPumpView.setText("");
|
||||
smbSetByPumpView.setText("");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,6 +87,7 @@ public class OpenAPSSMBFragment extends SubscriberFragment {
|
|||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (OpenAPSSMBFragment.this) {
|
||||
OpenAPSSMBPlugin plugin = OpenAPSSMBPlugin.getPlugin();
|
||||
DetermineBasalResultSMB lastAPSResult = plugin.lastAPSResult;
|
||||
if (lastAPSResult != null) {
|
||||
|
@ -117,6 +118,7 @@ public class OpenAPSSMBFragment extends SubscriberFragment {
|
|||
autosensDataView.setText(JSONFormatter.format(plugin.lastAutosensResult.json()).toString().trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -126,6 +128,7 @@ public class OpenAPSSMBFragment extends SubscriberFragment {
|
|||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (OpenAPSSMBFragment.this) {
|
||||
resultView.setText(text);
|
||||
glucoseStatusView.setText("");
|
||||
currentTempView.setText("");
|
||||
|
@ -137,6 +140,7 @@ public class OpenAPSSMBFragment extends SubscriberFragment {
|
|||
requestView.setText("");
|
||||
lastRunView.setText("");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ public class NSProfileFragment extends SubscriberFragment {
|
|||
public void onStatusEvent(final EventNSProfileUpdateGUI ev) {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(() -> updateGUI());
|
||||
activity.runOnUiThread(() -> { synchronized (NSProfileFragment.this) { updateGUI(); } });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -216,6 +216,7 @@ public class DanaRFragment extends SubscriberFragment {
|
|||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized(DanaRFragment.this) {
|
||||
DanaRPump pump = DanaRPump.getInstance();
|
||||
if (pump.lastConnection != 0) {
|
||||
Long agoMsec = System.currentTimeMillis() - pump.lastConnection;
|
||||
|
@ -283,6 +284,7 @@ public class DanaRFragment extends SubscriberFragment {
|
|||
danar_user_options.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue