Merge pull request #9849 from osmandapp/minor_fixes

Fix icon after gpx approximation in options dialog
This commit is contained in:
vshcherb 2020-09-18 17:36:19 +02:00 committed by GitHub
commit 12ff34ceb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -319,9 +319,10 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
mainView.findViewById(R.id.options_button).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
boolean trackSnappedToRoad = editingCtx.isTrackSnappedToRoad() || editingCtx.isNewData() || approximationApplied;
OptionsBottomSheetDialogFragment.showInstance(mapActivity.getSupportFragmentManager(),
MeasurementToolFragment.this,
editingCtx.isTrackSnappedToRoad() || editingCtx.isNewData(),
trackSnappedToRoad,
editingCtx.getAppMode().getStringKey()
);
}

View file

@ -1633,7 +1633,16 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
String via = generateViaDescription();
GPXRouteParamsBuilder routeParamsBuilder = app.getRoutingHelper().getCurrentGPXRoute();
if (routeParamsBuilder != null) {
String fileName = new File(routeParamsBuilder.getFile().path).getName();
GPXFile gpxFile = routeParamsBuilder.getFile();
String fileName = null;
if (!Algorithms.isEmpty(gpxFile.path)) {
fileName = new File(gpxFile.path).getName();
} else if (!Algorithms.isEmpty(gpxFile.tracks)) {
fileName = gpxFile.tracks.get(0).name;
}
if (Algorithms.isEmpty(fileName)) {
fileName = app.getString(R.string.shared_string_gpx_track);
}
title.setText(GpxUiHelper.getGpxTitle(fileName));
description.setText(R.string.follow_track);
buttonDescription.setText(R.string.shared_string_add);