Have most fragments update their content in onResume.
This commit is contained in:
parent
26ebceb4d9
commit
7c6bdc0b31
|
@ -82,7 +82,7 @@ public class ActionsFragment extends Fragment implements View.OnClickListener {
|
|||
tempBasal.setOnClickListener(this);
|
||||
fill.setOnClickListener(this);
|
||||
|
||||
updateGUIIfVisible();
|
||||
updateGUI();
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -96,29 +96,30 @@ public class ActionsFragment extends Fragment implements View.OnClickListener {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onStatusEvent(final EventInitializationChanged ev) {
|
||||
updateGUIIfVisible();
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onStatusEvent(final EventRefreshOverview ev) {
|
||||
updateGUIIfVisible();
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onStatusEvent(final EventExtendedBolusChange ev) {
|
||||
updateGUIIfVisible();
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onStatusEvent(final EventTempBasalChange ev) {
|
||||
updateGUIIfVisible();
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
void updateGUIIfVisible() {
|
||||
private void updateGUI() {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
|
|
|
@ -188,6 +188,7 @@ public class CareportalFragment extends Fragment implements View.OnClickListener
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
@ -195,7 +196,7 @@ public class CareportalFragment extends Fragment implements View.OnClickListener
|
|||
updateGUI();
|
||||
}
|
||||
|
||||
void updateGUI() {
|
||||
private void updateGUI() {
|
||||
Activity activity = getActivity();
|
||||
updateAge(activity, sage, iage, cage, pbage);
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ public class LoopFragment extends Fragment implements View.OnClickListener {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -110,7 +111,7 @@ public class LoopFragment extends Fragment implements View.OnClickListener {
|
|||
}
|
||||
|
||||
|
||||
void updateGUI() {
|
||||
private void updateGUI() {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
|
|
|
@ -91,6 +91,7 @@ public class OpenAPSAMAFragment extends Fragment implements View.OnClickListener
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
@ -103,7 +104,7 @@ public class OpenAPSAMAFragment extends Fragment implements View.OnClickListener
|
|||
updateResultGUI(ev.text);
|
||||
}
|
||||
|
||||
void updateGUI() {
|
||||
private void updateGUI() {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
|
|
|
@ -85,6 +85,7 @@ public class OpenAPSMAFragment extends Fragment implements View.OnClickListener
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
|
@ -60,6 +60,7 @@ public class NSProfileFragment extends Fragment {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
|
@ -166,6 +166,7 @@ public class DanaRFragment extends Fragment {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
|
@ -164,6 +164,7 @@ public class DanaRKoreanFragment extends Fragment {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
|
@ -163,6 +163,7 @@ public class DanaRv2Fragment extends Fragment {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
|
@ -73,6 +73,7 @@ public class VirtualPumpFragment extends Fragment {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
|
@ -66,6 +66,7 @@ public class SmsCommunicatorFragment extends Fragment {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
|
@ -193,6 +193,7 @@ public class TreatmentsExtendedBolusesFragment extends Fragment {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
|
@ -190,6 +190,7 @@ public class TreatmentsProfileSwitchFragment extends Fragment implements View.On
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
@ -197,7 +198,7 @@ public class TreatmentsProfileSwitchFragment extends Fragment implements View.On
|
|||
updateGUI();
|
||||
}
|
||||
|
||||
void updateGUI() {
|
||||
private void updateGUI() {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
|
|
|
@ -211,6 +211,7 @@ public class TreatmentsTempTargetFragment extends Fragment implements View.OnCli
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
@ -218,7 +219,7 @@ public class TreatmentsTempTargetFragment extends Fragment implements View.OnCli
|
|||
updateGUI();
|
||||
}
|
||||
|
||||
void updateGUI() {
|
||||
private void updateGUI() {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
|
|
|
@ -212,6 +212,7 @@ public class TreatmentsTemporaryBasalsFragment extends Fragment {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
Loading…
Reference in a new issue