diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java index d214560f16..224594f9bd 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java @@ -359,6 +359,7 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial nameTextBox.setError(getString(R.string.file_with_name_already_exist)); } else { nameTextBox.setError(null); + nameTextBox.setErrorEnabled(false); fileName = text; rightButtonEnabled = true; } diff --git a/OsmAnd/src/net/osmand/plus/myplaces/MoveGpxFileBottomSheet.java b/OsmAnd/src/net/osmand/plus/myplaces/MoveGpxFileBottomSheet.java index e2fa32671d..4121cebbb7 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/MoveGpxFileBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/MoveGpxFileBottomSheet.java @@ -21,6 +21,7 @@ import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerItem; import net.osmand.plus.helpers.AndroidUiHelper; +import net.osmand.plus.measurementtool.SaveAsNewTrackBottomSheetDialogFragment; import net.osmand.plus.myplaces.AddNewTrackFolderBottomSheet.OnTrackFolderAddListener; import net.osmand.util.Algorithms; @@ -74,7 +75,7 @@ public class MoveGpxFileBottomSheet extends MenuBottomSheetDialogFragment implem FragmentActivity activity = getActivity(); if (activity != null) { AddNewTrackFolderBottomSheet.showInstance(activity.getSupportFragmentManager(), - MoveGpxFileBottomSheet.this, usedOnMap); + MoveGpxFileBottomSheet.this, usedOnMap); } } }) @@ -86,9 +87,10 @@ public class MoveGpxFileBottomSheet extends MenuBottomSheetDialogFragment implem dividerItem.setMargins(0, 0, 0, 0); items.add(dividerItem); + boolean isSaveAsNewFragment = getTargetFragment() instanceof SaveAsNewTrackBottomSheetDialogFragment; final List dirs = new ArrayList<>(); - collectDirs(app.getAppPath(IndexConstants.GPX_INDEX_DIR), dirs, fileDir); - if (!Algorithms.objectEquals(fileDir, app.getAppPath(IndexConstants.GPX_INDEX_DIR))) { + collectDirs(app.getAppPath(IndexConstants.GPX_INDEX_DIR), dirs, isSaveAsNewFragment ? null : fileDir); + if (isSaveAsNewFragment || !Algorithms.objectEquals(fileDir, app.getAppPath(IndexConstants.GPX_INDEX_DIR))) { dirs.add(0, app.getAppPath(IndexConstants.GPX_INDEX_DIR)); } String gpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR).getPath();