commit
e90a7127ad
3 changed files with 12 additions and 3 deletions
|
@ -168,6 +168,10 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
|
|||
this.planRouteMode = planRouteMode;
|
||||
}
|
||||
|
||||
private void setDirectionMode(boolean directionMode) {
|
||||
this.directionMode = directionMode;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
|
@ -1933,10 +1937,12 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
|
|||
return showFragment(fragment, fragmentManager);
|
||||
}
|
||||
|
||||
public static boolean showInstance(FragmentManager fragmentManager, MeasurementEditingContext editingCtx, boolean planRoute) {
|
||||
public static boolean showInstance(FragmentManager fragmentManager, MeasurementEditingContext editingCtx,
|
||||
boolean planRoute, boolean directionMode) {
|
||||
MeasurementToolFragment fragment = new MeasurementToolFragment();
|
||||
fragment.setEditingCtx(editingCtx);
|
||||
fragment.setPlanRouteMode(planRoute);
|
||||
fragment.setDirectionMode(directionMode);
|
||||
return showFragment(fragment, fragmentManager);
|
||||
}
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
|
|||
|
||||
private GPXFile gpxFile;
|
||||
|
||||
private boolean editingTrack;
|
||||
private boolean selectingTrack;
|
||||
private int menuTitleHeight;
|
||||
|
||||
|
@ -529,6 +530,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
|
|||
public void openPlanRoute(boolean useAppMode) {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null && gpxFile != null) {
|
||||
editingTrack = true;
|
||||
QuadRect rect = gpxFile.getRect();
|
||||
TrkSegment segment = gpxFile.getNonEmptyTrkSegment();
|
||||
ActionType actionType = segment == null ? ActionType.ADD_ROUTE_POINTS : ActionType.EDIT_SEGMENT;
|
||||
|
@ -538,7 +540,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
|
|||
if (useAppMode) {
|
||||
editingContext.setAppMode(app.getRoutingHelper().getAppMode());
|
||||
}
|
||||
MeasurementToolFragment.showInstance(mapActivity.getSupportFragmentManager(), editingContext, true);
|
||||
MeasurementToolFragment.showInstance(mapActivity.getSupportFragmentManager(), editingContext, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -609,7 +611,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
|
|||
private void onDismiss() {
|
||||
try {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
if (mapActivity != null && !editingTrack) {
|
||||
if (!mapActivity.isChangingConfigurations()) {
|
||||
mapActivity.getMapRouteInfoMenu().cancelSelectionFromTracks();
|
||||
}
|
||||
|
|
|
@ -1566,6 +1566,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
if (mapActivity != null) {
|
||||
GPXRouteParamsBuilder routeParams = mapActivity.getRoutingHelper().getCurrentGPXRoute();
|
||||
if (routeParams != null) {
|
||||
hide();
|
||||
selectTrack();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue