Fix snap to road title change

This commit is contained in:
Alexander Sytnyk 2017-08-17 16:15:29 +03:00
parent 7f03ce321b
commit fc7d91e494

View file

@ -480,10 +480,12 @@ public class MeasurementToolFragment extends Fragment {
return iconsCache.getIcon(id, nightMode ? R.color.osmand_orange : R.color.color_myloc_distance); return iconsCache.getIcon(id, nightMode ? R.color.osmand_orange : R.color.color_myloc_distance);
} }
private void showSnapToRoadMenu() { private void showSnapToRoadMenu(boolean rememberPreviousTitle) {
MapActivity mapActivity = getMapActivity(); MapActivity mapActivity = getMapActivity();
if (mapActivity != null) { if (mapActivity != null) {
previousToolBarTitle = toolBarController.getTitle(); if (rememberPreviousTitle) {
previousToolBarTitle = toolBarController.getTitle();
}
toolBarController.setTitle(getString(R.string.snap_to_road)); toolBarController.setTitle(getString(R.string.snap_to_road));
mapActivity.refreshMap(); mapActivity.refreshMap();
SnapToRoadBottomSheetDialogFragment fragment = new SnapToRoadBottomSheetDialogFragment(); SnapToRoadBottomSheetDialogFragment fragment = new SnapToRoadBottomSheetDialogFragment();
@ -501,7 +503,7 @@ public class MeasurementToolFragment extends Fragment {
@Override @Override
public void snapToRoadOnCLick() { public void snapToRoadOnCLick() {
if (!snapToRoadEnabled) { if (!snapToRoadEnabled) {
showSnapToRoadMenu(); showSnapToRoadMenu(true);
} else { } else {
disableSnapToRoadMode(); disableSnapToRoadMode();
} }
@ -717,7 +719,7 @@ public class MeasurementToolFragment extends Fragment {
snapToRoadBtn.setOnClickListener(new View.OnClickListener() { snapToRoadBtn.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
showSnapToRoadMenu(); showSnapToRoadMenu(false);
} }
}); });
snapToRoadBtn.setVisibility(View.VISIBLE); snapToRoadBtn.setVisibility(View.VISIBLE);