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() {
|
saveBtn.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if (article != null) {
|
getMyApplication().getTravelHelper().createGpxFile(article);
|
||||||
if (saved) {
|
|
||||||
GPXFile gpxFile = article.getGpxFile();
|
GPXFile gpxFile = article.getGpxFile();
|
||||||
|
if (saved) {
|
||||||
getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, false, true);
|
getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, false, true);
|
||||||
helper.removeArticleFromSaved(article);
|
helper.removeArticleFromSaved(article);
|
||||||
} else {
|
} else {
|
||||||
getMyApplication().getTravelHelper().createGpxFile(article);
|
getMyApplication().getSelectedGpxHelper().selectGpxFile(gpxFile, true, true);
|
||||||
helper.addArticleToSaved(article);
|
helper.addArticleToSaved(article);
|
||||||
}
|
}
|
||||||
updateSaveButton();
|
updateSaveButton();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,13 +104,14 @@ public class ArticleTravelCard extends BaseTravelCard {
|
||||||
holder.rightButton.setOnClickListener(new View.OnClickListener() {
|
holder.rightButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if (saved) {
|
app.getTravelHelper().createGpxFile(article);
|
||||||
GPXFile gpxFile = article.getGpxFile();
|
GPXFile gpxFile = article.getGpxFile();
|
||||||
|
if (saved) {
|
||||||
app.getSelectedGpxHelper().selectGpxFile(gpxFile, false, true);
|
app.getSelectedGpxHelper().selectGpxFile(gpxFile, false, true);
|
||||||
helper.removeArticleFromSaved(article);
|
helper.removeArticleFromSaved(article);
|
||||||
} else {
|
} else {
|
||||||
|
app.getSelectedGpxHelper().selectGpxFile(gpxFile, true, true);
|
||||||
helper.addArticleToSaved(article);
|
helper.addArticleToSaved(article);
|
||||||
app.getTravelHelper().createGpxFile(article);
|
|
||||||
}
|
}
|
||||||
updateSaveButton(holder);
|
updateSaveButton(holder);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue