another solution to issue fix

This commit is contained in:
madwasp79 2019-05-06 11:31:30 +03:00
parent caa2c08454
commit 6dfc75fd28
3 changed files with 10 additions and 13 deletions

View file

@ -69,12 +69,6 @@ public class GpxSelectionHelper {
saveCurrentSelections(); saveCurrentSelections();
} }
public void clearAllGpxFilesWithoutBackup() {
selectedGpxFilesBackUp.clear();
selectedGPXFiles = new ArrayList<>();
saveCurrentSelections();
}
public void restoreSelectedGpxFiles() { public void restoreSelectedGpxFiles() {
for (Entry<GPXFile, Long> gpxEntry : selectedGpxFilesBackUp.entrySet()) { for (Entry<GPXFile, Long> gpxEntry : selectedGpxFilesBackUp.entrySet()) {
if (!Algorithms.isEmpty(gpxEntry.getKey().path)) { if (!Algorithms.isEmpty(gpxEntry.getKey().path)) {

View file

@ -161,6 +161,7 @@ public class ConfigureMapMenu {
for (GpxSelectionHelper.SelectedGpxFile file : selectedGpxFiles) { for (GpxSelectionHelper.SelectedGpxFile file : selectedGpxFiles) {
files.add(file.getGpxFile().path); files.add(file.getGpxFile().path);
} }
if (selectedGpxFiles.isEmpty()) {
Map<GPXUtilities.GPXFile, Long> fls = selectedGpxHelper.getSelectedGpxFilesBackUp(); Map<GPXUtilities.GPXFile, Long> fls = selectedGpxHelper.getSelectedGpxFilesBackUp();
for(Map.Entry<GPXUtilities.GPXFile, Long> f : fls.entrySet()) { for(Map.Entry<GPXUtilities.GPXFile, Long> f : fls.entrySet()) {
if(!Algorithms.isEmpty(f.getKey().path)) { if(!Algorithms.isEmpty(f.getKey().path)) {
@ -170,6 +171,8 @@ public class ConfigureMapMenu {
} }
} }
} }
}
return files; return files;
} }

View file

@ -613,7 +613,7 @@ public class GpxUiHelper {
//clear all previously selected files before adding new one //clear all previously selected files before adding new one
OsmandApplication app = (OsmandApplication) activity.getApplication(); OsmandApplication app = (OsmandApplication) activity.getApplication();
if (app != null && app.getSelectedGpxHelper() != null) { if (app != null && app.getSelectedGpxHelper() != null) {
app.getSelectedGpxHelper().clearAllGpxFilesWithoutBackup(); app.getSelectedGpxHelper().clearAllGpxFileToShow();
} }
if (app != null && showCurrentGpx && adapter.getItem(0).getSelected()) { if (app != null && showCurrentGpx && adapter.getItem(0).getSelected()) {
currentGPX = app.getSavingTrackHelper().getCurrentGpx(); currentGPX = app.getSavingTrackHelper().getCurrentGpx();