Fix icon after gpx approximation

This commit is contained in:
Vitaliy 2020-09-18 17:29:33 +03:00
parent 5c38526e05
commit 8499f4f988

View file

@ -138,6 +138,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
private boolean pointsListOpened; private boolean pointsListOpened;
private boolean planRouteMode = false; private boolean planRouteMode = false;
private boolean directionMode = false; private boolean directionMode = false;
private boolean approximationApplied = false;
private boolean portrait; private boolean portrait;
private boolean nightMode; private boolean nightMode;
private int cachedMapPosition; private int cachedMapPosition;
@ -1125,7 +1126,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
final ApplicationMode appMode = editingCtx.getAppMode(); final ApplicationMode appMode = editingCtx.getAppMode();
if (mapActivity != null) { if (mapActivity != null) {
Drawable icon; Drawable icon;
if (editingCtx.isTrackSnappedToRoad() || editingCtx.isNewData()) { if (editingCtx.isTrackSnappedToRoad() || editingCtx.isNewData() || approximationApplied) {
if (appMode == MeasurementEditingContext.DEFAULT_APP_MODE) { if (appMode == MeasurementEditingContext.DEFAULT_APP_MODE) {
icon = getActiveIcon(R.drawable.ic_action_split_interval); icon = getActiveIcon(R.drawable.ic_action_split_interval);
} else { } else {
@ -2004,8 +2005,10 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
@Override @Override
public void onApplyGpxApproximation() { public void onApplyGpxApproximation() {
approximationApplied = true;
exitApproximationMode(); exitApproximationMode();
doAddOrMovePointCommonStuff(); doAddOrMovePointCommonStuff();
updateSnapToRoadControls();
if (directionMode) { if (directionMode) {
directionMode = false; directionMode = false;
MapActivity mapActivity = getMapActivity(); MapActivity mapActivity = getMapActivity();