Merge pull request #9849 from osmandapp/minor_fixes
Fix icon after gpx approximation in options dialog
This commit is contained in:
commit
12ff34ceb6
2 changed files with 12 additions and 2 deletions
|
@ -319,9 +319,10 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
|
||||||
mainView.findViewById(R.id.options_button).setOnClickListener(new OnClickListener() {
|
mainView.findViewById(R.id.options_button).setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
boolean trackSnappedToRoad = editingCtx.isTrackSnappedToRoad() || editingCtx.isNewData() || approximationApplied;
|
||||||
OptionsBottomSheetDialogFragment.showInstance(mapActivity.getSupportFragmentManager(),
|
OptionsBottomSheetDialogFragment.showInstance(mapActivity.getSupportFragmentManager(),
|
||||||
MeasurementToolFragment.this,
|
MeasurementToolFragment.this,
|
||||||
editingCtx.isTrackSnappedToRoad() || editingCtx.isNewData(),
|
trackSnappedToRoad,
|
||||||
editingCtx.getAppMode().getStringKey()
|
editingCtx.getAppMode().getStringKey()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1633,7 +1633,16 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
||||||
String via = generateViaDescription();
|
String via = generateViaDescription();
|
||||||
GPXRouteParamsBuilder routeParamsBuilder = app.getRoutingHelper().getCurrentGPXRoute();
|
GPXRouteParamsBuilder routeParamsBuilder = app.getRoutingHelper().getCurrentGPXRoute();
|
||||||
if (routeParamsBuilder != null) {
|
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));
|
title.setText(GpxUiHelper.getGpxTitle(fileName));
|
||||||
description.setText(R.string.follow_track);
|
description.setText(R.string.follow_track);
|
||||||
buttonDescription.setText(R.string.shared_string_add);
|
buttonDescription.setText(R.string.shared_string_add);
|
||||||
|
|
Loading…
Reference in a new issue