This commit is contained in:
androiddevkotlin 2021-04-11 23:01:04 +03:00
parent 1b1132148f
commit 290f3af026
2 changed files with 8 additions and 3 deletions

View file

@ -69,9 +69,9 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme
private static final String SELECTED_LANG_KEY = "selected_lang";
private static final String EMPTY_URL = "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d4//";
private static final int MENU_ITEM_SHARE = 0;
private TravelArticleIdentifier articleId;
private ArrayList<String> langs;
private String selectedLang;
@ -256,6 +256,8 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme
public void onClick(View view) {
if (article != null) {
if (saved) {
GPXFile gpxFile = article.getGpxFile();
getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, false, true);
helper.removeArticleFromSaved(article);
} else {
getMyApplication().getTravelHelper().createGpxFile(article);

View file

@ -13,6 +13,7 @@ import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import com.squareup.picasso.RequestCreator;
import net.osmand.GPXUtilities;
import net.osmand.PicassoUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
@ -102,10 +103,12 @@ public class ArticleTravelCard extends BaseTravelCard {
public void onClick(View view) {
if (article != null) {
if (saved) {
GPXUtilities.GPXFile gpxFile = article.getGpxFile();
app.getSelectedGpxHelper().selectGpxFile(gpxFile, false, true);
helper.removeArticleFromSaved(article);
} else {
app.getTravelHelper().createGpxFile(article);
helper.addArticleToSaved(article);
app.getTravelHelper().createGpxFile(article);
}
updateSaveButton(holder);
}