From ceb3a22e2fa5b8066b052ca94dfedd9859ffa3e6 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 28 Jul 2017 12:18:55 +0300 Subject: [PATCH 1/2] Change variable name (cherry picked from commit 48e3798) --- .../net/osmand/plus/myplaces/TrackSegmentFragment.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java index d0e02f0f4f..a3e44da23e 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java @@ -283,17 +283,17 @@ public class TrackSegmentFragment extends OsmAndListFragment { LatLon location = new LatLon(pointToShow.getLatitude(), pointToShow.getLongitude()); final OsmandSettings settings = app.getSettings(); - String typeName = ""; + String trackName = ""; if (getGpx().showCurrentTrack) { - typeName = getString(R.string.shared_string_currently_recording_track); + trackName = getString(R.string.shared_string_currently_recording_track); } else if (getGpxDataItem() != null) { - typeName = getGpxDataItem().getFile().getName(); + trackName = getGpxDataItem().getFile().getName(); } else if (getGpx() != null) { - typeName = getGpx().path; + trackName = getGpx().path; } settings.setMapLocationToShow(location.getLatitude(), location.getLongitude(), settings.getLastKnownMapZoom(), - new PointDescription(PointDescription.POINT_TYPE_WPT, typeName), + new PointDescription(PointDescription.POINT_TYPE_WPT, trackName), false, getRect() ); From 6479992acb1bbbb94f1c977a98a1368a80b35369 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 28 Jul 2017 12:24:07 +0300 Subject: [PATCH 2/2] Add variables (cherry picked from commit 5f07cd9) --- .../osmand/plus/myplaces/TrackSegmentFragment.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java index a3e44da23e..9567a91566 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java @@ -278,18 +278,20 @@ public class TrackSegmentFragment extends OsmAndListFragment { imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - WptPt pointToShow = getGpx() != null ? getGpx().findPointToShow() : null; + GpxDataItem gpxDataItem = getGpxDataItem(); + GPXFile gpx = getGpx(); + WptPt pointToShow = gpx != null ? gpx.findPointToShow() : null; if (pointToShow != null) { LatLon location = new LatLon(pointToShow.getLatitude(), pointToShow.getLongitude()); final OsmandSettings settings = app.getSettings(); String trackName = ""; - if (getGpx().showCurrentTrack) { + if (gpx.showCurrentTrack) { trackName = getString(R.string.shared_string_currently_recording_track); - } else if (getGpxDataItem() != null) { - trackName = getGpxDataItem().getFile().getName(); - } else if (getGpx() != null) { - trackName = getGpx().path; + } else if (gpxDataItem != null) { + trackName = gpxDataItem.getFile().getName(); + } else { + trackName = gpx.path; } settings.setMapLocationToShow(location.getLatitude(), location.getLongitude(), settings.getLastKnownMapZoom(),