use of net.osmand.plus.measurementtool.SnapToRoadBottomSheetDialogFragment.SnapToRoadFragmentListener in project Osmand by osmandapp.
the class PlanRouteFragment method createSnapToRoadFragmentListener.
private SnapToRoadFragmentListener createSnapToRoadFragmentListener() {
return new SnapToRoadFragmentListener() {
@Override
public void onDestroyView(boolean snapToRoadEnabled) {
}
@Override
public void onApplicationModeItemClick(ApplicationMode mode) {
if (planRouteContext.getSnappedMode() != mode) {
boolean defaultMode = mode == ApplicationMode.DEFAULT;
MapMarkersLayer layer = getMapMarkersLayer();
if (layer != null) {
layer.setDefaultAppMode(defaultMode);
}
if (defaultMode) {
planRouteContext.cancelSnapToRoad();
}
planRouteContext.getSnappedToRoadPoints().clear();
planRouteContext.setSnappedMode(mode);
planRouteContext.recreateSnapTrkSegment(false);
setupAppModesBtn();
}
}
};
}
use of net.osmand.plus.measurementtool.SnapToRoadBottomSheetDialogFragment.SnapToRoadFragmentListener in project Osmand by osmandapp.
the class MeasurementToolFragment method createSnapToRoadFragmentListener.
private SnapToRoadFragmentListener createSnapToRoadFragmentListener() {
return new SnapToRoadFragmentListener() {
@Override
public void onDestroyView(boolean snapToRoadEnabled) {
if (!snapToRoadEnabled && !editingCtx.isInSnapToRoadMode()) {
toolBarController.setTitle(previousToolBarTitle);
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
mapActivity.refreshMap();
}
}
}
@Override
public void onApplicationModeItemClick(ApplicationMode mode) {
enableSnapToRoadMode(mode);
}
};
}
Aggregations