Align LP GUI

This commit is contained in:
AdrianLxM 2017-10-11 20:19:42 +02:00
parent 339c33bd75
commit 39b18915d0
2 changed files with 53 additions and 10 deletions

View file

@ -84,10 +84,10 @@ public class LocalProfileFragment extends SubscriberFragment {
diaView.setParams(localProfilePlugin.dia, 2d, 48d, 0.1d, new DecimalFormat("0.0"), false, textWatch);
mgdlView = (RadioButton) layout.findViewById(R.id.localprofile_mgdl);
mmolView = (RadioButton) layout.findViewById(R.id.localprofile_mmol);
icView = new TimeListEdit(getContext(), layout, R.id.localprofile_ic, MainApp.sResources.getString(R.string.nsprofileview_ic_label), getPlugin().ic, null, 0.1d, new DecimalFormat("0.0"), save);
isfView = new TimeListEdit(getContext(), layout, R.id.localprofile_isf, MainApp.sResources.getString(R.string.nsprofileview_isf_label), getPlugin().isf, null, 0.1d, new DecimalFormat("0.0"), save);
basalView = new TimeListEdit(getContext(), layout, R.id.localprofile_basal, MainApp.sResources.getString(R.string.nsprofileview_basal_label), getPlugin().basal, null, 0.01d, new DecimalFormat("0.00"), save);
targetView = new TimeListEdit(getContext(), layout, R.id.localprofile_target, MainApp.sResources.getString(R.string.nsprofileview_target_label), getPlugin().targetLow, getPlugin().targetHigh, 0.1d, new DecimalFormat("0.0"), save);
icView = new TimeListEdit(getContext(), layout, R.id.localprofile_ic, MainApp.sResources.getString(R.string.nsprofileview_ic_label) + ":", getPlugin().ic, null, 0.1d, new DecimalFormat("0.0"), save);
isfView = new TimeListEdit(getContext(), layout, R.id.localprofile_isf, MainApp.sResources.getString(R.string.nsprofileview_isf_label) + ":", getPlugin().isf, null, 0.1d, new DecimalFormat("0.0"), save);
basalView = new TimeListEdit(getContext(), layout, R.id.localprofile_basal, MainApp.sResources.getString(R.string.nsprofileview_basal_label)+ ":", getPlugin().basal, null, 0.01d, new DecimalFormat("0.00"), save);
targetView = new TimeListEdit(getContext(), layout, R.id.localprofile_target, MainApp.sResources.getString(R.string.nsprofileview_target_label)+ ":", getPlugin().targetLow, getPlugin().targetHigh, 0.1d, new DecimalFormat("0.0"), save);
profileswitchButton = (Button) layout.findViewById(R.id.localprofile_profileswitch);
PumpInterface pump = MainApp.getConfigBuilder();

View file

@ -17,6 +17,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/linearBlockBackground"
android:layout_marginLeft="10px"
android:text="@string/units"
android:textAppearance="?android:attr/textAppearanceMedium" />
@ -44,15 +45,57 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/linearBlockBackground"
android:layout_marginLeft="10px"
android:text="@string/dia"
android:textAppearance="?android:attr/textAppearanceMedium" />
<info.nightscout.utils.NumberPicker
android:id="@+id/localprofile_dia"
android:layout_width="130dp"
android:layout_height="40dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="10dp" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="5dp"
android:textAppearance="?android:attr/textAppearanceSmall">
<!-- dummy to align with TimeListEdits added dynamically -->
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:minWidth="80dp"
android:visibility="invisible"/>
<info.nightscout.utils.NumberPicker
android:id="@+id/localprofile_dia"
android:layout_width="130dp"
android:layout_height="40dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="10dp"/>
<!-- dummy to align with TimeListEdits added dynamically -->
<ImageView
android:id="@+id/timelistedit_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp"
android:src="@drawable/add"
android:visibility="invisible"/>
<!-- dummy to align with TimeListEdits added dynamically -->
<ImageView
android:id="@+id/timelistedit_remove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp"
android:src="@drawable/remove"
android:visibility="invisible"/>
</LinearLayout>
<LinearLayout
android:id="@+id/localprofile_ic"