update logic

This commit is contained in:
triplem 2018-11-04 19:06:19 +01:00
parent c4bbb62d0b
commit 7a77571803

View file

@ -462,11 +462,15 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
menu.add(MainApp.gs(R.string.resume)); menu.add(MainApp.gs(R.string.resume));
} }
} }
if (!loopPlugin.isEnabled(PluginType.LOOP))
menu.add(MainApp.gs(R.string.enableloop));
if (!ConfigBuilderPlugin.getPlugin().getActivePump().isSuspended()) { if (!loopPlugin.isEnabled(PluginType.LOOP)) {
menu.add(MainApp.gs(R.string.enableloop));
}
if (!loopPlugin.isDisconnected()) {
showSuspendtPump(menu, pumpDescription); showSuspendtPump(menu, pumpDescription);
} else {
menu.add(MainApp.gs(R.string.resume));
} }
} else if (v == activeProfileView) { } else if (v == activeProfileView) {
@ -1105,7 +1109,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
apsModeView.setBackgroundColor(MainApp.gc(R.color.looppumpsuspended)); apsModeView.setBackgroundColor(MainApp.gc(R.color.looppumpsuspended));
apsModeView.setText(String.format(MainApp.gs(R.string.loopsuperbolusfor), loopPlugin.minutesToEndOfSuspend())); apsModeView.setText(String.format(MainApp.gs(R.string.loopsuperbolusfor), loopPlugin.minutesToEndOfSuspend()));
apsModeView.setTextColor(Color.WHITE); apsModeView.setTextColor(Color.WHITE);
} else if (loopPlugin.isEnabled(PluginType.LOOP) && loopPlugin.isDisconnected()) { } else if (loopPlugin.isDisconnected()) {
apsModeView.setBackgroundColor(MainApp.gc(R.color.looppumpsuspended)); apsModeView.setBackgroundColor(MainApp.gc(R.color.looppumpsuspended));
apsModeView.setText(String.format(MainApp.gs(R.string.loopdisconnectedfor), loopPlugin.minutesToEndOfSuspend())); apsModeView.setText(String.format(MainApp.gs(R.string.loopdisconnectedfor), loopPlugin.minutesToEndOfSuspend()));
apsModeView.setTextColor(Color.WHITE); apsModeView.setTextColor(Color.WHITE);