Merge branch 'r2.7' of ssh://github.com/osmandapp/Osmand into fix_crash_in_track_activity

This commit is contained in:
PavelRatushny 2017-07-26 13:39:38 +03:00
commit 57eae66adf
3 changed files with 9 additions and 7 deletions

View file

@ -528,10 +528,9 @@ public class GpxSelectionHelper {
public void processPoints() {
update();
this.processedPointsToDisplay = gpxFile.proccessPoints();
List<TrkSegment> processedRoutePointsToDisplay = gpxFile.processRoutePoints();
if (!processedRoutePointsToDisplay.isEmpty()) {
this.processedPointsToDisplay.addAll(processedRoutePointsToDisplay);
routePoints = !processedRoutePointsToDisplay.isEmpty();
if (this.processedPointsToDisplay.isEmpty()) {
this.processedPointsToDisplay = gpxFile.processRoutePoints();
routePoints = !this.processedPointsToDisplay.isEmpty();
}
}

View file

@ -305,7 +305,8 @@ public class TrackDetailsMenu {
if (trackChartPoints == null) {
trackChartPoints = new TrackChartPoints();
int segmentColor = getTrackSegment(chart).getColor(0);
TrkSegment segment = getTrackSegment(chart);
int segmentColor = segment != null ? segment.getColor(0) : 0;
trackChartPoints.setSegmentColor(segmentColor);
trackChartPoints.setGpx(getGpxItem().group.getGpx());
}

View file

@ -1314,10 +1314,12 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
}
if (gpxItem.analysis.hasSpeedData) {
list.add(GPXDataSetType.SPEED);
} else {
} else if (gpxItem.analysis.hasElevationData) {
list.add(GPXDataSetType.SLOPE);
}
gpxItem.chartTypes = list.toArray(new GPXDataSetType[list.size()]);
if (list.size() > 0) {
gpxItem.chartTypes = list.toArray(new GPXDataSetType[list.size()]);
}
if (gpxItem.group.getGpx() != null) {
gpxItem.wasHidden = app.getSelectedGpxHelper().getSelectedFileByPath(gpxInfo.file.getAbsolutePath()) == null;
app.getSelectedGpxHelper().setGpxFileToDisplay(gpxItem.group.getGpx());