numberpicker in wizard dialog
This commit is contained in:
parent
4fc935f0bd
commit
c3876c730b
|
@ -60,6 +60,7 @@ import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateGui
|
|||
import info.nightscout.utils.BolusWizard;
|
||||
import info.nightscout.utils.DateUtil;
|
||||
import info.nightscout.utils.DecimalFormatter;
|
||||
import info.nightscout.utils.NumberPicker;
|
||||
import info.nightscout.utils.OKDialog;
|
||||
import info.nightscout.utils.PlusMinusEditText;
|
||||
import info.nightscout.utils.SP;
|
||||
|
@ -69,10 +70,7 @@ import info.nightscout.utils.ToastUtils;
|
|||
public class WizardDialog extends DialogFragment implements OnClickListener, CompoundButton.OnCheckedChangeListener, Spinner.OnItemSelectedListener {
|
||||
private static Logger log = LoggerFactory.getLogger(WizardDialog.class);
|
||||
|
||||
Button wizardDialogDeliverButton;
|
||||
TextView correctionInput;
|
||||
TextView carbsInput;
|
||||
TextView bgInput;
|
||||
Button okButton;
|
||||
TextView bg;
|
||||
TextView bgInsulin;
|
||||
TextView bgUnits;
|
||||
|
@ -85,8 +83,6 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
CheckBox basalIobCheckbox;
|
||||
TextView correctionInsulin;
|
||||
TextView total;
|
||||
TextView totalInsulin;
|
||||
EditText carbTimeEdit;
|
||||
Spinner profileSpinner;
|
||||
CheckBox superbolusCheckbox;
|
||||
TextView superbolus;
|
||||
|
@ -99,10 +95,10 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
TextView cob;
|
||||
TextView cobInsulin;
|
||||
|
||||
PlusMinusEditText editBg;
|
||||
PlusMinusEditText editCarbs;
|
||||
PlusMinusEditText editCorr;
|
||||
PlusMinusEditText editCarbTime;
|
||||
NumberPicker editBg;
|
||||
NumberPicker editCarbs;
|
||||
NumberPicker editCorr;
|
||||
NumberPicker editCarbTime;
|
||||
|
||||
Integer calculatedCarbs = 0;
|
||||
Double calculatedTotalInsulin = 0d;
|
||||
|
@ -129,9 +125,7 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (getDialog() != null)
|
||||
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
super.onPause();
|
||||
MainApp.bus().register(this);
|
||||
}
|
||||
|
||||
|
@ -195,8 +189,9 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
|
||||
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
|
||||
|
||||
wizardDialogDeliverButton = (Button) view.findViewById(R.id.treatments_wizard_deliverButton);
|
||||
wizardDialogDeliverButton.setOnClickListener(this);
|
||||
okButton = (Button) view.findViewById(R.id.ok);
|
||||
okButton.setOnClickListener(this);
|
||||
view.findViewById(R.id.cancel).setOnClickListener(this);
|
||||
|
||||
bg = (TextView) view.findViewById(R.id.treatments_wizard_bg);
|
||||
bgInsulin = (TextView) view.findViewById(R.id.treatments_wizard_bginsulin);
|
||||
|
@ -207,8 +202,6 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
basalIobInsulin = (TextView) view.findViewById(R.id.treatments_wizard_basaliobinsulin);
|
||||
correctionInsulin = (TextView) view.findViewById(R.id.treatments_wizard_correctioninsulin);
|
||||
total = (TextView) view.findViewById(R.id.treatments_wizard_total);
|
||||
totalInsulin = (TextView) view.findViewById(R.id.treatments_wizard_totalinsulin);
|
||||
carbTimeEdit = (EditText) view.findViewById(R.id.treatments_wizard_carbtimeinput);
|
||||
superbolus = (TextView) view.findViewById(R.id.treatments_wizard_sb);
|
||||
superbolusInsulin = (TextView) view.findViewById(R.id.treatments_wizard_sbinsulin);
|
||||
|
||||
|
@ -236,22 +229,20 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
profileSpinner = (Spinner) view.findViewById(R.id.treatments_wizard_profile);
|
||||
profileSpinner.setOnItemSelectedListener(this);
|
||||
|
||||
correctionInput = (TextView) view.findViewById(R.id.treatments_wizard_correctioninput);
|
||||
carbsInput = (TextView) view.findViewById(R.id.treatments_wizard_carbsinput);
|
||||
bgInput = (TextView) view.findViewById(R.id.treatments_wizard_bginput);
|
||||
correctionInput.addTextChangedListener(textWatcher);
|
||||
carbsInput.addTextChangedListener(textWatcher);
|
||||
bgInput.addTextChangedListener(textWatcher);
|
||||
editCarbTime = (NumberPicker) view.findViewById(R.id.treatments_wizard_carbtimeinput);
|
||||
editCorr = (NumberPicker) view.findViewById(R.id.treatments_wizard_correctioninput);
|
||||
editCarbs = (NumberPicker) view.findViewById(R.id.treatments_wizard_carbsinput);
|
||||
editBg = (NumberPicker) view.findViewById(R.id.treatments_wizard_bginput);
|
||||
|
||||
superbolusCheckbox.setVisibility(SP.getBoolean(R.string.key_usesuperbolus, false) ? View.VISIBLE : View.GONE);
|
||||
|
||||
Integer maxCarbs = MainApp.getConfigBuilder().applyCarbsConstraints(Constants.carbsOnlyForCheckLimit);
|
||||
Double maxCorrection = MainApp.getConfigBuilder().applyBolusConstraints(Constants.bolusOnlyForCheckLimit);
|
||||
|
||||
editBg = new PlusMinusEditText(view, R.id.treatments_wizard_bginput, R.id.treatments_wizard_bginput_plus, R.id.treatments_wizard_bginput_minus, 0d, 0d, 500d, 0.1d, new DecimalFormat("0.0"), false);
|
||||
editCarbs = new PlusMinusEditText(view, R.id.treatments_wizard_carbsinput, R.id.treatments_wizard_carbsinput_plus, R.id.treatments_wizard_carbsinput_minus, 0d, 0d, (double) maxCarbs, 1d, new DecimalFormat("0"), false);
|
||||
editCorr = new PlusMinusEditText(view, R.id.treatments_wizard_correctioninput, R.id.treatments_wizard_correctioninput_plus, R.id.treatments_wizard_correctioninput_minus, 0d, -maxCorrection, maxCorrection, 0.05d, new DecimalFormat("0.00"), false);
|
||||
editCarbTime = new PlusMinusEditText(view, R.id.treatments_wizard_carbtimeinput, R.id.treatments_wizard_carbtime_plus, R.id.treatments_wizard_carbtime_minus, 0d, -60d, 60d, 5d, new DecimalFormat("0"), false);
|
||||
editBg.setParams(0d, 0d, 500d, 0.1d, new DecimalFormat("0.0"), false, textWatcher);
|
||||
editCarbs.setParams(0d, 0d, (double) maxCarbs, 1d, new DecimalFormat("0"), false, textWatcher);
|
||||
editCorr.setParams(0d, -maxCorrection, maxCorrection, 0.05d, new DecimalFormat("0.00"), false, textWatcher);
|
||||
editCarbTime.setParams(0d, -60d, 60d, 5d, new DecimalFormat("0"), false);
|
||||
initDialog();
|
||||
|
||||
return view;
|
||||
|
@ -265,19 +256,19 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
calculateInsulin();
|
||||
wizardDialogDeliverButton.setVisibility(View.VISIBLE);
|
||||
okButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
ToastUtils.showToastInUiThread(context, MainApp.sResources.getString(R.string.noprofileselected));
|
||||
wizardDialogDeliverButton.setVisibility(View.GONE);
|
||||
okButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.treatments_wizard_deliverButton:
|
||||
case R.id.ok:
|
||||
if (calculatedTotalInsulin > 0d || calculatedCarbs > 0d) {
|
||||
DecimalFormat formatNumber2decimalplaces = new DecimalFormat("0.00");
|
||||
String confirmMessage = getString(R.string.entertreatmentquestion);
|
||||
|
@ -299,8 +290,8 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
|
||||
final Double finalInsulinAfterConstraints = insulinAfterConstraints;
|
||||
final Integer finalCarbsAfterConstraints = carbsAfterConstraints;
|
||||
final Double bg = SafeParse.stringToDouble(bgInput.getText().toString());
|
||||
final int carbTime = SafeParse.stringToInt(carbTimeEdit.getText().toString());
|
||||
final Double bg = SafeParse.stringToDouble(editBg.getText());
|
||||
final int carbTime = SafeParse.stringToInt(editCarbTime.getText());
|
||||
final boolean useSuperBolus = superbolusCheckbox.isChecked();
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
|
@ -350,6 +341,9 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
dismiss();
|
||||
}
|
||||
break;
|
||||
case R.id.cancel:
|
||||
dismiss();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -396,17 +390,17 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
|
||||
bg.setText(lastBg.valueToUnitsToString(units) + " ISF: " + DecimalFormatter.to1Decimal(sens));
|
||||
bgInsulin.setText(DecimalFormatter.to2Decimal(bgDiff / sens) + "U");
|
||||
bgInput.removeTextChangedListener(textWatcher);
|
||||
editBg.removeTextChangedListener(textWatcher);
|
||||
//bgInput.setText(lastBg.valueToUnitsToString(units));
|
||||
editBg.setValue(lastBg.valueToUnits(units));
|
||||
bgInput.addTextChangedListener(textWatcher);
|
||||
editBg.addTextChangedListener(textWatcher);
|
||||
} else {
|
||||
bg.setText("");
|
||||
bgInsulin.setText("");
|
||||
bgInput.removeTextChangedListener(textWatcher);
|
||||
editBg.removeTextChangedListener(textWatcher);
|
||||
//bgInput.setText("");
|
||||
editBg.setValue(0d);
|
||||
bgInput.addTextChangedListener(textWatcher);
|
||||
editBg.addTextChangedListener(textWatcher);
|
||||
}
|
||||
|
||||
// IOB calculation
|
||||
|
@ -418,9 +412,6 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
bolusIobInsulin.setText(DecimalFormatter.to2Decimal(-bolusIob.iob) + "U");
|
||||
basalIobInsulin.setText(DecimalFormatter.to2Decimal(-basalIob.basaliob) + "U");
|
||||
|
||||
totalInsulin.setText("");
|
||||
wizardDialogDeliverButton.setVisibility(Button.INVISIBLE);
|
||||
|
||||
// COB only if AMA is selected
|
||||
if (ConfigBuilderPlugin.getActiveAPS() instanceof OpenAPSAMAPlugin && ConfigBuilderPlugin.getActiveAPS().getLastAPSResult() != null && ConfigBuilderPlugin.getActiveAPS().getLastAPSRun().after(new Date(System.currentTimeMillis() - 11 * 60 * 1000L))) {
|
||||
cobLayout.setVisibility(View.VISIBLE);
|
||||
|
@ -429,6 +420,7 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
cobLayout.setVisibility(View.GONE);
|
||||
cobAvailable = false;
|
||||
}
|
||||
calculateInsulin();
|
||||
}
|
||||
|
||||
private void calculateInsulin() {
|
||||
|
@ -439,23 +431,23 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
Profile specificProfile = profile.getSpecificProfile(selectedAlternativeProfile);
|
||||
|
||||
// Entered values
|
||||
Double c_bg = SafeParse.stringToDouble(bgInput.getText().toString());
|
||||
Integer c_carbs = SafeParse.stringToInt(carbsInput.getText().toString());
|
||||
Double c_correction = SafeParse.stringToDouble(correctionInput.getText().toString());
|
||||
Double c_bg = SafeParse.stringToDouble(editBg.getText());
|
||||
Integer c_carbs = SafeParse.stringToInt(editCarbs.getText());
|
||||
Double c_correction = SafeParse.stringToDouble(editCorr.getText());
|
||||
Double corrAfterConstraint = MainApp.getConfigBuilder().applyBolusConstraints(c_correction);
|
||||
if (c_correction - corrAfterConstraint != 0) { // c_correction != corrAfterConstraint doesn't work
|
||||
correctionInput.removeTextChangedListener(textWatcher);
|
||||
correctionInput.setText("");
|
||||
correctionInput.addTextChangedListener(textWatcher);
|
||||
editCorr.removeTextChangedListener(textWatcher);
|
||||
editCorr.setValue(0d);
|
||||
editCorr.addTextChangedListener(textWatcher);
|
||||
//wizardDialogDeliverButton.setVisibility(Button.GONE);
|
||||
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), getString(R.string.bolusconstraintapplied));
|
||||
return;
|
||||
}
|
||||
Integer carbsAfterConstraint = MainApp.getConfigBuilder().applyCarbsConstraints(c_carbs);
|
||||
if (c_carbs - carbsAfterConstraint != 0) {
|
||||
carbsInput.removeTextChangedListener(textWatcher);
|
||||
carbsInput.setText("");
|
||||
carbsInput.addTextChangedListener(textWatcher);
|
||||
editCarbs.removeTextChangedListener(textWatcher);
|
||||
editCarbs.setValue(0d);
|
||||
editCarbs.addTextChangedListener(textWatcher);
|
||||
//wizardDialogDeliverButton.setVisibility(Button.GONE);
|
||||
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), getString(R.string.carbsconstraintapplied));
|
||||
return;
|
||||
|
@ -489,14 +481,6 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
correctionInsulin.setText(DecimalFormatter.to2Decimal(wizard.insulinFromCorrection) + "U");
|
||||
calculatedTotalInsulin = wizard.calculatedTotalInsulin;
|
||||
|
||||
if (calculatedTotalInsulin <= 0) {
|
||||
total.setText(getString(R.string.missing) + " " + DecimalFormatter.to0Decimal(wizard.carbsEquivalent) + "g");
|
||||
totalInsulin.setText("");
|
||||
} else {
|
||||
total.setText("");
|
||||
totalInsulin.setText(DecimalFormatter.to2Decimal(calculatedTotalInsulin) + "U");
|
||||
}
|
||||
|
||||
calculatedCarbs = carbsAfterConstraint;
|
||||
|
||||
// Superbolus
|
||||
|
@ -531,10 +515,11 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
if (calculatedTotalInsulin > 0d || calculatedCarbs > 0d) {
|
||||
String insulinText = calculatedTotalInsulin > 0d ? (DecimalFormatter.to2Decimal(calculatedTotalInsulin) + "U") : "";
|
||||
String carbsText = calculatedCarbs > 0d ? (DecimalFormatter.to0Decimal(calculatedCarbs) + "g") : "";
|
||||
wizardDialogDeliverButton.setText(getString(R.string.send) + " " + insulinText + " " + carbsText);
|
||||
wizardDialogDeliverButton.setVisibility(Button.VISIBLE);
|
||||
total.setText(getString(R.string.send) + " " + insulinText + " " + carbsText);
|
||||
okButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
wizardDialogDeliverButton.setVisibility(Button.INVISIBLE);
|
||||
total.setText(getString(R.string.missing) + " " + DecimalFormatter.to0Decimal(wizard.carbsEquivalent) + "g");
|
||||
okButton.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
boluscalcJSON = new JSONObject();
|
||||
|
|
|
@ -3,6 +3,7 @@ package info.nightscout.utils;
|
|||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -120,6 +121,19 @@ public class NumberPicker extends LinearLayout implements View.OnKeyListener,
|
|||
plusButton.setOnClickListener(this);
|
||||
}
|
||||
|
||||
public void removeTextChangedListener(TextWatcher textWatcher) {
|
||||
editText.removeTextChangedListener(textWatcher);
|
||||
}
|
||||
|
||||
public void addTextChangedListener(TextWatcher textWatcher) {
|
||||
editText.addTextChangedListener(textWatcher);
|
||||
}
|
||||
|
||||
public void setParams(Double initValue, Double minValue, Double maxValue, Double step, NumberFormat formater, boolean allowZero, TextWatcher textWatcher) {
|
||||
setParams(initValue, minValue, maxValue, step, formater, allowZero);
|
||||
editText.addTextChangedListener(textWatcher);
|
||||
}
|
||||
|
||||
public void setParams(Double initValue, Double minValue, Double maxValue, Double step, NumberFormat formater, boolean allowZero) {
|
||||
this.value = initValue;
|
||||
this.minValue = minValue;
|
||||
|
|
|
@ -26,38 +26,13 @@
|
|||
android:width="120dp"
|
||||
android:padding="10dp"
|
||||
android:text="@string/treatments_wizard_bg_label"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/treatments_wizard_bginput_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
|
||||
<info.nightscout.utils.NumberPicker
|
||||
android:id="@+id/treatments_wizard_bginput"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="0.5"
|
||||
android:gravity="center_horizontal"
|
||||
android:inputType="numberDecimal"
|
||||
android:padding="10dp"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/treatments_wizard_bginput_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" />
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="40dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/treatments_wizard_bgunits"
|
||||
|
@ -84,40 +59,15 @@
|
|||
android:width="120dp"
|
||||
android:padding="10dp"
|
||||
android:text="@string/treatments_wizard_carbs_label"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/treatments_wizard_carbsinput_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
|
||||
<info.nightscout.utils.NumberPicker
|
||||
android:id="@+id/treatments_wizard_carbsinput"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="0.5"
|
||||
android:gravity="center_horizontal"
|
||||
android:inputType="numberDecimal"
|
||||
android:minWidth="200dp"
|
||||
android:padding="10dp"
|
||||
android:text=""
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/treatments_wizard_carbsinput_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"
|
||||
|
@ -143,40 +93,14 @@
|
|||
android:width="120dp"
|
||||
android:padding="10dp"
|
||||
android:text="@string/treatments_wizard_correction_label"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/treatments_wizard_correctioninput_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
|
||||
<info.nightscout.utils.NumberPicker
|
||||
android:id="@+id/treatments_wizard_correctioninput"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="0.5"
|
||||
android:gravity="center_horizontal"
|
||||
android:inputType="numberSigned|numberDecimal"
|
||||
android:minWidth="200dp"
|
||||
android:padding="10dp"
|
||||
android:text=""
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/treatments_wizard_correctioninput_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" />
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -194,50 +118,23 @@
|
|||
android:id="@+id/treatments_wizard_carbtime_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:width="120dp"
|
||||
android:padding="10dp"
|
||||
android:text="@string/careportal_newnstreatment_carbtime_label"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/treatments_wizard_carbtime_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
|
||||
<info.nightscout.utils.NumberPicker
|
||||
android:id="@+id/treatments_wizard_carbtimeinput"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="0.5"
|
||||
android:gravity="center_horizontal"
|
||||
android:inputType="numberDecimal"
|
||||
android:minWidth="200dp"
|
||||
android:padding="10dp"
|
||||
android:text=""
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/treatments_wizard_carbtime_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" />
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -263,7 +160,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:text="@string/careportal_newnstreatment_profile_label"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/treatments_wizard_profile"
|
||||
|
@ -284,32 +182,31 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/treatments_wizard_deliverButton"
|
||||
style="?android:attr/buttonStyle"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="10dp"
|
||||
android:text="SEND TO PUMP"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="20sp" />
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/treatments_wizard_total"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/background_darkgray"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="2.35U 28g"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/mdtp_done_button" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="-20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<CheckBox
|
||||
|
@ -589,45 +486,5 @@
|
|||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:width="32dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:width="80dp"
|
||||
android:height="30dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/treatments_wizard_total_label"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/accent_material_light"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/treatments_wizard_total"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:width="100dp"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/treatments_wizard_totalinsulin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:width="50dp"
|
||||
android:gravity="center_vertical|end"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/accent_material_light"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
Loading…
Reference in a new issue