Search in sources :

Example 1 with SelectFileListener

use of net.osmand.plus.measurementtool.SelectFileBottomSheet.SelectFileListener in project Osmand by osmandapp.

the class MeasurementToolFragment method createAddToTrackFileListener.

private SelectFileListener createAddToTrackFileListener() {
    final MapActivity mapActivity = getMapActivity();
    return new SelectFileListener() {

        @Override
        public void selectFileOnCLick(String gpxFileName) {
            if (mapActivity != null) {
                GPXFile gpxFile;
                if (gpxFileName == null) {
                    gpxFile = mapActivity.getMyApplication().getSavingTrackHelper().getCurrentGpx();
                } else {
                    gpxFile = getGpxFile(gpxFileName);
                }
                SelectedGpxFile selectedGpxFile = mapActivity.getMyApplication().getSelectedGpxHelper().getSelectedFileByPath(gpxFile.path);
                boolean showOnMap = selectedGpxFile != null;
                saveExistingGpx(gpxFile, showOnMap, false, true, FinalSaveAction.SHOW_IS_SAVED_FRAGMENT);
            }
        }

        @Override
        public void dismissButtonOnClick() {
        }
    };
}
Also used : SelectedGpxFile(net.osmand.plus.track.helpers.GpxSelectionHelper.SelectedGpxFile) GPXFile(net.osmand.GPXUtilities.GPXFile) SelectFileListener(net.osmand.plus.measurementtool.SelectFileBottomSheet.SelectFileListener) MapActivity(net.osmand.plus.activities.MapActivity)

Aggregations

GPXFile (net.osmand.GPXUtilities.GPXFile)1 MapActivity (net.osmand.plus.activities.MapActivity)1 SelectFileListener (net.osmand.plus.measurementtool.SelectFileBottomSheet.SelectFileListener)1 SelectedGpxFile (net.osmand.plus.track.helpers.GpxSelectionHelper.SelectedGpxFile)1