Fix filter groups

This commit is contained in:
PavelRatushny 2017-07-26 13:50:38 +03:00 committed by Alexey Kulish
parent 253519e861
commit 09177f90b2
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

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