diff --git a/app/src/main/java/info/nightscout/androidaps/Config.java b/app/src/main/java/info/nightscout/androidaps/Config.java index 2f7f6f5327..31031333d3 100644 --- a/app/src/main/java/info/nightscout/androidaps/Config.java +++ b/app/src/main/java/info/nightscout/androidaps/Config.java @@ -11,15 +11,15 @@ public class Config { public static final boolean LOOPENABLED = APS; public static final boolean WEAR = BuildConfig.WEAR; + public static final boolean NSCLIENT = BuildConfig.NSCLIENTOLNY; public static final boolean DANAR = true && BuildConfig.PUMPDRIVERS; - public static final boolean DANARv2 = true; + public static final boolean DANARv2 = true && BuildConfig.PUMPDRIVERS; public static final boolean ACTION = !BuildConfig.NSCLIENTOLNY; public static final boolean VIRTUALPUMP = !BuildConfig.NSCLIENTOLNY; public static final boolean MDI = !BuildConfig.NSCLIENTOLNY; public static final boolean OTHERPROFILES = !BuildConfig.NSCLIENTOLNY; - public static final boolean TEMPBASALS = !BuildConfig.NSCLIENTOLNY; public static final boolean SAFETY = !BuildConfig.NSCLIENTOLNY; public static final boolean SMSCOMMUNICATORENABLED = !BuildConfig.NSCLIENTOLNY; diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.java b/app/src/main/java/info/nightscout/androidaps/MainActivity.java index 9ae5081dbc..f30cde2187 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.java @@ -19,7 +19,6 @@ import android.support.v4.view.ViewPager; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.PopupMenu; -import android.util.AttributeSet; import android.view.MenuInflater; import android.view.MenuItem; import android.view.MotionEvent; @@ -296,7 +295,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe case R.id.nav_about: AlertDialog.Builder builder = new AlertDialog.Builder(v.getContext()); builder.setTitle(getString(R.string.app_name) + " " + BuildConfig.VERSION); - if (BuildConfig.NSCLIENTOLNY) + if (Config.NSCLIENT) builder.setIcon(R.mipmap.yellowowl); else builder.setIcon(R.mipmap.blueowl); diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java index 1ecc1a7f7b..015bad2651 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.java +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java @@ -114,10 +114,13 @@ public class MainApp extends Application { pluginsList.add(TreatmentsFragment.getPlugin()); if (Config.SAFETY) pluginsList.add(SafetyFragment.getPlugin()); if (Config.APS) pluginsList.add(ObjectivesFragment.getPlugin()); - pluginsList.add(SourceXdripFragment.getPlugin()); + if (!Config.NSCLIENT) + pluginsList.add(SourceXdripFragment.getPlugin()); pluginsList.add(SourceNSClientFragment.getPlugin()); - pluginsList.add(SourceMM640gFragment.getPlugin()); - pluginsList.add(SourceGlimpFragment.getPlugin()); + if (!Config.NSCLIENT) + pluginsList.add(SourceMM640gFragment.getPlugin()); + if (!Config.NSCLIENT) + pluginsList.add(SourceGlimpFragment.getPlugin()); if (Config.SMSCOMMUNICATORENABLED) pluginsList.add(SmsCommunicatorFragment.getPlugin()); if (Config.WEAR) pluginsList.add(WearFragment.getPlugin(this)); diff --git a/app/src/main/java/info/nightscout/androidaps/data/ProfileStore.java b/app/src/main/java/info/nightscout/androidaps/data/ProfileStore.java index 613f257a86..466351076b 100644 --- a/app/src/main/java/info/nightscout/androidaps/data/ProfileStore.java +++ b/app/src/main/java/info/nightscout/androidaps/data/ProfileStore.java @@ -66,8 +66,8 @@ public class ProfileStore { JSONObject store = json.getJSONObject("store"); if (store.has(profileName)) { String units = null; - if (store.has("units")) - units = store.getString("units"); + if (json.has("units")) + units = json.getString("units"); profile = new Profile(store.getJSONObject(profileName), units); } } catch (JSONException e) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalPlugin.java index e6981083d0..fed3ff1a43 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalPlugin.java @@ -1,5 +1,6 @@ package info.nightscout.androidaps.plugins.Careportal; +import info.nightscout.androidaps.Config; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.interfaces.PluginBase; @@ -57,7 +58,7 @@ public class CareportalPlugin implements PluginBase { @Override public boolean showInList(int type) { - return true; + return !Config.NSCLIENT; } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java index faf4a8d189..2445f262df 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java @@ -50,12 +50,15 @@ public class ConfigBuilderFragment extends Fragment { ListView insulinListView; ListView bgsourceListView; + TextView bgsourceLabel; ListView pumpListView; TextView pumpLabel; ListView loopListView; TextView loopLabel; ListView treatmentsListView; + TextView treatmentsLabel; ListView profileListView; + TextView profileLabel; ListView apsListView; TextView apsLabel; ListView constraintsListView; @@ -94,12 +97,15 @@ public class ConfigBuilderFragment extends Fragment { insulinListView = (ListView) view.findViewById(R.id.configbuilder_insulinlistview); bgsourceListView = (ListView) view.findViewById(R.id.configbuilder_bgsourcelistview); + bgsourceLabel = (TextView) view.findViewById(R.id.configbuilder_bgsourcelabel); pumpListView = (ListView) view.findViewById(R.id.configbuilder_pumplistview); pumpLabel = (TextView) view.findViewById(R.id.configbuilder_pumplabel); loopListView = (ListView) view.findViewById(R.id.configbuilder_looplistview); loopLabel = (TextView) view.findViewById(R.id.configbuilder_looplabel); treatmentsListView = (ListView) view.findViewById(R.id.configbuilder_treatmentslistview); + treatmentsLabel = (TextView) view.findViewById(R.id.configbuilder_treatmentslabel); profileListView = (ListView) view.findViewById(R.id.configbuilder_profilelistview); + profileLabel = (TextView) view.findViewById(R.id.configbuilder_profilelabel); apsListView = (ListView) view.findViewById(R.id.configbuilder_apslistview); apsLabel = (TextView) view.findViewById(R.id.configbuilder_apslabel); constraintsListView = (ListView) view.findViewById(R.id.configbuilder_constraintslistview); @@ -144,6 +150,8 @@ public class ConfigBuilderFragment extends Fragment { setListViewHeightBasedOnChildren(insulinListView); bgsourceDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInListByInterface(BgSourceInterface.class, PluginBase.BGSOURCE), PluginBase.BGSOURCE); bgsourceListView.setAdapter(bgsourceDataAdapter); + if (MainApp.getSpecificPluginsVisibleInList(PluginBase.BGSOURCE).size() == 0) + bgsourceLabel.setVisibility(View.GONE); setListViewHeightBasedOnChildren(bgsourceListView); pumpDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginBase.PUMP), PluginBase.PUMP); pumpListView.setAdapter(pumpDataAdapter); @@ -157,9 +165,13 @@ public class ConfigBuilderFragment extends Fragment { loopLabel.setVisibility(View.GONE); treatmentsDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginBase.TREATMENT), PluginBase.TREATMENT); treatmentsListView.setAdapter(treatmentsDataAdapter); + if (MainApp.getSpecificPluginsVisibleInList(PluginBase.TREATMENT).size() == 0) + treatmentsLabel.setVisibility(View.GONE); setListViewHeightBasedOnChildren(treatmentsListView); profileDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInListByInterface(ProfileInterface.class, PluginBase.BGSOURCE), PluginBase.PROFILE); profileListView.setAdapter(profileDataAdapter); + if (MainApp.getSpecificPluginsVisibleInList(PluginBase.PROFILE).size() == 0) + profileLabel.setVisibility(View.GONE); setListViewHeightBasedOnChildren(profileListView); apsDataAdapter = new PluginCustomAdapter(getContext(), smallWidth?R.layout.configbuilder_smallitem :R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginBase.APS), PluginBase.APS); apsListView.setAdapter(apsDataAdapter); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index ea081d23fb..073b7bbbc3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -22,6 +22,9 @@ import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.data.MealData; +import info.nightscout.androidaps.data.OverlappingIntervals; +import info.nightscout.androidaps.data.Profile; +import info.nightscout.androidaps.data.ProfileIntervals; import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.db.ExtendedBolus; import info.nightscout.androidaps.db.ProfileSwitch; @@ -40,15 +43,12 @@ import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.TreatmentsInterface; import info.nightscout.androidaps.plugins.Loop.APSResult; import info.nightscout.androidaps.plugins.Loop.LoopPlugin; -import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.plugins.Overview.Dialogs.BolusProgressDialog; import info.nightscout.androidaps.plugins.Overview.Notification; import info.nightscout.androidaps.plugins.Overview.events.EventDismissBolusprogressIfRunning; import info.nightscout.androidaps.plugins.Overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification; import info.nightscout.utils.NSUpload; -import info.nightscout.androidaps.data.OverlappingIntervals; -import info.nightscout.androidaps.data.ProfileIntervals; /** * Created by mike on 05.08.2016. @@ -679,6 +679,8 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain @Override public boolean isFakingTempsByExtendedBoluses() { + if (Config.NSCLIENT) + return false; return activePump.isFakingTempsByExtendedBoluses(); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java index 7230f7b1fb..55c8f9fe68 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java @@ -20,6 +20,7 @@ import info.nightscout.androidaps.Config; import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.data.IobTotal; +import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.db.BgReading; import info.nightscout.androidaps.db.Treatment; import info.nightscout.androidaps.events.EventNewBG; @@ -27,7 +28,6 @@ import info.nightscout.androidaps.events.EventNewBasalProfile; import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventAutosensCalculationFinished; import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventNewHistoryData; -import info.nightscout.androidaps.data.Profile; import info.nightscout.utils.Round; import info.nightscout.utils.SP; import info.nightscout.utils.SafeParse; @@ -232,7 +232,6 @@ public class IobCobCalculatorPlugin implements PluginBase { return; // app still initializing //log.debug("Locking calculateSensitivityData"); synchronized (dataLock) { - Profile profile = MainApp.getConfigBuilder().getProfile(); if (bucketed_data == null || bucketed_data.size() < 3) { log.debug("calculateSensitivityData: No bucketed data available"); @@ -247,6 +246,7 @@ public class IobCobCalculatorPlugin implements PluginBase { // check if data already exists long bgTime = bucketed_data.get(i).date; bgTime = roundUpTime(bgTime); + Profile profile = MainApp.getConfigBuilder().getProfile(bgTime); AutosensData existing; if ((existing = autosensDataTable.get(bgTime)) != null) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java index 07c34cda8c..a37d5442ca 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java @@ -20,6 +20,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; +import info.nightscout.androidaps.Config; import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; @@ -115,7 +116,7 @@ public class NSClientInternalPlugin implements PluginBase { @Override public boolean showInList(int type) { - return true; + return !Config.NSCLIENT; } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/services/NSClientService.java b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/services/NSClientService.java index c618b39f51..c2834dc077 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/services/NSClientService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/services/NSClientService.java @@ -29,6 +29,7 @@ import java.util.Date; import info.nightscout.androidaps.Config; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; +import info.nightscout.androidaps.data.ProfileStore; import info.nightscout.androidaps.db.DbRequest; import info.nightscout.androidaps.events.EventAppExit; import info.nightscout.androidaps.events.EventConfigBuilderChange; @@ -50,7 +51,6 @@ import info.nightscout.androidaps.plugins.NSClientInternal.data.NSCal; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSSgv; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSStatus; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSTreatment; -import info.nightscout.androidaps.data.ProfileStore; import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientNewLog; import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientRestart; import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientStatus; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index 79894af82e..4ab4640f33 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -61,6 +61,7 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import info.nightscout.androidaps.BuildConfig; import info.nightscout.androidaps.Config; import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.MainApp; @@ -955,7 +956,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, tempTargetView.setTextColor(Color.BLACK); tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetBackground)); tempTargetView.setVisibility(View.VISIBLE); - tempTargetView.setText(Profile.toUnitsString(tempTarget.low, Profile.fromMgdlToUnits(tempTarget.low, profile.getUnits()), profile.getUnits()) + " - " + Profile.toUnitsString(tempTarget.high, Profile.fromMgdlToUnits(tempTarget.high, profile.getUnits()), profile.getUnits())); + if (tempTarget.low == tempTarget.high) + tempTargetView.setText(Profile.toUnitsString(tempTarget.low, Profile.fromMgdlToUnits(tempTarget.low, profile.getUnits()), profile.getUnits())); + else + tempTargetView.setText(Profile.toUnitsString(tempTarget.low, Profile.fromMgdlToUnits(tempTarget.low, profile.getUnits()), profile.getUnits()) + " - " + Profile.toUnitsString(tempTarget.high, Profile.fromMgdlToUnits(tempTarget.high, profile.getUnits()), profile.getUnits())); + } if (Config.NSCLIENT) { + tempTargetView.setVisibility(View.GONE); } else { Double maxBgDefault = Constants.MAX_BG_DEFAULT_MGDL; @@ -984,7 +990,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, } // **** Calibration button **** - if (MainApp.getSpecificPlugin(SourceXdripPlugin.class).isEnabled(PluginBase.BGSOURCE) && profile != null && DatabaseHelper.actualBg() != null) { + if (MainApp.getSpecificPlugin(SourceXdripPlugin.class) != null && MainApp.getSpecificPlugin(SourceXdripPlugin.class).isEnabled(PluginBase.BGSOURCE) && profile != null && DatabaseHelper.actualBg() != null) { calibrationButton.setVisibility(View.VISIBLE); } else { calibrationButton.setVisibility(View.GONE); @@ -1000,10 +1006,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, String basalText = ""; if (activeTemp != null) { - basalText = activeTemp.toString() + " - "; + basalText = activeTemp.toString() + " "; } - if (pump.getPumpDescription().isTempBasalCapable) { - basalText += DecimalFormatter.to2Decimal(pump.getBaseBasalRate()) + " U/h"; + if (Config.NSCLIENT) + basalText += "( " + DecimalFormatter.to2Decimal(MainApp.getConfigBuilder().getProfile().getBasal()) + " U/h )"; + else if (pump.getPumpDescription().isTempBasalCapable) { + basalText += "( " + DecimalFormatter.to2Decimal(pump.getBaseBasalRate()) + " U/h )"; } baseBasalView.setText(basalText); @@ -1202,7 +1210,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, double lastTempBasal = 0; for (long time = fromTime; time < now; time += 1 * 60 * 1000L) { TemporaryBasal tb = MainApp.getConfigBuilder().getTempBasalFromHistory(time); - double baseBasalValue = profile.getBasal(Profile.secondsFromMidnight(new Date(time))); + double baseBasalValue = MainApp.getConfigBuilder().getProfile(time).getBasal(Profile.secondsFromMidnight(time)); double baseLineValue = baseBasalValue; double tempBasalValue = 0; double basal = 0d; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfilePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfilePlugin.java index 1544808ca7..b310993584 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfilePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfilePlugin.java @@ -14,10 +14,10 @@ import info.nightscout.androidaps.Config; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.Services.Intents; +import info.nightscout.androidaps.data.ProfileStore; import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.ProfileInterface; import info.nightscout.androidaps.interfaces.PumpInterface; -import info.nightscout.androidaps.data.ProfileStore; import info.nightscout.androidaps.plugins.ProfileNS.events.EventNSProfileUpdateGUI; import info.nightscout.androidaps.plugins.SmsCommunicator.SmsCommunicatorPlugin; import info.nightscout.utils.SP; @@ -62,12 +62,12 @@ public class NSProfilePlugin implements PluginBase, ProfileInterface { @Override public boolean isEnabled(int type) { - return type == PROFILE && fragmentEnabled; + return type == PROFILE && (Config.NSCLIENT || fragmentEnabled); } @Override public boolean isVisibleInTabs(int type) { - return type == PROFILE && fragmentVisible; + return type == PROFILE && (Config.NSCLIENT ||fragmentVisible); } @Override @@ -82,7 +82,7 @@ public class NSProfilePlugin implements PluginBase, ProfileInterface { @Override public boolean showInList(int type) { - return true; + return !Config.NSCLIENT; } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SourceNSClient/SourceNSClientPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SourceNSClient/SourceNSClientPlugin.java index db11ab4ea5..62ae6b93da 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SourceNSClient/SourceNSClientPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SourceNSClient/SourceNSClientPlugin.java @@ -1,5 +1,6 @@ package info.nightscout.androidaps.plugins.SourceNSClient; +import info.nightscout.androidaps.Config; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.interfaces.BgSourceInterface; @@ -35,7 +36,7 @@ public class SourceNSClientPlugin implements PluginBase, BgSourceInterface { @Override public boolean isEnabled(int type) { - return type == BGSOURCE && fragmentEnabled; + return Config.NSCLIENT || type == BGSOURCE && fragmentEnabled; } @Override @@ -55,7 +56,7 @@ public class SourceNSClientPlugin implements PluginBase, BgSourceInterface { @Override public boolean showInList(int type) { - return true; + return !Config.NSCLIENT; } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java index 87ecddcfa4..f09e298da2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java @@ -11,6 +11,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import info.nightscout.androidaps.Config; import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; @@ -18,12 +19,14 @@ import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.Iob; import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.data.MealData; +import info.nightscout.androidaps.data.OverlappingIntervals; +import info.nightscout.androidaps.data.Profile; +import info.nightscout.androidaps.data.ProfileIntervals; import info.nightscout.androidaps.db.ExtendedBolus; import info.nightscout.androidaps.db.ProfileSwitch; import info.nightscout.androidaps.db.TempTarget; import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.db.Treatment; -import info.nightscout.androidaps.events.EventNewBasalProfile; import info.nightscout.androidaps.events.EventProfileSwitchChange; import info.nightscout.androidaps.events.EventReloadTempBasalData; import info.nightscout.androidaps.events.EventReloadTreatmentData; @@ -33,9 +36,6 @@ import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.TreatmentsInterface; import info.nightscout.androidaps.plugins.IobCobCalculator.AutosensData; import info.nightscout.androidaps.plugins.IobCobCalculator.IobCobCalculatorPlugin; -import info.nightscout.androidaps.data.Profile; -import info.nightscout.androidaps.data.OverlappingIntervals; -import info.nightscout.androidaps.data.ProfileIntervals; import info.nightscout.utils.SP; /** @@ -99,7 +99,7 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface { @Override public boolean showInList(int type) { - return true; + return !Config.NSCLIENT; } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTemporaryBasalsFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTemporaryBasalsFragment.java index acd82e227c..ce2558683b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTemporaryBasalsFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTemporaryBasalsFragment.java @@ -74,6 +74,7 @@ public class TreatmentsTemporaryBasalsFragment extends Fragment { holder.netInsulin.setText(""); holder.netRatio.setText(""); holder.extendedFlag.setVisibility(View.GONE); + holder.iob.setTextColor(holder.netRatio.getCurrentTextColor()); } else { if (tempBasal.isInProgress()) { holder.date.setText(DateUtil.dateAndTimeString(tempBasal.date)); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java index 49446579a6..35b82d185c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java @@ -11,6 +11,7 @@ import com.squareup.otto.Subscribe; import java.util.Date; +import info.nightscout.androidaps.Config; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.IobTotal; @@ -98,7 +99,7 @@ public class StatuslinePlugin implements PluginBase { @Override public boolean showInList(int type) { - return true; + return !Config.NSCLIENT; } @Override diff --git a/app/src/main/res/layout/configbuilder_fragment.xml b/app/src/main/res/layout/configbuilder_fragment.xml index 9eccd9af05..64841fe593 100644 --- a/app/src/main/res/layout/configbuilder_fragment.xml +++ b/app/src/main/res/layout/configbuilder_fragment.xml @@ -43,6 +43,7 @@ + android:visibility="gone" />