fix button visibility logic

This commit is contained in:
Milos Kozak 2021-01-12 18:45:46 +01:00
parent 9c53034805
commit 10bd1d2df0
4 changed files with 4 additions and 4 deletions

View file

@ -81,7 +81,7 @@ class TreatmentsBolusFragment : DaggerFragment() {
}) })
} }
} }
val nsUploadOnly = sp.getBoolean(R.string.key_ns_upload_only, true) && buildHelper.isEngineeringMode() val nsUploadOnly = sp.getBoolean(R.string.key_ns_upload_only, true) || !buildHelper.isEngineeringMode()
if (nsUploadOnly) treatments_reshreshfromnightscout.visibility = View.GONE if (nsUploadOnly) treatments_reshreshfromnightscout.visibility = View.GONE
} }

View file

@ -79,7 +79,7 @@ class TreatmentsCareportalFragment : DaggerFragment() {
} }
} }
val nsUploadOnly = sp.getBoolean(R.string.key_ns_upload_only, true) && buildHelper.isEngineeringMode() val nsUploadOnly = sp.getBoolean(R.string.key_ns_upload_only, true) || !buildHelper.isEngineeringMode()
if (nsUploadOnly) careportal_refreshfromnightscout.visibility = View.GONE if (nsUploadOnly) careportal_refreshfromnightscout.visibility = View.GONE
} }

View file

@ -67,7 +67,7 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
} }
} }
} }
if (sp.getBoolean(R.string.key_ns_upload_only, true) && buildHelper.isEngineeringMode()) profileswitch_refreshfromnightscout.visibility = View.GONE if (sp.getBoolean(R.string.key_ns_upload_only, true) || !buildHelper.isEngineeringMode()) profileswitch_refreshfromnightscout.visibility = View.GONE
} }
@Synchronized @Synchronized

View file

@ -182,7 +182,7 @@ public class TreatmentsTempTargetFragment extends DaggerFragment {
rxBus.send(new EventNSClientRestart()); rxBus.send(new EventNSClientRestart());
})); }));
boolean nsUploadOnly = sp.getBoolean(R.string.key_ns_upload_only, true) && buildHelper.isEngineeringMode(); boolean nsUploadOnly = sp.getBoolean(R.string.key_ns_upload_only, true) || !buildHelper.isEngineeringMode();
if (nsUploadOnly) if (nsUploadOnly)
refreshFromNS.setVisibility(View.GONE); refreshFromNS.setVisibility(View.GONE);