Added toast about empty file name

This commit is contained in:
max-klaus 2019-11-09 12:41:37 +03:00
parent a314f06e87
commit d40f095ae7

View file

@ -36,6 +36,7 @@ import net.osmand.plus.myplaces.AvailableGPXFragment;
import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo; import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo;
import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.widgets.OsmandTextFieldBoxes; import net.osmand.plus.widgets.OsmandTextFieldBoxes;
import net.osmand.util.Algorithms;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
@ -171,6 +172,10 @@ public class OnSaveCurrentTrackFragment extends BottomSheetDialogFragment {
if (savedGpxName.equalsIgnoreCase(newGpxName)) { if (savedGpxName.equalsIgnoreCase(newGpxName)) {
return savedFile; return savedFile;
} }
if (Algorithms.isEmpty(newGpxName)) {
Toast.makeText(app, R.string.empty_filename, Toast.LENGTH_LONG).show();
return null;
}
return LocalIndexesFragment.renameGpxFile(app, savedFile, newGpxName + ".gpx", null); return LocalIndexesFragment.renameGpxFile(app, savedFile, newGpxName + ".gpx", null);
} }