From 3a5e8c6230bc7a59d6504be16a02ef0b62166630 Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Mon, 12 Apr 2021 20:33:04 +0300 Subject: [PATCH] Unbookmarking travel article should hide GPX file --- .../article/WikivoyageArticleDialogFragment.java | 7 +++---- .../wikivoyage/explore/travelcards/ArticleTravelCard.java | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java index e12d162e6e..0205feaaf6 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java @@ -254,18 +254,17 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme saveBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - if (article != null) { + getMyApplication().getTravelHelper().createGpxFile(article); + GPXFile gpxFile = article.getGpxFile(); if (saved) { - GPXFile gpxFile = article.getGpxFile(); getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, false, true); helper.removeArticleFromSaved(article); } else { - getMyApplication().getTravelHelper().createGpxFile(article); + getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, true, true); helper.addArticleToSaved(article); } updateSaveButton(); } - } }); } } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java index e7b70ccb40..ef59c079a3 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java @@ -104,13 +104,14 @@ public class ArticleTravelCard extends BaseTravelCard { holder.rightButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { + app.getTravelHelper().createGpxFile(article); + GPXFile gpxFile = article.getGpxFile(); if (saved) { - GPXFile gpxFile = article.getGpxFile(); app.getSelectedGpxHelper().selectGpxFile(gpxFile, false, true); helper.removeArticleFromSaved(article); } else { + app.getSelectedGpxHelper().selectGpxFile(gpxFile, true, true); helper.addArticleToSaved(article); - app.getTravelHelper().createGpxFile(article); } updateSaveButton(holder); }