Skip to content

Commit

Permalink
Fix "Analyze by intervals - "None" does not work #20503"
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-kutz committed Sep 29, 2024
1 parent 8b20df1 commit c4a6fb8
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import net.osmand.plus.track.SplitTrackAsyncTask.SplitTrackListener;
import net.osmand.plus.track.helpers.GpxDisplayGroup;
import net.osmand.plus.track.helpers.GpxDisplayItem;
import net.osmand.plus.track.helpers.GpxSelectionHelper;
import net.osmand.plus.track.helpers.GpxSelectionHelper.GpxDisplayItemType;
import net.osmand.plus.track.helpers.SelectedGpxFile;
import net.osmand.plus.track.helpers.TrackDisplayGroup;
Expand Down Expand Up @@ -198,8 +199,13 @@ private void updateHeader() {
R.layout.popup_list_text_item, options));
popup.setOnItemClickListener((parent, view, position, id) -> {
selectedSplitInterval = position;
GpxSelectionParams params = GpxSelectionParams.getDefaultSelectionParams();
SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(getGpx(), params);
GpxFile gpxFile = getGpx();
GpxSelectionHelper gpxSelectionHelper = app.getSelectedGpxHelper();
SelectedGpxFile sf = gpxSelectionHelper.getSelectedFileByPath(gpxFile.getPath());
if (sf == null) {
GpxSelectionParams params = GpxSelectionParams.getDefaultSelectionParams();
sf = gpxSelectionHelper.selectGpxFile(gpxFile, params);
}
List<GpxDisplayGroup> groups = getDisplayGroups();
if (groups.size() > 0) {
updateSplit(groups, sf);
Expand Down

0 comments on commit c4a6fb8

Please sign in to comment.