temp basal dialog design
This commit is contained in:
parent
3861bece54
commit
f5f7d28cc1
8 changed files with 269 additions and 198 deletions
|
@ -6,9 +6,8 @@ package info.nightscout.androidaps.interfaces;
|
||||||
|
|
||||||
public class PumpDescription {
|
public class PumpDescription {
|
||||||
public static final int NONE = 0;
|
public static final int NONE = 0;
|
||||||
public static final int PERCENT = 1;
|
public static final int PERCENT = 0x01;
|
||||||
public static final int ABSOLUTE = 2;
|
public static final int ABSOLUTE = 0x02;
|
||||||
public static final int EXTENDED = 4;
|
|
||||||
|
|
||||||
public boolean isBolusCapable = true;
|
public boolean isBolusCapable = true;
|
||||||
public double bolusStep = 0.1d;
|
public double bolusStep = 0.1d;
|
||||||
|
@ -19,18 +18,17 @@ public class PumpDescription {
|
||||||
public double extendedBolusMaxDuration = 12 * 60;
|
public double extendedBolusMaxDuration = 12 * 60;
|
||||||
|
|
||||||
public boolean isTempBasalCapable = true;
|
public boolean isTempBasalCapable = true;
|
||||||
public int lowTempBasalStyle = PERCENT;
|
public int tempBasalStyle = PERCENT;
|
||||||
public int highTempBasalStyle = PERCENT;
|
|
||||||
public int maxHighTempPercent = 200;
|
public int maxTempPercent = 200;
|
||||||
public double maxHighTempAbsolute = 0; // zero = no limit
|
public int tempPercentStep = 10;
|
||||||
public int lowTempPercentStep = 10;
|
|
||||||
public double lowTempAbsoluteStep = 0.05d;
|
public double maxTempAbsolute = 10;
|
||||||
public int lowTempPercentDuration = 30;
|
public double tempAbsoluteStep = 0.05d;
|
||||||
public int lowTempAbsoluteDuration = 30;
|
|
||||||
public double highTempPercentStep = 10;
|
public int tempDurationStep = 60;
|
||||||
public double highTempAbsoluteStep = 0.05d;
|
public int tempMaxDuration = 12 * 60;
|
||||||
public int highTempPercentDuration = 30;
|
|
||||||
public int highTempAbsoluteDuration = 30;
|
|
||||||
|
|
||||||
public boolean isSetBasalProfileCapable = true;
|
public boolean isSetBasalProfileCapable = true;
|
||||||
public double basalStep = 0.01d;
|
public double basalStep = 0.01d;
|
||||||
|
|
|
@ -11,11 +11,10 @@ import android.support.v7.app.AlertDialog;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
|
||||||
import com.crashlytics.android.answers.Answers;
|
import com.crashlytics.android.answers.Answers;
|
||||||
import com.crashlytics.android.answers.CustomEvent;
|
import com.crashlytics.android.answers.CustomEvent;
|
||||||
|
@ -26,6 +25,7 @@ import info.nightscout.androidaps.Constants;
|
||||||
import info.nightscout.androidaps.MainApp;
|
import info.nightscout.androidaps.MainApp;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||||
|
import info.nightscout.androidaps.interfaces.PumpDescription;
|
||||||
import info.nightscout.androidaps.interfaces.PumpInterface;
|
import info.nightscout.androidaps.interfaces.PumpInterface;
|
||||||
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
|
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
|
||||||
import info.nightscout.utils.PlusMinusEditText;
|
import info.nightscout.utils.PlusMinusEditText;
|
||||||
|
@ -33,23 +33,17 @@ import info.nightscout.utils.SafeParse;
|
||||||
|
|
||||||
public class NewTempBasalDialog extends DialogFragment implements View.OnClickListener, RadioGroup.OnCheckedChangeListener {
|
public class NewTempBasalDialog extends DialogFragment implements View.OnClickListener, RadioGroup.OnCheckedChangeListener {
|
||||||
|
|
||||||
Button okButton;
|
|
||||||
EditText basalPercentEdit;
|
|
||||||
EditText basalAbsoluteEdit;
|
|
||||||
RadioButton percentRadio;
|
RadioButton percentRadio;
|
||||||
RadioButton absoluteRadio;
|
RadioButton absoluteRadio;
|
||||||
RadioGroup basalTypeRadioGroup;
|
RadioGroup basalTypeRadioGroup;
|
||||||
RadioButton h05Radio;
|
RelativeLayout typeSelectorLayout;
|
||||||
RadioButton h10Radio;
|
|
||||||
RadioButton h20Radio;
|
|
||||||
RadioButton h30Radio;
|
|
||||||
RadioButton h40Radio;
|
|
||||||
|
|
||||||
LinearLayout percentLayout;
|
LinearLayout percentLayout;
|
||||||
LinearLayout absoluteLayout;
|
LinearLayout absoluteLayout;
|
||||||
|
|
||||||
PlusMinusEditText basalPercentPM;
|
PlusMinusEditText basalPercent;
|
||||||
PlusMinusEditText basalAbsolutePM;
|
PlusMinusEditText basalAbsolute;
|
||||||
|
PlusMinusEditText duration;
|
||||||
|
|
||||||
Handler mHandler;
|
Handler mHandler;
|
||||||
public static HandlerThread mHandlerThread;
|
public static HandlerThread mHandlerThread;
|
||||||
|
@ -66,31 +60,51 @@ public class NewTempBasalDialog extends DialogFragment implements View.OnClickLi
|
||||||
getDialog().setTitle(getString(R.string.overview_tempbasal_button));
|
getDialog().setTitle(getString(R.string.overview_tempbasal_button));
|
||||||
|
|
||||||
View view = inflater.inflate(R.layout.overview_newtempbasal_dialog, container, false);
|
View view = inflater.inflate(R.layout.overview_newtempbasal_dialog, container, false);
|
||||||
okButton = (Button) view.findViewById(R.id.overview_newtempbasal_okbutton);
|
|
||||||
basalPercentEdit = (EditText) view.findViewById(R.id.overview_newtempbasal_basalpercentinput);
|
|
||||||
basalAbsoluteEdit = (EditText) view.findViewById(R.id.overview_newtempbasal_basalabsoluteinput);
|
|
||||||
percentLayout = (LinearLayout) view.findViewById(R.id.overview_newtempbasal_percent_layout);
|
percentLayout = (LinearLayout) view.findViewById(R.id.overview_newtempbasal_percent_layout);
|
||||||
absoluteLayout = (LinearLayout) view.findViewById(R.id.overview_newtempbasal_absolute_layout);
|
absoluteLayout = (LinearLayout) view.findViewById(R.id.overview_newtempbasal_absolute_layout);
|
||||||
percentRadio = (RadioButton) view.findViewById(R.id.overview_newtempbasal_percent_radio);
|
percentRadio = (RadioButton) view.findViewById(R.id.overview_newtempbasal_percent_radio);
|
||||||
basalTypeRadioGroup = (RadioGroup) view.findViewById(R.id.overview_newtempbasal_radiogroup);
|
basalTypeRadioGroup = (RadioGroup) view.findViewById(R.id.overview_newtempbasal_radiogroup);
|
||||||
absoluteRadio = (RadioButton) view.findViewById(R.id.overview_newtempbasal_absolute_radio);
|
absoluteRadio = (RadioButton) view.findViewById(R.id.overview_newtempbasal_absolute_radio);
|
||||||
h05Radio = (RadioButton) view.findViewById(R.id.overview_newtempbasal_05h);
|
typeSelectorLayout = (RelativeLayout) view.findViewById(R.id.overview_newtempbasal_typeselector_layout);
|
||||||
h10Radio = (RadioButton) view.findViewById(R.id.overview_newtempbasal_1h);
|
|
||||||
h20Radio = (RadioButton) view.findViewById(R.id.overview_newtempbasal_2h);
|
|
||||||
h30Radio = (RadioButton) view.findViewById(R.id.overview_newtempbasal_3h);
|
|
||||||
h40Radio = (RadioButton) view.findViewById(R.id.overview_newtempbasal_4h);
|
|
||||||
|
|
||||||
Integer maxPercent = MainApp.getConfigBuilder().applyBasalConstraints(Constants.basalPercentOnlyForCheckLimit);
|
PumpDescription pumpDescription = MainApp.getConfigBuilder().getPumpDescription();
|
||||||
basalPercentPM = new PlusMinusEditText(view, R.id.overview_newtempbasal_basalpercentinput, R.id.overview_newtempbasal_basalpercent_plus, R.id.overview_newtempbasal_basalpercent_minus, 100d, 0d, (double) maxPercent, 5d, new DecimalFormat("0"), true);
|
|
||||||
|
basalPercent = new PlusMinusEditText(view, R.id.overview_newtempbasal_basalpercentinput, R.id.overview_newtempbasal_basalpercent_plus, R.id.overview_newtempbasal_basalpercent_minus,
|
||||||
|
100d, 0d, (double) pumpDescription.maxTempPercent, (double) pumpDescription.tempPercentStep, new DecimalFormat("0"), true);
|
||||||
|
|
||||||
Double maxAbsolute = MainApp.getConfigBuilder().applyBasalConstraints(Constants.basalAbsoluteOnlyForCheckLimit);
|
|
||||||
NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile();
|
NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile();
|
||||||
Double currentBasal = 0d;
|
Double currentBasal = 0d;
|
||||||
if (profile != null) currentBasal = profile.getBasal(NSProfile.secondsFromMidnight());
|
if (profile != null) currentBasal = profile.getBasal(NSProfile.secondsFromMidnight());
|
||||||
basalAbsolutePM = new PlusMinusEditText(view, R.id.overview_newtempbasal_basalabsoluteinput, R.id.overview_newtempbasal_basalabsolute_plus, R.id.overview_newtempbasal_basalabsolute_minus, currentBasal, 0d, maxAbsolute, 0.05d, new DecimalFormat("0.00"), true);
|
basalAbsolute = new PlusMinusEditText(view, R.id.overview_newtempbasal_basalabsoluteinput, R.id.overview_newtempbasal_basalabsolute_plus, R.id.overview_newtempbasal_basalabsolute_minus,
|
||||||
|
currentBasal, 0d, pumpDescription.maxTempAbsolute, pumpDescription.tempAbsoluteStep, new DecimalFormat("0.00"), true);
|
||||||
|
|
||||||
absoluteLayout.setVisibility(View.GONE);
|
double tempDurationStep = MainApp.getConfigBuilder().getPumpDescription().tempDurationStep;
|
||||||
okButton.setOnClickListener(this);
|
double tempMaxDuration = MainApp.getConfigBuilder().getPumpDescription().tempMaxDuration;
|
||||||
|
duration = new PlusMinusEditText(view, R.id.overview_newtempbasal_duration, R.id.overview_newtempbasal_duration_plus, R.id.overview_newtempbasal_duration_minus,
|
||||||
|
tempDurationStep, tempDurationStep, tempMaxDuration, tempDurationStep, new DecimalFormat("0"), false);
|
||||||
|
|
||||||
|
if ((pumpDescription.tempBasalStyle & PumpDescription.PERCENT) == PumpDescription.PERCENT && (pumpDescription.tempBasalStyle & PumpDescription.ABSOLUTE) == PumpDescription.ABSOLUTE) {
|
||||||
|
// Both allowed
|
||||||
|
typeSelectorLayout.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
typeSelectorLayout.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((pumpDescription.tempBasalStyle & PumpDescription.PERCENT) == PumpDescription.PERCENT) {
|
||||||
|
percentRadio.setChecked(true);
|
||||||
|
absoluteRadio.setChecked(false);
|
||||||
|
percentLayout.setVisibility(View.VISIBLE);
|
||||||
|
absoluteLayout.setVisibility(View.GONE);
|
||||||
|
} else if ((pumpDescription.tempBasalStyle & PumpDescription.ABSOLUTE) == PumpDescription.ABSOLUTE) {
|
||||||
|
percentRadio.setChecked(false);
|
||||||
|
absoluteRadio.setChecked(true);
|
||||||
|
percentLayout.setVisibility(View.GONE);
|
||||||
|
absoluteLayout.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
view.findViewById(R.id.ok).setOnClickListener(this);
|
||||||
|
view.findViewById(R.id.cancel).setOnClickListener(this);
|
||||||
basalTypeRadioGroup.setOnCheckedChangeListener(this);
|
basalTypeRadioGroup.setOnCheckedChangeListener(this);
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
@ -105,36 +119,32 @@ public class NewTempBasalDialog extends DialogFragment implements View.OnClickLi
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
switch (view.getId()) {
|
switch (view.getId()) {
|
||||||
case R.id.overview_newtempbasal_okbutton:
|
case R.id.ok:
|
||||||
try {
|
try {
|
||||||
int basalPercent = 0;
|
int percent = 0;
|
||||||
Double basalAbsolute = 0d;
|
Double absolute = 0d;
|
||||||
final boolean setAsPercent = percentRadio.isChecked();
|
final boolean setAsPercent = percentRadio.isChecked();
|
||||||
int durationInMinutes = 30;
|
int durationInMinutes = SafeParse.stringToInt(duration.getText());
|
||||||
if (h10Radio.isChecked()) durationInMinutes = 60;
|
|
||||||
if (h20Radio.isChecked()) durationInMinutes = 120;
|
|
||||||
if (h30Radio.isChecked()) durationInMinutes = 180;
|
|
||||||
if (h40Radio.isChecked()) durationInMinutes = 240;
|
|
||||||
|
|
||||||
String confirmMessage = getString(R.string.setbasalquestion);
|
String confirmMessage = getString(R.string.setbasalquestion);
|
||||||
if (setAsPercent) {
|
if (setAsPercent) {
|
||||||
int basalPercentInput = SafeParse.stringToDouble(basalPercentEdit.getText().toString()).intValue();
|
int basalPercentInput = SafeParse.stringToInt(basalPercent.getText());
|
||||||
basalPercent = MainApp.getConfigBuilder().applyBasalConstraints(basalPercentInput);
|
percent = MainApp.getConfigBuilder().applyBasalConstraints(basalPercentInput);
|
||||||
confirmMessage += "\n" + basalPercent + "% ";
|
confirmMessage += "\n" + percent + "% ";
|
||||||
confirmMessage += "\n" + getString(R.string.duration) + " " + durationInMinutes + "min ?";
|
confirmMessage += "\n" + getString(R.string.duration) + " " + durationInMinutes + "min ?";
|
||||||
if (basalPercent != basalPercentInput)
|
if (percent != basalPercentInput)
|
||||||
confirmMessage += "\n" + getString(R.string.constraintapllied);
|
confirmMessage += "\n" + getString(R.string.constraintapllied);
|
||||||
} else {
|
} else {
|
||||||
Double basalAbsoluteInput = SafeParse.stringToDouble(basalAbsoluteEdit.getText().toString());
|
Double basalAbsoluteInput = SafeParse.stringToDouble(basalAbsolute.getText());
|
||||||
basalAbsolute = MainApp.getConfigBuilder().applyBasalConstraints(basalAbsoluteInput);
|
absolute = MainApp.getConfigBuilder().applyBasalConstraints(basalAbsoluteInput);
|
||||||
confirmMessage += "\n" + basalAbsolute + " U/h ";
|
confirmMessage += "\n" + absolute + " U/h ";
|
||||||
confirmMessage += "\n" + getString(R.string.duration) + " " + durationInMinutes + "min ?";
|
confirmMessage += "\n" + getString(R.string.duration) + " " + durationInMinutes + "min ?";
|
||||||
if (basalAbsolute - basalAbsoluteInput != 0d)
|
if (absolute - basalAbsoluteInput != 0d)
|
||||||
confirmMessage += "\n" + getString(R.string.constraintapllied);
|
confirmMessage += "\n" + getString(R.string.constraintapllied);
|
||||||
}
|
}
|
||||||
|
|
||||||
final int finalBasalPercent = basalPercent;
|
final int finalBasalPercent = percent;
|
||||||
final Double finalBasal = basalAbsolute;
|
final Double finalBasal = absolute;
|
||||||
final int finalDurationInMinutes = durationInMinutes;
|
final int finalDurationInMinutes = durationInMinutes;
|
||||||
|
|
||||||
final Context context = getContext();
|
final Context context = getContext();
|
||||||
|
@ -178,6 +188,10 @@ public class NewTempBasalDialog extends DialogFragment implements View.OnClickLi
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case R.id.cancel:
|
||||||
|
dismiss();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,26 +78,23 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
||||||
MainApp.bus().register(this);
|
MainApp.bus().register(this);
|
||||||
|
|
||||||
pumpDescription.isBolusCapable = true; // TODO: use description in setTempBasalAbsolute
|
pumpDescription.isBolusCapable = true;
|
||||||
pumpDescription.bolusStep = 0.05d;
|
pumpDescription.bolusStep = 0.1d;
|
||||||
|
|
||||||
pumpDescription.isExtendedBolusCapable = true;
|
pumpDescription.isExtendedBolusCapable = true;
|
||||||
pumpDescription.extendedBolusStep = 0.05d;
|
pumpDescription.extendedBolusStep = 0.1d;
|
||||||
pumpDescription.extendedBolusDurationStep = 30;
|
pumpDescription.extendedBolusDurationStep = 30;
|
||||||
|
pumpDescription.extendedBolusMaxDuration = 8 * 60;
|
||||||
|
|
||||||
pumpDescription.isTempBasalCapable = true;
|
pumpDescription.isTempBasalCapable = true;
|
||||||
pumpDescription.lowTempBasalStyle = PumpDescription.PERCENT;
|
pumpDescription.tempBasalStyle = PumpDescription.PERCENT;
|
||||||
pumpDescription.highTempBasalStyle = useExtendedBoluses ? PumpDescription.EXTENDED : PumpDescription.PERCENT;
|
|
||||||
pumpDescription.maxHighTempPercent = 200;
|
pumpDescription.maxTempPercent = 200;
|
||||||
pumpDescription.maxHighTempAbsolute = 0;
|
pumpDescription.tempPercentStep = 10;
|
||||||
pumpDescription.lowTempPercentStep = 10;
|
|
||||||
pumpDescription.lowTempAbsoluteStep = 0;
|
pumpDescription.tempDurationStep = 60;
|
||||||
pumpDescription.lowTempPercentDuration = 60;
|
pumpDescription.tempMaxDuration = 24 * 60;
|
||||||
pumpDescription.lowTempAbsoluteDuration = 60;
|
|
||||||
pumpDescription.highTempPercentStep = 10;
|
|
||||||
pumpDescription.highTempAbsoluteStep = 0.05d;
|
|
||||||
pumpDescription.highTempPercentDuration = 60;
|
|
||||||
pumpDescription.highTempAbsoluteDuration = 30;
|
|
||||||
|
|
||||||
pumpDescription.isSetBasalProfileCapable = true;
|
pumpDescription.isSetBasalProfileCapable = true;
|
||||||
pumpDescription.basalStep = 0.01d;
|
pumpDescription.basalStep = 0.01d;
|
||||||
|
@ -132,8 +129,6 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
boolean previousValue = useExtendedBoluses;
|
boolean previousValue = useExtendedBoluses;
|
||||||
useExtendedBoluses = SP.getBoolean("danar_useextended", false);
|
useExtendedBoluses = SP.getBoolean("danar_useextended", false);
|
||||||
|
|
||||||
pumpDescription.highTempBasalStyle = useExtendedBoluses ? PumpDescription.EXTENDED : PumpDescription.PERCENT;
|
|
||||||
|
|
||||||
if (useExtendedBoluses != previousValue && MainApp.getConfigBuilder().isInHistoryExtendedBoluslInProgress()) {
|
if (useExtendedBoluses != previousValue && MainApp.getConfigBuilder().isInHistoryExtendedBoluslInProgress()) {
|
||||||
sExecutionService.extendedBolusStop();
|
sExecutionService.extendedBolusStop();
|
||||||
}
|
}
|
||||||
|
@ -381,8 +376,8 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
Integer percentRate = Double.valueOf(absoluteRate / getBaseBasalRate() * 100).intValue();
|
Integer percentRate = Double.valueOf(absoluteRate / getBaseBasalRate() * 100).intValue();
|
||||||
if (percentRate < 100) percentRate = Round.ceilTo((double) percentRate, 10d).intValue();
|
if (percentRate < 100) percentRate = Round.ceilTo((double) percentRate, 10d).intValue();
|
||||||
else percentRate = Round.floorTo((double) percentRate, 10d).intValue();
|
else percentRate = Round.floorTo((double) percentRate, 10d).intValue();
|
||||||
if (percentRate > getPumpDescription().maxHighTempPercent) {
|
if (percentRate > getPumpDescription().maxTempPercent) {
|
||||||
percentRate = getPumpDescription().maxHighTempPercent;
|
percentRate = getPumpDescription().maxTempPercent;
|
||||||
}
|
}
|
||||||
// If extended in progress
|
// If extended in progress
|
||||||
if (MainApp.getConfigBuilder().isInHistoryExtendedBoluslInProgress() && useExtendedBoluses) {
|
if (MainApp.getConfigBuilder().isInHistoryExtendedBoluslInProgress() && useExtendedBoluses) {
|
||||||
|
@ -499,8 +494,8 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
log.error("setTempBasalPercent: Invalid input");
|
log.error("setTempBasalPercent: Invalid input");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (percent > getPumpDescription().maxHighTempPercent)
|
if (percent > getPumpDescription().maxTempPercent)
|
||||||
percent = getPumpDescription().maxHighTempPercent;
|
percent = getPumpDescription().maxTempPercent;
|
||||||
if (pump.isTempBasalInProgress && pump.tempBasalPercent == percent) {
|
if (pump.isTempBasalInProgress && pump.tempBasalPercent == percent) {
|
||||||
result.enacted = false;
|
result.enacted = false;
|
||||||
result.success = true;
|
result.success = true;
|
||||||
|
@ -754,8 +749,8 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
public Integer applyBasalConstraints(Integer percentRate) {
|
public Integer applyBasalConstraints(Integer percentRate) {
|
||||||
Integer origPercentRate = percentRate;
|
Integer origPercentRate = percentRate;
|
||||||
if (percentRate < 0) percentRate = 0;
|
if (percentRate < 0) percentRate = 0;
|
||||||
if (percentRate > getPumpDescription().maxHighTempPercent)
|
if (percentRate > getPumpDescription().maxTempPercent)
|
||||||
percentRate = getPumpDescription().maxHighTempPercent;
|
percentRate = getPumpDescription().maxTempPercent;
|
||||||
if (!Objects.equals(percentRate, origPercentRate) && Config.logConstraintsChanges && !Objects.equals(origPercentRate, Constants.basalPercentOnlyForCheckLimit))
|
if (!Objects.equals(percentRate, origPercentRate) && Config.logConstraintsChanges && !Objects.equals(origPercentRate, Constants.basalPercentOnlyForCheckLimit))
|
||||||
log.debug("Limiting percent rate " + origPercentRate + "% to " + percentRate + "%");
|
log.debug("Limiting percent rate " + origPercentRate + "% to " + percentRate + "%");
|
||||||
return percentRate;
|
return percentRate;
|
||||||
|
|
|
@ -81,26 +81,23 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
|
||||||
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
||||||
MainApp.bus().register(this);
|
MainApp.bus().register(this);
|
||||||
|
|
||||||
pumpDescription.isBolusCapable = true; // TODO: use description in setTempBasalAbsolute
|
pumpDescription.isBolusCapable = true;
|
||||||
pumpDescription.bolusStep = 0.1d;
|
pumpDescription.bolusStep = 0.1d;
|
||||||
|
|
||||||
pumpDescription.isExtendedBolusCapable = true;
|
pumpDescription.isExtendedBolusCapable = true;
|
||||||
pumpDescription.extendedBolusStep = 0.05d;
|
pumpDescription.extendedBolusStep = 0.1d;
|
||||||
pumpDescription.extendedBolusDurationStep = 30;
|
pumpDescription.extendedBolusDurationStep = 30;
|
||||||
|
pumpDescription.extendedBolusMaxDuration = 8 * 60;
|
||||||
|
|
||||||
pumpDescription.isTempBasalCapable = true;
|
pumpDescription.isTempBasalCapable = true;
|
||||||
pumpDescription.lowTempBasalStyle = PumpDescription.PERCENT;
|
pumpDescription.tempBasalStyle = PumpDescription.PERCENT;
|
||||||
pumpDescription.highTempBasalStyle = useExtendedBoluses ? PumpDescription.EXTENDED : PumpDescription.PERCENT;
|
|
||||||
pumpDescription.maxHighTempPercent = 200;
|
pumpDescription.maxTempPercent = 200;
|
||||||
pumpDescription.maxHighTempAbsolute = 0;
|
pumpDescription.tempPercentStep = 10;
|
||||||
pumpDescription.lowTempPercentStep = 10;
|
|
||||||
pumpDescription.lowTempAbsoluteStep = 0;
|
pumpDescription.tempDurationStep = 60;
|
||||||
pumpDescription.lowTempPercentDuration = 60;
|
pumpDescription.tempMaxDuration = 24 * 60;
|
||||||
pumpDescription.lowTempAbsoluteDuration = 60;
|
|
||||||
pumpDescription.highTempPercentStep = 10;
|
|
||||||
pumpDescription.highTempAbsoluteStep = 0.05d;
|
|
||||||
pumpDescription.highTempPercentDuration = 60;
|
|
||||||
pumpDescription.highTempAbsoluteDuration = 30;
|
|
||||||
|
|
||||||
pumpDescription.isSetBasalProfileCapable = true;
|
pumpDescription.isSetBasalProfileCapable = true;
|
||||||
pumpDescription.basalStep = 0.01d;
|
pumpDescription.basalStep = 0.01d;
|
||||||
|
@ -135,8 +132,6 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
|
||||||
boolean previousValue = useExtendedBoluses;
|
boolean previousValue = useExtendedBoluses;
|
||||||
useExtendedBoluses = SP.getBoolean("danar_useextended", false);
|
useExtendedBoluses = SP.getBoolean("danar_useextended", false);
|
||||||
|
|
||||||
pumpDescription.highTempBasalStyle = useExtendedBoluses ? PumpDescription.EXTENDED : PumpDescription.PERCENT;
|
|
||||||
|
|
||||||
if (useExtendedBoluses != previousValue && MainApp.getConfigBuilder().isInHistoryExtendedBoluslInProgress()) {
|
if (useExtendedBoluses != previousValue && MainApp.getConfigBuilder().isInHistoryExtendedBoluslInProgress()) {
|
||||||
sExecutionService.extendedBolusStop();
|
sExecutionService.extendedBolusStop();
|
||||||
}
|
}
|
||||||
|
@ -502,8 +497,8 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
|
||||||
log.error("setTempBasalPercent: Invalid input");
|
log.error("setTempBasalPercent: Invalid input");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (percent > getPumpDescription().maxHighTempPercent)
|
if (percent > getPumpDescription().maxTempPercent)
|
||||||
percent = getPumpDescription().maxHighTempPercent;
|
percent = getPumpDescription().maxTempPercent;
|
||||||
if (pump.isTempBasalInProgress && pump.tempBasalPercent == percent) {
|
if (pump.isTempBasalInProgress && pump.tempBasalPercent == percent) {
|
||||||
result.enacted = false;
|
result.enacted = false;
|
||||||
result.success = true;
|
result.success = true;
|
||||||
|
@ -757,8 +752,8 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
|
||||||
public Integer applyBasalConstraints(Integer percentRate) {
|
public Integer applyBasalConstraints(Integer percentRate) {
|
||||||
Integer origPercentRate = percentRate;
|
Integer origPercentRate = percentRate;
|
||||||
if (percentRate < 0) percentRate = 0;
|
if (percentRate < 0) percentRate = 0;
|
||||||
if (percentRate > getPumpDescription().maxHighTempPercent)
|
if (percentRate > getPumpDescription().maxTempPercent)
|
||||||
percentRate = getPumpDescription().maxHighTempPercent;
|
percentRate = getPumpDescription().maxTempPercent;
|
||||||
if (!Objects.equals(percentRate, origPercentRate) && Config.logConstraintsChanges && !Objects.equals(origPercentRate, Constants.basalPercentOnlyForCheckLimit))
|
if (!Objects.equals(percentRate, origPercentRate) && Config.logConstraintsChanges && !Objects.equals(origPercentRate, Constants.basalPercentOnlyForCheckLimit))
|
||||||
log.debug("Limiting percent rate " + origPercentRate + "% to " + percentRate + "%");
|
log.debug("Limiting percent rate " + origPercentRate + "% to " + percentRate + "%");
|
||||||
return percentRate;
|
return percentRate;
|
||||||
|
|
|
@ -78,26 +78,23 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, ConstraintsInte
|
||||||
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
||||||
MainApp.bus().register(this);
|
MainApp.bus().register(this);
|
||||||
|
|
||||||
pumpDescription.isBolusCapable = true; // TODO: use description in setTempBasalAbsolute
|
pumpDescription.isBolusCapable = true;
|
||||||
pumpDescription.bolusStep = 0.05d;
|
pumpDescription.bolusStep = 0.1d;
|
||||||
|
|
||||||
pumpDescription.isExtendedBolusCapable = true;
|
pumpDescription.isExtendedBolusCapable = true;
|
||||||
pumpDescription.extendedBolusStep = 0.05d;
|
pumpDescription.extendedBolusStep = 0.05d;
|
||||||
pumpDescription.extendedBolusDurationStep = 30;
|
pumpDescription.extendedBolusDurationStep = 30;
|
||||||
|
pumpDescription.extendedBolusMaxDuration = 8 * 60;
|
||||||
|
|
||||||
pumpDescription.isTempBasalCapable = true;
|
pumpDescription.isTempBasalCapable = true;
|
||||||
pumpDescription.lowTempBasalStyle = PumpDescription.PERCENT;
|
pumpDescription.tempBasalStyle = PumpDescription.PERCENT;
|
||||||
pumpDescription.highTempBasalStyle = PumpDescription.PERCENT;
|
|
||||||
pumpDescription.maxHighTempPercent = 500;
|
pumpDescription.maxTempPercent = 200;
|
||||||
pumpDescription.maxHighTempAbsolute = 0;
|
pumpDescription.tempPercentStep = 10;
|
||||||
pumpDescription.lowTempPercentStep = 10;
|
|
||||||
pumpDescription.lowTempAbsoluteStep = 0;
|
pumpDescription.tempDurationStep = 60;
|
||||||
pumpDescription.lowTempPercentDuration = 30;
|
pumpDescription.tempMaxDuration = 24 * 60;
|
||||||
pumpDescription.lowTempAbsoluteDuration = 30;
|
|
||||||
pumpDescription.highTempPercentStep = 10;
|
|
||||||
pumpDescription.highTempAbsoluteStep = 0;
|
|
||||||
pumpDescription.highTempPercentDuration = 15;
|
|
||||||
pumpDescription.highTempAbsoluteDuration = 0;
|
|
||||||
|
|
||||||
pumpDescription.isSetBasalProfileCapable = true;
|
pumpDescription.isSetBasalProfileCapable = true;
|
||||||
pumpDescription.basalStep = 0.01d;
|
pumpDescription.basalStep = 0.01d;
|
||||||
|
@ -360,8 +357,8 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, ConstraintsInte
|
||||||
Integer percentRate = Double.valueOf(absoluteRate / getBaseBasalRate() * 100).intValue();
|
Integer percentRate = Double.valueOf(absoluteRate / getBaseBasalRate() * 100).intValue();
|
||||||
if (percentRate < 100) percentRate = Round.ceilTo((double) percentRate, 10d).intValue();
|
if (percentRate < 100) percentRate = Round.ceilTo((double) percentRate, 10d).intValue();
|
||||||
else percentRate = Round.floorTo((double) percentRate, 10d).intValue();
|
else percentRate = Round.floorTo((double) percentRate, 10d).intValue();
|
||||||
if (percentRate > getPumpDescription().maxHighTempPercent)
|
if (percentRate > getPumpDescription().maxTempPercent)
|
||||||
percentRate = getPumpDescription().maxHighTempPercent;
|
percentRate = getPumpDescription().maxTempPercent;
|
||||||
// Check if some temp is already in progress
|
// Check if some temp is already in progress
|
||||||
if (MainApp.getConfigBuilder().isTempBasalInProgress()) {
|
if (MainApp.getConfigBuilder().isTempBasalInProgress()) {
|
||||||
// Correct basal already set ?
|
// Correct basal already set ?
|
||||||
|
@ -412,8 +409,8 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, ConstraintsInte
|
||||||
log.error("setTempBasalPercent: Invalid input");
|
log.error("setTempBasalPercent: Invalid input");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (percent > getPumpDescription().maxHighTempPercent)
|
if (percent > getPumpDescription().maxTempPercent)
|
||||||
percent = getPumpDescription().maxHighTempPercent;
|
percent = getPumpDescription().maxTempPercent;
|
||||||
if (pump.isTempBasalInProgress && pump.tempBasalPercent == percent) {
|
if (pump.isTempBasalInProgress && pump.tempBasalPercent == percent) {
|
||||||
result.enacted = false;
|
result.enacted = false;
|
||||||
result.success = true;
|
result.success = true;
|
||||||
|
@ -674,8 +671,8 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, ConstraintsInte
|
||||||
public Integer applyBasalConstraints(Integer percentRate) {
|
public Integer applyBasalConstraints(Integer percentRate) {
|
||||||
Integer origPercentRate = percentRate;
|
Integer origPercentRate = percentRate;
|
||||||
if (percentRate < 0) percentRate = 0;
|
if (percentRate < 0) percentRate = 0;
|
||||||
if (percentRate > getPumpDescription().maxHighTempPercent)
|
if (percentRate > getPumpDescription().maxTempPercent)
|
||||||
percentRate = getPumpDescription().maxHighTempPercent;
|
percentRate = getPumpDescription().maxTempPercent;
|
||||||
if (!Objects.equals(percentRate, origPercentRate) && Config.logConstraintsChanges && !Objects.equals(origPercentRate, Constants.basalPercentOnlyForCheckLimit))
|
if (!Objects.equals(percentRate, origPercentRate) && Config.logConstraintsChanges && !Objects.equals(origPercentRate, Constants.basalPercentOnlyForCheckLimit))
|
||||||
log.debug("Limiting percent rate " + origPercentRate + "% to " + percentRate + "%");
|
log.debug("Limiting percent rate " + origPercentRate + "% to " + percentRate + "%");
|
||||||
return percentRate;
|
return percentRate;
|
||||||
|
|
|
@ -54,22 +54,19 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
|
||||||
pumpDescription.bolusStep = 0.1d;
|
pumpDescription.bolusStep = 0.1d;
|
||||||
|
|
||||||
pumpDescription.isExtendedBolusCapable = true;
|
pumpDescription.isExtendedBolusCapable = true;
|
||||||
pumpDescription.extendedBolusStep = 0.2d;
|
pumpDescription.extendedBolusStep = 0.05d;
|
||||||
pumpDescription.extendedBolusDurationStep = 30;
|
pumpDescription.extendedBolusDurationStep = 30;
|
||||||
|
pumpDescription.extendedBolusMaxDuration = 8 * 60;
|
||||||
|
|
||||||
pumpDescription.isTempBasalCapable = true;
|
pumpDescription.isTempBasalCapable = true;
|
||||||
pumpDescription.lowTempBasalStyle = PumpDescription.ABSOLUTE | PumpDescription.PERCENT;
|
pumpDescription.tempBasalStyle = PumpDescription.PERCENT | PumpDescription.ABSOLUTE;
|
||||||
pumpDescription.highTempBasalStyle = PumpDescription.ABSOLUTE | PumpDescription.PERCENT;
|
|
||||||
pumpDescription.maxHighTempPercent = 600;
|
pumpDescription.maxTempPercent = 500;
|
||||||
pumpDescription.maxHighTempAbsolute = 10;
|
pumpDescription.tempPercentStep = 10;
|
||||||
pumpDescription.lowTempPercentStep = 5;
|
|
||||||
pumpDescription.lowTempAbsoluteStep = 0.1;
|
pumpDescription.tempDurationStep = 30;
|
||||||
pumpDescription.lowTempPercentDuration = 30;
|
pumpDescription.tempMaxDuration = 24 * 60;
|
||||||
pumpDescription.lowTempAbsoluteDuration = 30;
|
|
||||||
pumpDescription.highTempPercentStep = 10;
|
|
||||||
pumpDescription.highTempAbsoluteStep = 0.05d;
|
|
||||||
pumpDescription.highTempPercentDuration = 30;
|
|
||||||
pumpDescription.highTempAbsoluteDuration = 30;
|
|
||||||
|
|
||||||
pumpDescription.isSetBasalProfileCapable = true;
|
pumpDescription.isSetBasalProfileCapable = true;
|
||||||
pumpDescription.basalStep = 0.01d;
|
pumpDescription.basalStep = 0.01d;
|
||||||
|
|
|
@ -17,37 +17,56 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="10dp">
|
android:padding="10dp">
|
||||||
|
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/overview_newtempbasal_typeselector_layout"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_height="wrap_content">
|
||||||
android:orientation="horizontal">
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:text="@string/overview_newtempbasal_basaltype_label"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
android:id="@+id/overview_newtempbasal_radiogroup"
|
android:id="@+id/overview_newtempbasal_radiogroup"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/overview_newtempbasal_percent_radio"
|
android:id="@+id/overview_newtempbasal_percent_radio"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="200dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="20dp"
|
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:text="@string/overview_newtempbasal_percent_label" />
|
android:text="@string/overview_newtempbasal_percent_label"
|
||||||
|
/>
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/overview_newtempbasal_absolute_radio"
|
android:id="@+id/overview_newtempbasal_absolute_radio"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="200dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="20dp"
|
|
||||||
android:text="U/h" />
|
android:text="U/h" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
|
||||||
</LinearLayout>
|
<View
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="2dip"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:background="@color/listdelimiter" />
|
||||||
|
|
||||||
<LinearLayout
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
@ -55,16 +74,18 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_alignParentStart="true"
|
||||||
android:padding="10dp"
|
android:layout_marginTop="5dp"
|
||||||
android:text="@string/overview_newtempbasal_basal_label"
|
android:text="@string/overview_newtempbasal_basal_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/overview_newtempbasal_percent_layout"
|
android:id="@+id/overview_newtempbasal_percent_layout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,6 +124,16 @@
|
||||||
android:src="@drawable/ic_action_add"
|
android:src="@drawable/ic_action_add"
|
||||||
android:tint="#ffffff" />
|
android:tint="#ffffff" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:gravity="left"
|
||||||
|
android:minWidth="40dp"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:text="%"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -110,7 +141,8 @@
|
||||||
android:id="@+id/overview_newtempbasal_absolute_layout"
|
android:id="@+id/overview_newtempbasal_absolute_layout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
@ -149,59 +181,101 @@
|
||||||
android:src="@drawable/ic_action_add"
|
android:src="@drawable/ic_action_add"
|
||||||
android:tint="#ffffff" />
|
android:tint="#ffffff" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:gravity="left"
|
||||||
|
android:minWidth="40dp"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:text="U/h"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="2dip"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_paddingBottom="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:background="@color/listdelimiter" />
|
||||||
|
|
||||||
</LinearLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<RadioGroup
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_horizontal">
|
|
||||||
|
|
||||||
<RadioButton
|
|
||||||
android:id="@+id/overview_newtempbasal_05h"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="true"
|
|
||||||
android:text="0.5 h" />
|
|
||||||
|
|
||||||
<RadioButton
|
|
||||||
android:id="@+id/overview_newtempbasal_1h"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="1 h" />
|
|
||||||
|
|
||||||
<RadioButton
|
|
||||||
android:id="@+id/overview_newtempbasal_2h"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="2 h" />
|
|
||||||
|
|
||||||
<RadioButton
|
|
||||||
android:id="@+id/overview_newtempbasal_3h"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="3 h" />
|
|
||||||
|
|
||||||
<RadioButton
|
|
||||||
android:id="@+id/overview_newtempbasal_4h"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="4 h" />
|
|
||||||
</RadioGroup>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/overview_newtempbasal_okbutton"
|
|
||||||
style="?android:attr/buttonStyle"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:padding="10dp"
|
|
||||||
android:text="OK"
|
|
||||||
android:textSize="20sp" />
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:text="@string/careportal_newnstreatment_duration_label"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/overview_newtempbasal_duration_minus"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/circle"
|
||||||
|
android:backgroundTint="#ffffff"
|
||||||
|
android:src="@drawable/ic_action_minus"
|
||||||
|
android:tint="#ffffff" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/overview_newtempbasal_duration"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:minWidth="100dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text=""
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/overview_newtempbasal_duration_plus"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/circle"
|
||||||
|
android:backgroundTint="#ffffff"
|
||||||
|
android:src="@drawable/ic_action_add"
|
||||||
|
android:tint="#ffffff" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:gravity="left"
|
||||||
|
android:minWidth="40dp"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:text="@string/careportal_newnstreatment_minutes"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<include layout="@layout/mdtp_done_button" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
|
@ -619,4 +619,5 @@
|
||||||
<string name="careportal_canulaage_label">Canula age</string>
|
<string name="careportal_canulaage_label">Canula age</string>
|
||||||
<string name="careportal_insulinage_label">Insulin age</string>
|
<string name="careportal_insulinage_label">Insulin age</string>
|
||||||
<string name="hours">hours</string>
|
<string name="hours">hours</string>
|
||||||
|
<string name="overview_newtempbasal_basaltype_label">Basal type</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue