use of net.osmand.plus.wikivoyage.data.TravelHelper in project Osmand by osmandapp.
the class ExploreTabFragment method downloadHasFinished.
@Override
public void downloadHasFinished() {
OsmandApplication app = getMyApplication();
if (app != null) {
TravelHelper travelHelper = app.getTravelHelper();
if (travelHelper.isAnyTravelBookPresent()) {
app.getTravelHelper().initializeDataOnAppStartup();
WikivoyageExploreActivity exploreActivity = getExploreActivity();
if (exploreActivity != null) {
exploreActivity.populateData(true);
}
} else {
removeRedundantCards();
}
}
}
use of net.osmand.plus.wikivoyage.data.TravelHelper in project Osmand by osmandapp.
the class SavedArticlesRvAdapter method updateSaveButton.
private void updateSaveButton(final TravelGpxVH holder, final TravelGpx article) {
if (article != null) {
final TravelHelper helper = app.getTravelHelper();
final boolean saved = helper.getBookmarksHelper().isArticleSaved(article);
Drawable icon = getActiveIcon(saved ? R.drawable.ic_action_read_later_fill : R.drawable.ic_action_read_later);
holder.rightButton.setText(saved ? R.string.shared_string_remove : R.string.shared_string_save);
holder.rightButton.setCompoundDrawablesWithIntrinsicBounds(null, null, icon, null);
holder.rightButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
helper.saveOrRemoveArticle(article, !saved);
updateSaveButton(holder, article);
}
});
}
}
Aggregations