1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-23 16:53:04 +02:00

Only get expand preference once

This commit is contained in:
Erik Johansson
2017-11-22 23:17:31 +01:00
parent 82ec4863ef
commit ff70f192ed

View File

@@ -189,7 +189,8 @@ public class DataEntryActivity extends Activity {
switchEditMode.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor("#D3D3D3")));
}
if (prefs.getBoolean(String.valueOf(expandButton.getId()), false)) {
final boolean doExpand = prefs.getBoolean(String.valueOf(expandButton.getId()), false);
if (doExpand) {
expandButton.setBackgroundTintList(ColorStateList.valueOf(ChartUtils.COLOR_ORANGE));
} else {
expandButton.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor("#D3D3D3")));
@@ -211,7 +212,7 @@ public class DataEntryActivity extends Activity {
for (MeasurementView measurement : dataEntryMeasurements) {
measurement.updateValue(selectedScaleData);
measurement.updateDiff(selectedScaleData, prevScaleData);
measurement.setExpand(prefs.getBoolean(String.valueOf(expandButton.getId()), false));
measurement.setExpand(doExpand);
}
return;