commit
5f4a8330e1
3 changed files with 44 additions and 3 deletions
|
@ -84,6 +84,8 @@ public class OverviewFragment extends Fragment {
|
||||||
TextView timeAgoView;
|
TextView timeAgoView;
|
||||||
TextView deltaView;
|
TextView deltaView;
|
||||||
TextView runningTempView;
|
TextView runningTempView;
|
||||||
|
TextView baseBasalView;
|
||||||
|
TextView activeProfileView;
|
||||||
TextView iobView;
|
TextView iobView;
|
||||||
TextView apsModeView;
|
TextView apsModeView;
|
||||||
GraphView bgGraph;
|
GraphView bgGraph;
|
||||||
|
@ -120,6 +122,9 @@ public class OverviewFragment extends Fragment {
|
||||||
timeAgoView = (TextView) view.findViewById(R.id.overview_timeago);
|
timeAgoView = (TextView) view.findViewById(R.id.overview_timeago);
|
||||||
deltaView = (TextView) view.findViewById(R.id.overview_delta);
|
deltaView = (TextView) view.findViewById(R.id.overview_delta);
|
||||||
runningTempView = (TextView) view.findViewById(R.id.overview_runningtemp);
|
runningTempView = (TextView) view.findViewById(R.id.overview_runningtemp);
|
||||||
|
baseBasalView = (TextView) view.findViewById(R.id.overview_basebasal);
|
||||||
|
activeProfileView = (TextView) view.findViewById(R.id.overview_activeprofile);
|
||||||
|
|
||||||
iobView = (TextView) view.findViewById(R.id.overview_iob);
|
iobView = (TextView) view.findViewById(R.id.overview_iob);
|
||||||
apsModeView = (TextView) view.findViewById(R.id.overview_apsmode);
|
apsModeView = (TextView) view.findViewById(R.id.overview_apsmode);
|
||||||
bgGraph = (GraphView) view.findViewById(R.id.overview_bggraph);
|
bgGraph = (GraphView) view.findViewById(R.id.overview_bggraph);
|
||||||
|
@ -406,6 +411,7 @@ public class OverviewFragment extends Fragment {
|
||||||
if (Config.APS) {
|
if (Config.APS) {
|
||||||
apsModeView.setVisibility(View.VISIBLE);
|
apsModeView.setVisibility(View.VISIBLE);
|
||||||
apsModeView.setBackgroundResource(R.drawable.loopmodeborder);
|
apsModeView.setBackgroundResource(R.drawable.loopmodeborder);
|
||||||
|
apsModeView.setTextColor(Color.BLACK);
|
||||||
final LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop();
|
final LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop();
|
||||||
if(activeloop != null && activeloop.isEnabled(activeloop.getType())) {
|
if(activeloop != null && activeloop.isEnabled(activeloop.getType())) {
|
||||||
if (MainApp.getConfigBuilder().isClosedModeEnabled()) {
|
if (MainApp.getConfigBuilder().isClosedModeEnabled()) {
|
||||||
|
@ -416,6 +422,8 @@ public class OverviewFragment extends Fragment {
|
||||||
} else {
|
} else {
|
||||||
apsModeView.setBackgroundResource(R.drawable.loopmodedisabledborder);
|
apsModeView.setBackgroundResource(R.drawable.loopmodedisabledborder);
|
||||||
apsModeView.setText(MainApp.sResources.getString(R.string.disabledloop));
|
apsModeView.setText(MainApp.sResources.getString(R.string.disabledloop));
|
||||||
|
apsModeView.setTextColor(Color.WHITE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -464,12 +472,14 @@ public class OverviewFragment extends Fragment {
|
||||||
TempBasal activeTemp = pump.getTempBasal();
|
TempBasal activeTemp = pump.getTempBasal();
|
||||||
cancelTempLayout.setVisibility(View.VISIBLE);
|
cancelTempLayout.setVisibility(View.VISIBLE);
|
||||||
cancelTempButton.setText(MainApp.instance().getString(R.string.cancel) + ": " + activeTemp.toString());
|
cancelTempButton.setText(MainApp.instance().getString(R.string.cancel) + ": " + activeTemp.toString());
|
||||||
runningTempView.setText(activeTemp.toString() + "\n(" + DecimalFormatter.to2Decimal(pump.getBaseBasalRate()) + " U/h" + ")");
|
runningTempView.setVisibility(View.VISIBLE);
|
||||||
|
runningTempView.setText(activeTemp.toString());
|
||||||
} else {
|
} else {
|
||||||
cancelTempLayout.setVisibility(View.GONE);
|
cancelTempLayout.setVisibility(View.GONE);
|
||||||
Double currentBasal = pump.getBaseBasalRate();
|
runningTempView.setVisibility(View.GONE);
|
||||||
runningTempView.setText(DecimalFormatter.to2Decimal(currentBasal) + " U/h");
|
|
||||||
}
|
}
|
||||||
|
baseBasalView.setText(DecimalFormatter.to2Decimal(pump.getBaseBasalRate()) + " U/h");
|
||||||
|
activeProfileView.setText(profile.getActiveProfile());
|
||||||
|
|
||||||
if (profile == null) {
|
if (profile == null) {
|
||||||
// disable all treatment buttons because we are not able to check constraints without profile
|
// disable all treatment buttons because we are not able to check constraints without profile
|
||||||
|
|
6
app/src/main/res/drawable/pillborder.xml
Normal file
6
app/src/main/res/drawable/pillborder.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||||
|
<stroke android:width="1dip" android:color="@android:color/white"/>
|
||||||
|
<corners
|
||||||
|
android:radius="2dp" >
|
||||||
|
</corners>
|
||||||
|
</shape>
|
|
@ -78,6 +78,31 @@
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/overview_basebasal"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/overview_activeprofile"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:paddingRight="5dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:textColor="@color/colorProfileSwitchButton"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:background="@drawable/pillborder"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
Loading…
Reference in a new issue