From b3815da7571c736ffa758318416d01e099e5a9f1 Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Wed, 4 Apr 2018 17:33:01 +0300 Subject: [PATCH] Add "addToHistory" method overloading; add new history items to historyMap too --- .../plus/wikivoyage/data/WikivoyageSearchHistoryHelper.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageSearchHistoryHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageSearchHistoryHelper.java index 9a44a73c87..cfce08708b 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageSearchHistoryHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageSearchHistoryHelper.java @@ -38,6 +38,10 @@ public class WikivoyageSearchHistoryHelper { return new ArrayList<>(historyItems); } + public void addToHistory(WikivoyageArticle article) { + addToHistory(article.getCityId(), article.getTitle(), article.getLang(), article.getIsPartOf()); + } + public void addToHistory(long cityId, String title, String lang, String isPartOf) { WikivoyageSearchHistoryItem item = historyMap.get(cityId); boolean newItem = item == null; @@ -52,6 +56,7 @@ public class WikivoyageSearchHistoryHelper { if (newItem) { dbHelper.add(item); historyItems.add(item); + historyMap.put(item.cityId, item); } else { dbHelper.update(item); }