1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-30 19:49:59 +02:00

update correct last measurement if the user selects an item on the line graph.

This commit is contained in:
OliE
2018-02-18 13:37:10 +01:00
parent 9bb88e03d7
commit 9055bbe014

View File

@@ -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()); prefs = PreferenceManager.getDefaultSharedPreferences(overviewView.getContext());
OpenScale.getInstance(getContext()).registerFragment(this); 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[] tupleScaleData = OpenScale.getInstance(context).getTupleScaleData(lastScaleMeasurement.getId());
ScaleMeasurement prevScaleMeasurement = tupleScaleData[0]; ScaleMeasurement prevScaleMeasurement = tupleScaleData[0];
updateUserSelection();
updateLastPieChart();
updateLastLineChart(scaleMeasurementList);
for (MeasurementView measurement : measurementViews) { for (MeasurementView measurement : measurementViews) {
if (measurement instanceof DateMeasurementView || measurement instanceof TimeMeasurementView) { if (measurement instanceof DateMeasurementView || measurement instanceof TimeMeasurementView) {
continue; continue;
@@ -171,13 +178,6 @@ public class OverviewFragment extends Fragment implements FragmentUpdateListener
measurement.updatePreferences(prefs); measurement.updatePreferences(prefs);
measurement.loadFrom(lastScaleMeasurement, prevScaleMeasurement); 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() { private void updateUserSelection() {