use of net.osmand.plus.mapmarkers.SaveAsTrackBottomSheetDialogFragment.MarkerSaveAsTrackFragmentListener in project Osmand by osmandapp.
the class MapMarkersDialogFragment method createSaveAsTrackFragmentListener.
private MarkerSaveAsTrackFragmentListener createSaveAsTrackFragmentListener() {
return new MarkerSaveAsTrackFragmentListener() {
final MapActivity mapActivity = getMapActivity();
@Override
public void saveGpx(final String fileName) {
final String gpxPath = mapActivity.getMyApplication().getMapMarkersHelper().generateGpx(fileName);
snackbar = Snackbar.make(viewPager, fileName + " " + getString(R.string.is_saved) + ".", Snackbar.LENGTH_LONG).setAction(R.string.shared_string_show, new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(mapActivity, getMyApplication().getAppCustomization().getTrackActivity());
intent.putExtra(TrackActivity.TRACK_FILE_NAME, gpxPath);
intent.putExtra(TrackActivity.OPEN_POINTS_TAB, true);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}
});
AndroidUtils.setSnackbarTextColor(snackbar, R.color.color_dialog_buttons_dark);
snackbar.show();
}
};
}
Aggregations