Merge pull request #9848 from osmandapp/minor_fixes

Fix icon after gpx approximation
This commit is contained in:
vshcherb 2020-09-18 16:30:42 +02:00 committed by GitHub
commit 0c2814671b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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();