Unbookmarking travel article should hide GPX file
This commit is contained in:
parent
ab605a035b
commit
3a5e8c6230
2 changed files with 6 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue