combobolus dialog plus/minus buttons
This commit is contained in:
parent
07b01cd8d0
commit
2b01b2a10b
2 changed files with 59 additions and 21 deletions
|
@ -11,10 +11,14 @@ import android.widget.Button;
|
|||
import android.widget.EditText;
|
||||
import android.widget.RadioButton;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.data.PumpEnactResult;
|
||||
import info.nightscout.androidaps.interfaces.PumpInterface;
|
||||
import info.nightscout.utils.PlusMinusEditText;
|
||||
import info.nightscout.utils.SafeParse;
|
||||
|
||||
public class NewExtendedBolusDialog extends DialogFragment implements View.OnClickListener {
|
||||
|
@ -27,6 +31,8 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli
|
|||
RadioButton h30Radio;
|
||||
RadioButton h40Radio;
|
||||
|
||||
PlusMinusEditText editInsulin;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
@ -41,6 +47,9 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli
|
|||
h30Radio = (RadioButton) view.findViewById(R.id.overview_newextendedbolus_3h);
|
||||
h40Radio = (RadioButton) view.findViewById(R.id.overview_newextendedbolus_4h);
|
||||
|
||||
Double maxInsulin = MainApp.getConfigBuilder().applyBolusConstraints(Constants.bolusOnlyForCheckLimit);
|
||||
editInsulin = new PlusMinusEditText(view, R.id.overview_newextendedbolus_insulin, R.id.overview_newextendedbolus_insulin_plus, R.id.overview_newextendedbolus_insulin_minus, 0d, 0d, maxInsulin, 0.05d, new DecimalFormat("0.00"), false);
|
||||
|
||||
okButton.setOnClickListener(this);
|
||||
return view;
|
||||
}
|
||||
|
|
|
@ -18,16 +18,45 @@
|
|||
android:text="@string/treatments_newtreatment_insulinamount_label"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/overview_newextendedbolus_insulin"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:inputType="numberDecimal"
|
||||
android:minWidth="200dp"
|
||||
android:padding="10dp"
|
||||
android:text=""
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/overview_newextendedbolus_insulin_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" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/overview_newextendedbolus_insulin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:inputType="numberDecimal"
|
||||
android:minWidth="200dp"
|
||||
android:padding="10dp"
|
||||
android:text=""
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:gravity="center_horizontal" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/overview_newextendedbolus_insulin_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" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RadioGroup
|
||||
|
@ -36,35 +65,35 @@
|
|||
android:layout_gravity="center_horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0.5 h"
|
||||
android:id="@+id/overview_newextendedbolus_05h"
|
||||
android:checked="true" />
|
||||
|
||||
<RadioButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1 h"
|
||||
android:id="@+id/overview_newextendedbolus_1h" />
|
||||
android:checked="true"
|
||||
android:text="0.5 h" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/overview_newextendedbolus_1h"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2 h"
|
||||
android:id="@+id/overview_newextendedbolus_2h" />
|
||||
android:text="1 h" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/overview_newextendedbolus_2h"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="3 h"
|
||||
android:id="@+id/overview_newextendedbolus_3h" />
|
||||
android:text="2 h" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/overview_newextendedbolus_3h"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="4 h"
|
||||
android:id="@+id/overview_newextendedbolus_4h" />
|
||||
android:text="3 h" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/overview_newextendedbolus_4h"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="4 h" />
|
||||
</RadioGroup>
|
||||
|
||||
<Button
|
||||
|
|
Loading…
Reference in a new issue