CPP shiftfix and base profile view

This commit is contained in:
AdrianLxM 2016-11-13 06:53:00 +01:00
parent 2c5b20a721
commit 3fe7c7a0fa
9 changed files with 96 additions and 11 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -41,7 +41,9 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
EditText percentageView;
EditText timeshiftView;
TextView profileView;
TextView baseprofileView;
TextView baseprofileIC;
TextView baseprofileBasal;
TextView baseprofileISF;
Button profileswitchButton;
@ -59,7 +61,10 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
percentageView = (EditText) layout.findViewById(R.id.circadianpercentageprofile_percentage);
timeshiftView = (EditText) layout.findViewById(R.id.circadianpercentageprofile_timeshift);
profileView = (TextView) layout.findViewById(R.id.circadianpercentageprofile_profileview);
baseprofileView = (TextView) layout.findViewById(R.id.circadianpercentageprofile_baseprofileview);
baseprofileBasal = (TextView) layout.findViewById(R.id.circadianpercentageprofile_baseprofilebasal);
baseprofileIC = (TextView) layout.findViewById(R.id.circadianpercentageprofile_baseprofileic);
baseprofileISF = (TextView) layout.findViewById(R.id.circadianpercentageprofile_baseprofileisf);
profileswitchButton = (Button) layout.findViewById(R.id.circadianpercentageprofile_profileswitch);
mgdlView.setChecked(circadianPercentageProfilePlugin.mgdl);
@ -149,10 +154,9 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
sb.append("<h4>ISF:</h4> " + circadianPercentageProfilePlugin.isfString());
profileView.setText(Html.fromHtml(sb.toString()));
baseprofileView.setText("Base Profile:\n");
baseprofileView.append("Basal: " + circadianPercentageProfilePlugin.baseBasalString() + "\n");
baseprofileView.append("IC: " + circadianPercentageProfilePlugin.baseIcString() + "\n");
baseprofileView.append("ISF: " + circadianPercentageProfilePlugin.baseIsfString() + "\n");
baseprofileBasal.setText(Html.fromHtml("<h3>Base Profile:</h3><h4>Basal: </h4>" + circadianPercentageProfilePlugin.baseBasalString()));
baseprofileIC.setText(Html.fromHtml("<h4>IC: </h4>" + circadianPercentageProfilePlugin.baseIcString()));
baseprofileISF.setText(Html.fromHtml("<h4>ISF: </h4>" + circadianPercentageProfilePlugin.baseIsfString()));
}
}

View file

@ -269,6 +269,7 @@ public class CircadianPercentageProfilePlugin implements PluginBase, ProfileInte
}
private static String profileString(double[] values, int timeshift, int percentage){
timeshift = -(timeshift%24) + 24;
StringBuilder sb = new StringBuilder();
sb.append("<b>"); sb.append(0); sb.append("h: "); sb.append("</b>");
sb.append(DecimalFormatter.to2Decimal(values[(timeshift+0)%24]*percentage/100d));

View file

@ -95,21 +95,101 @@
android:layout_gravity="center_horizontal"
android:textColor="@color/colorProfileSwitchButton" />
<TextView
android:id="@+id/circadianpercentageprofile_baseprofileview"
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="6dp"
android:padding="6dp"
android:background="@color/cardColorBackground"
android:text="Profile View"
android:textAppearance="?android:attr/textAppearanceSmall" />
android:textAppearance="?android:attr/textAppearanceSmall">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground"
android:textAppearance="?android:attr/textAppearanceSmall">
<TextView
android:id="@+id/circadianpercentageprofile_baseprofilebasal"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_weight="1"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_edit"
android:layout_weight="0"
android:layout_gravity="center_vertical"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground"
android:textAppearance="?android:attr/textAppearanceSmall"
android:paddingTop="5dp">
<TextView
android:id="@+id/circadianpercentageprofile_baseprofileic"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_weight="1"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_edit"
android:layout_weight="0"
android:layout_gravity="center_vertical"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground"
android:textAppearance="?android:attr/textAppearanceSmall"
android:paddingTop="5dp">
<TextView
android:id="@+id/circadianpercentageprofile_baseprofileisf"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_weight="1"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_edit"
android:layout_weight="0"
android:layout_gravity="center_vertical"/>
</LinearLayout>
</LinearLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left|top">
android:layout_gravity="left|top"
android:layout_marginLeft="6dp">
<TableRow
android:layout_width="match_parent"

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB