Fix filter groups

This commit is contained in:
PavelRatushny 2017-07-26 13:50:38 +03:00
parent 57eae66adf
commit fbab53ae7d
2 changed files with 17 additions and 24 deletions

View file

@ -322,11 +322,9 @@ public class SplitSegmentFragment extends OsmAndListFragment {
}
private List<GpxDisplayGroup> filterGroups(boolean useDisplayGroups) {
if (getTrackActivity() == null) {
return null;
}
List<GpxDisplayGroup> result = getTrackActivity().getGpxFile(useDisplayGroups);
List<GpxDisplayGroup> groups = new ArrayList<>();
if (getTrackActivity() != null) {
List<GpxDisplayGroup> result = getTrackActivity().getGpxFile(useDisplayGroups);
for (GpxDisplayGroup group : result) {
boolean add = hasFilterType(group.getType());
if (isArgumentTrue(ARG_TO_FILTER_SHORT_TRACKS)) {
@ -346,6 +344,7 @@ public class SplitSegmentFragment extends OsmAndListFragment {
}
}
}
return groups;
}
@ -657,9 +656,6 @@ public class SplitSegmentFragment extends OsmAndListFragment {
}
if (mSelectedGpxFile != null) {
List<GpxDisplayGroup> groups = getDisplayGroups();
if (groups == null) {
return;
}
mSelectedGpxFile.setDisplayGroups(groups);
}
updateContent();

View file

@ -1542,9 +1542,6 @@ public class TrackSegmentFragment extends OsmAndListFragment {
}
if (mSelectedGpxFile != null) {
List<GpxDisplayGroup> groups = getDisplayGroups();
if (groups == null) {
return;
}
mSelectedGpxFile.setDisplayGroups(groups);
}
if (mFragment.isVisible()) {