show units in profile

This commit is contained in:
Milos Kozak 2016-06-09 09:21:33 +02:00
parent b1cf867410
commit 891c5dd4d7
3 changed files with 17 additions and 0 deletions

View file

@ -24,6 +24,7 @@ public class ProfileViewerFragment extends Fragment {
private static Logger log = LoggerFactory.getLogger(ProfileViewerFragment.class); private static Logger log = LoggerFactory.getLogger(ProfileViewerFragment.class);
private static TextView noProfile; private static TextView noProfile;
private static TextView units;
private static TextView dia; private static TextView dia;
private static TextView activeProfile; private static TextView activeProfile;
private static TextView ic; private static TextView ic;
@ -53,6 +54,7 @@ public class ProfileViewerFragment extends Fragment {
View layout = inflater.inflate(R.layout.profileviewer_fragment, container, false); View layout = inflater.inflate(R.layout.profileviewer_fragment, container, false);
noProfile = (TextView) layout.findViewById(R.id.profileview_noprofile); noProfile = (TextView) layout.findViewById(R.id.profileview_noprofile);
units = (TextView) layout.findViewById(R.id.profileview_units);
dia = (TextView) layout.findViewById(R.id.profileview_dia); dia = (TextView) layout.findViewById(R.id.profileview_dia);
activeProfile = (TextView) layout.findViewById(R.id.profileview_activeprofile); activeProfile = (TextView) layout.findViewById(R.id.profileview_activeprofile);
ic = (TextView) layout.findViewById(R.id.profileview_ic); ic = (TextView) layout.findViewById(R.id.profileview_ic);
@ -77,6 +79,7 @@ public class ProfileViewerFragment extends Fragment {
} else { } else {
noProfile.setVisibility(View.GONE); noProfile.setVisibility(View.GONE);
} }
units.setText(profile.getUnits());
dia.setText(formatNumber2decimalplaces.format(profile.getDia()) + " h"); dia.setText(formatNumber2decimalplaces.format(profile.getDia()) + " h");
activeProfile.setText(profile.getActiveProfile()); activeProfile.setText(profile.getActiveProfile());
ic.setText(profile.getIcList()); ic.setText(profile.getIcList());

View file

@ -36,6 +36,19 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="25dp" /> android:layout_marginLeft="25dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/profileview_units_label"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="10dp" />
<TextView
android:id="@+id/profileview_units"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -55,5 +55,6 @@
<string name="treatments_wizard_unit_label">U</string> <string name="treatments_wizard_unit_label">U</string>
<string name="treatments_wizard_iob_label">IOB</string> <string name="treatments_wizard_iob_label">IOB</string>
<string name="treatments_wizard_total_label">TOTAL</string> <string name="treatments_wizard_total_label">TOTAL</string>
<string name="profileview_units_label">Units:</string>
</resources> </resources>