From 9055bbe014e86b22a44513fa483b87d862eb3e08 Mon Sep 17 00:00:00 2001 From: OliE Date: Sun, 18 Feb 2018 13:37:10 +0100 Subject: [PATCH] update correct last measurement if the user selects an item on the line graph. --- .../openscale/gui/fragments/OverviewFragment.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/android_app/app/src/main/java/com/health/openscale/gui/fragments/OverviewFragment.java b/android_app/app/src/main/java/com/health/openscale/gui/fragments/OverviewFragment.java index 565aa133..3060c1d2 100644 --- a/android_app/app/src/main/java/com/health/openscale/gui/fragments/OverviewFragment.java +++ b/android_app/app/src/main/java/com/health/openscale/gui/fragments/OverviewFragment.java @@ -143,6 +143,9 @@ public class OverviewFragment extends Fragment implements FragmentUpdateListener } }); + txtTitleUser.setText(getResources().getString(R.string.label_title_user).toUpperCase()); + txtTitleLastMeasurement.setText(getResources().getString(R.string.label_title_last_measurement).toUpperCase()); + prefs = PreferenceManager.getDefaultSharedPreferences(overviewView.getContext()); OpenScale.getInstance(getContext()).registerFragment(this); @@ -163,6 +166,10 @@ public class OverviewFragment extends Fragment implements FragmentUpdateListener ScaleMeasurement[] tupleScaleData = OpenScale.getInstance(context).getTupleScaleData(lastScaleMeasurement.getId()); ScaleMeasurement prevScaleMeasurement = tupleScaleData[0]; + updateUserSelection(); + updateLastPieChart(); + updateLastLineChart(scaleMeasurementList); + for (MeasurementView measurement : measurementViews) { if (measurement instanceof DateMeasurementView || measurement instanceof TimeMeasurementView) { continue; @@ -171,13 +178,6 @@ public class OverviewFragment extends Fragment implements FragmentUpdateListener measurement.updatePreferences(prefs); measurement.loadFrom(lastScaleMeasurement, prevScaleMeasurement); } - - txtTitleUser.setText(getResources().getString(R.string.label_title_user).toUpperCase()); - txtTitleLastMeasurement.setText(getResources().getString(R.string.label_title_last_measurement).toUpperCase()); - - updateUserSelection(); - updateLastPieChart(); - updateLastLineChart(scaleMeasurementList); } private void updateUserSelection() {