CPP shiftfix and base profile view
This commit is contained in:
parent
2c5b20a721
commit
3fe7c7a0fa
9 changed files with 96 additions and 11 deletions
BIN
app/src/main/ic_edit-web.png
Normal file
BIN
app/src/main/ic_edit-web.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
|
@ -41,7 +41,9 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
||||||
EditText percentageView;
|
EditText percentageView;
|
||||||
EditText timeshiftView;
|
EditText timeshiftView;
|
||||||
TextView profileView;
|
TextView profileView;
|
||||||
TextView baseprofileView;
|
TextView baseprofileIC;
|
||||||
|
TextView baseprofileBasal;
|
||||||
|
TextView baseprofileISF;
|
||||||
Button profileswitchButton;
|
Button profileswitchButton;
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,7 +61,10 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
||||||
percentageView = (EditText) layout.findViewById(R.id.circadianpercentageprofile_percentage);
|
percentageView = (EditText) layout.findViewById(R.id.circadianpercentageprofile_percentage);
|
||||||
timeshiftView = (EditText) layout.findViewById(R.id.circadianpercentageprofile_timeshift);
|
timeshiftView = (EditText) layout.findViewById(R.id.circadianpercentageprofile_timeshift);
|
||||||
profileView = (TextView) layout.findViewById(R.id.circadianpercentageprofile_profileview);
|
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);
|
profileswitchButton = (Button) layout.findViewById(R.id.circadianpercentageprofile_profileswitch);
|
||||||
|
|
||||||
mgdlView.setChecked(circadianPercentageProfilePlugin.mgdl);
|
mgdlView.setChecked(circadianPercentageProfilePlugin.mgdl);
|
||||||
|
@ -149,10 +154,9 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
||||||
sb.append("<h4>ISF:</h4> " + circadianPercentageProfilePlugin.isfString());
|
sb.append("<h4>ISF:</h4> " + circadianPercentageProfilePlugin.isfString());
|
||||||
profileView.setText(Html.fromHtml(sb.toString()));
|
profileView.setText(Html.fromHtml(sb.toString()));
|
||||||
|
|
||||||
baseprofileView.setText("Base Profile:\n");
|
baseprofileBasal.setText(Html.fromHtml("<h3>Base Profile:</h3><h4>Basal: </h4>" + circadianPercentageProfilePlugin.baseBasalString()));
|
||||||
baseprofileView.append("Basal: " + circadianPercentageProfilePlugin.baseBasalString() + "\n");
|
baseprofileIC.setText(Html.fromHtml("<h4>IC: </h4>" + circadianPercentageProfilePlugin.baseIcString()));
|
||||||
baseprofileView.append("IC: " + circadianPercentageProfilePlugin.baseIcString() + "\n");
|
baseprofileISF.setText(Html.fromHtml("<h4>ISF: </h4>" + circadianPercentageProfilePlugin.baseIsfString()));
|
||||||
baseprofileView.append("ISF: " + circadianPercentageProfilePlugin.baseIsfString() + "\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,6 +269,7 @@ public class CircadianPercentageProfilePlugin implements PluginBase, ProfileInte
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String profileString(double[] values, int timeshift, int percentage){
|
private static String profileString(double[] values, int timeshift, int percentage){
|
||||||
|
timeshift = -(timeshift%24) + 24;
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("<b>"); sb.append(0); sb.append("h: "); sb.append("</b>");
|
sb.append("<b>"); sb.append(0); sb.append("h: "); sb.append("</b>");
|
||||||
sb.append(DecimalFormatter.to2Decimal(values[(timeshift+0)%24]*percentage/100d));
|
sb.append(DecimalFormatter.to2Decimal(values[(timeshift+0)%24]*percentage/100d));
|
||||||
|
|
|
@ -95,21 +95,101 @@
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:textColor="@color/colorProfileSwitchButton" />
|
android:textColor="@color/colorProfileSwitchButton" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/circadianpercentageprofile_baseprofileview"
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="6dp"
|
android:layout_margin="6dp"
|
||||||
android:padding="6dp"
|
android:padding="6dp"
|
||||||
android:background="@color/cardColorBackground"
|
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
|
<TableLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="left|top">
|
android:layout_gravity="left|top"
|
||||||
|
android:layout_marginLeft="6dp">
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
BIN
app/src/main/res/mipmap-hdpi/ic_edit.png
Normal file
BIN
app/src/main/res/mipmap-hdpi/ic_edit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 821 B |
BIN
app/src/main/res/mipmap-mdpi/ic_edit.png
Normal file
BIN
app/src/main/res/mipmap-mdpi/ic_edit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 632 B |
BIN
app/src/main/res/mipmap-xhdpi/ic_edit.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/ic_edit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_edit.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/ic_edit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_edit.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/ic_edit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
Loading…
Reference in a new issue