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() {
}
};
}
Aggregations