fixes PR#1550
This commit is contained in:
parent
2af367fd63
commit
eea79c5d0f
5 changed files with 49 additions and 4 deletions
|
@ -398,7 +398,7 @@ public class Profile {
|
|||
public String getIsfList() {
|
||||
if (isf_v == null)
|
||||
isf_v = convertToSparseArray(isf);
|
||||
return getValuesList(isf_v, null, new DecimalFormat("0.0"), getUnits() + "/U");
|
||||
return getValuesList(isf_v, null, new DecimalFormat("0.0"), getUnits() + MainApp.gs(R.string.profile_per_unit));
|
||||
}
|
||||
|
||||
public double getIc() {
|
||||
|
@ -418,7 +418,7 @@ public class Profile {
|
|||
public String getIcList() {
|
||||
if (ic_v == null)
|
||||
ic_v = convertToSparseArray(ic);
|
||||
return getValuesList(ic_v, null, new DecimalFormat("0.0"), "g/U");
|
||||
return getValuesList(ic_v, null, new DecimalFormat("0.0"), MainApp.gs(R.string.profile_carbs_per_unit));
|
||||
}
|
||||
|
||||
public double getBasal() {
|
||||
|
@ -439,7 +439,7 @@ public class Profile {
|
|||
public String getBasalList() {
|
||||
if (basal_v == null)
|
||||
basal_v = convertToSparseArray(basal);
|
||||
return getValuesList(basal_v, null, new DecimalFormat("0.00"), "U/h");
|
||||
return getValuesList(basal_v, null, new DecimalFormat("0.00"), MainApp.gs(R.string.profile_ins_units_per_hout));
|
||||
}
|
||||
|
||||
public class BasalValue {
|
||||
|
|
|
@ -156,7 +156,7 @@ public class LocalProfileFragment extends SubscriberFragment {
|
|||
public String getSumLabel() {
|
||||
ProfileStore profile = LocalProfilePlugin.getPlugin().createProfileStore();
|
||||
if (profile != null)
|
||||
return " ∑" + DecimalFormatter.to2Decimal(profile.getDefaultProfile().baseBasalSum()) + "U";
|
||||
return " ∑" + DecimalFormatter.to2Decimal(profile.getDefaultProfile().baseBasalSum()) + MainApp.gs(R.string.insulin_unit_shortname);
|
||||
else
|
||||
return MainApp.gs(R.string.localprofile);
|
||||
}
|
||||
|
|
|
@ -52,6 +52,8 @@ public class NSProfileFragment extends SubscriberFragment {
|
|||
TextView isf;
|
||||
@BindView(R.id.profileview_basal)
|
||||
TextView basal;
|
||||
@BindView(R.id.profileview_basaltotal)
|
||||
TextView basaltotal;
|
||||
@BindView(R.id.profileview_target)
|
||||
TextView target;
|
||||
@BindView(R.id.basal_graph)
|
||||
|
@ -116,6 +118,7 @@ public class NSProfileFragment extends SubscriberFragment {
|
|||
ic.setText(profile.getIcList());
|
||||
isf.setText(profile.getIsfList());
|
||||
basal.setText(profile.getBasalList());
|
||||
basaltotal.setText(String.format(MainApp.gs(R.string.profile_total), DecimalFormatter.to2Decimal(profile.baseBasalSum())));
|
||||
target.setText(profile.getTargetList());
|
||||
basalGraph.show(profile);
|
||||
}
|
||||
|
@ -141,6 +144,7 @@ public class NSProfileFragment extends SubscriberFragment {
|
|||
ic.setText("");
|
||||
isf.setText("");
|
||||
basal.setText("");
|
||||
basaltotal.setText("");
|
||||
target.setText("");
|
||||
activateButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
|
|
@ -345,6 +345,42 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:gravity="end"
|
||||
android:paddingRight="5dp"
|
||||
android:text=""
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingStart="2dp"
|
||||
android:text=""
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileview_basaltotal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:paddingLeft="17dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<info.nightscout.androidaps.plugins.Treatments.fragments.ProfileGraph
|
||||
android:id="@+id/basal_graph"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1211,6 +1211,11 @@
|
|||
<string name="key_short_tabtitles" translatable="false">short_tabtitles</string>
|
||||
<string name="pairfirst">Please pair your pump with your phone!</string>
|
||||
|
||||
<string name="profile_total">== ∑ %1$s U</string>
|
||||
<string name="profile_ins_units_per_hout">U/h</string>
|
||||
<string name="profile_carbs_per_unit">g/U</string>
|
||||
<string name="profile_per_unit">/U</string>
|
||||
|
||||
<plurals name="objective_days">
|
||||
<item quantity="one">%1$d day</item>
|
||||
<item quantity="other">%1$d days</item>
|
||||
|
|
Loading…
Reference in a new issue