accept temp button visible only if loop selected

This commit is contained in:
Milos Kozak 2017-02-09 16:51:14 +01:00
parent 3aff89acdc
commit 9e9637d70b

View file

@ -237,7 +237,7 @@ public class OverviewFragment extends Fragment {
acceptTempButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MainApp.getConfigBuilder().getActiveLoop().invoke("Accept temp button", false);
ConfigBuilderPlugin.getActiveLoop().invoke("Accept temp button", false);
final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun;
if (finalLastRun != null && finalLastRun.lastAPSRun != null && finalLastRun.constraintsProcessed.changeRequested) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
@ -564,7 +564,7 @@ public class OverviewFragment extends Fragment {
showAcceptButton = showAcceptButton && (finalLastRun.lastOpenModeAccept == null || finalLastRun.lastOpenModeAccept.getTime() < finalLastRun.lastAPSRun.getTime()); // never accepted or before last result
showAcceptButton = showAcceptButton && finalLastRun.constraintsProcessed.changeRequested; // change is requested
if (showAcceptButton && pump.isInitialized()) {
if (showAcceptButton && pump.isInitialized() && ConfigBuilderPlugin.getActiveLoop() != null) {
acceptTempLayout.setVisibility(View.VISIBLE);
acceptTempButton.setText(getContext().getString(R.string.setbasalquestion) + "\n" + finalLastRun.constraintsProcessed);
} else {