mirror of
https://github.com/oliexdev/openScale.git
synced 2025-01-17 22:28:28 +01:00
update goal line when switching an user, see issue #500
This commit is contained in:
parent
ee9e47efdf
commit
c22532e44b
@ -72,7 +72,6 @@ public class ChartMeasurementView extends LineChart {
|
||||
|
||||
private OpenScale openScale;
|
||||
private SharedPreferences prefs;
|
||||
private ScaleUser user;
|
||||
private List<ScaleMeasurement> scaleMeasurementList;
|
||||
private List<MeasurementView> measurementViews;
|
||||
private ScaleMeasurement firstMeasurement;
|
||||
@ -174,7 +173,6 @@ public class ChartMeasurementView extends LineChart {
|
||||
private void initChart() {
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
openScale = OpenScale.getInstance();
|
||||
user = openScale.getSelectedScaleUser();
|
||||
scaleMeasurementList = new ArrayList<>();
|
||||
measurementViews = MeasurementView.getMeasurementList(getContext(), MeasurementView.DateTimeOrder.NONE);
|
||||
firstMeasurement = new ScaleMeasurement();
|
||||
@ -692,6 +690,7 @@ public class ChartMeasurementView extends LineChart {
|
||||
if (prefs.getBoolean("goalLine", true)) {
|
||||
List<Entry> valuesGoalLine = new Stack<>();
|
||||
|
||||
ScaleUser user = OpenScale.getInstance().getSelectedScaleUser();
|
||||
float goalWeight = Converters.fromKilogram(user.getGoalWeight(), user.getScaleUnit());
|
||||
|
||||
valuesGoalLine.add(new Entry(minXValue, goalWeight));
|
||||
|
Loading…
x
Reference in New Issue
Block a user