Add language show saved articles
This commit is contained in:
parent
bab02a6d54
commit
a06749b0e3
3 changed files with 5 additions and 4 deletions
|
@ -163,9 +163,10 @@ public class TravelLocalDataHelper {
|
|||
}
|
||||
|
||||
@Nullable
|
||||
public TravelArticle getSavedArticle(String routeId) {
|
||||
public TravelArticle getSavedArticle(String routeId, String lang) {
|
||||
for (TravelArticle article : savedArticles) {
|
||||
if (article.routeId != null && article.routeId.equals(routeId)) {
|
||||
if (article.routeId != null && article.routeId.equals(routeId)
|
||||
&& article.lang != null && article.lang.equals(lang)) {
|
||||
article.content = article.fullContent;
|
||||
return article;
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ public class TravelObfHelper implements TravelHelper {
|
|||
if (article != null) {
|
||||
return getArticleByIdFromTravelBooks(routeId, lang);
|
||||
}
|
||||
return localDataHelper.getSavedArticle(routeId);
|
||||
return localDataHelper.getSavedArticle(routeId, lang);
|
||||
}
|
||||
|
||||
public TravelArticle getArticleByIdFromTravelBooks(final String routeId, final String lang) {
|
||||
|
|
|
@ -161,7 +161,7 @@ public class SavedArticlesTabFragment extends BaseOsmAndFragment implements Trav
|
|||
}
|
||||
TravelArticle oldArticle = (TravelArticle) oldItem;
|
||||
TravelArticle newArticle = (TravelArticle) newItem;
|
||||
return oldArticle.getRouteId() != null && newArticle.getRouteId() != null &&
|
||||
return oldArticle.getRouteId() != null && oldArticle.getLang() != null &&
|
||||
oldArticle.getRouteId().equals(newArticle.getRouteId())
|
||||
&& oldArticle.getLang().equals(newArticle.getLang());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue