1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-20 07:21:40 +02:00

Simplify toast text shown when clicking on pie chart

Also don't reload measurement views as the selected measurement should
already be loaded and reloading discards the previuos measurement.
This commit is contained in:
Erik Johansson
2018-04-29 21:45:03 +02:00
parent b80c9dbbd5
commit 2689aea89a

View File

@@ -317,16 +317,15 @@ public class OverviewFragment extends Fragment implements FragmentUpdateListener
return;
}
String date_time = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.SHORT).format(lastScaleMeasurement.getDateTime());
for (MeasurementView view : measurementViews) {
if (view instanceof FloatMeasurementView) {
FloatMeasurementView measurementView = (FloatMeasurementView) view;
measurementView.loadFrom(lastScaleMeasurement, null);
if (measurementView.getColor() == arcValue.getColor()) {
Toast.makeText(getActivity(), measurementView.getName() + " " + measurementView.getValueAsString() + measurementView.getUnit() + " " + getResources().getString(R.string.info_on_date) + " " + date_time, Toast.LENGTH_SHORT).show();
Toast.makeText(getActivity(), String.format("%s: %s %s",
measurementView.getName(), measurementView.getValueAsString(),
measurementView.getUnit()), Toast.LENGTH_SHORT).show();
break;
}
}
}