Fix #4168
This commit is contained in:
parent
4f08959f7e
commit
4a12f2ac23
2 changed files with 6 additions and 3 deletions
|
@ -305,7 +305,8 @@ public class TrackDetailsMenu {
|
||||||
|
|
||||||
if (trackChartPoints == null) {
|
if (trackChartPoints == null) {
|
||||||
trackChartPoints = new TrackChartPoints();
|
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.setSegmentColor(segmentColor);
|
||||||
trackChartPoints.setGpx(getGpxItem().group.getGpx());
|
trackChartPoints.setGpx(getGpxItem().group.getGpx());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1314,10 +1314,12 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
||||||
}
|
}
|
||||||
if (gpxItem.analysis.hasSpeedData) {
|
if (gpxItem.analysis.hasSpeedData) {
|
||||||
list.add(GPXDataSetType.SPEED);
|
list.add(GPXDataSetType.SPEED);
|
||||||
} else {
|
} else if (gpxItem.analysis.hasElevationData) {
|
||||||
list.add(GPXDataSetType.SLOPE);
|
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) {
|
if (gpxItem.group.getGpx() != null) {
|
||||||
gpxItem.wasHidden = app.getSelectedGpxHelper().getSelectedFileByPath(gpxInfo.file.getAbsolutePath()) == null;
|
gpxItem.wasHidden = app.getSelectedGpxHelper().getSelectedFileByPath(gpxInfo.file.getAbsolutePath()) == null;
|
||||||
app.getSelectedGpxHelper().setGpxFileToDisplay(gpxItem.group.getGpx());
|
app.getSelectedGpxHelper().setGpxFileToDisplay(gpxItem.group.getGpx());
|
||||||
|
|
Loading…
Reference in a new issue