From 57182b80f8ea83be7301fc02e4dfba84e338076a Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Tue, 3 Apr 2018 11:05:44 +0300 Subject: [PATCH] Add field "imageTitle" to WikivoyageSearchResult --- .../osmand/plus/wikivoyage/data/WikivoyageDbHelper.java | 4 +++- .../plus/wikivoyage/data/WikivoyageSearchResult.java | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageDbHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageDbHelper.java index 6f5601b99a..3781de1421 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageDbHelper.java @@ -65,7 +65,8 @@ public class WikivoyageDbHelper { SEARCH_TABLE_NAME + "." + SEARCH_COL_CITY_ID + ", " + SEARCH_COL_ARTICLE_TITLE + ", " + SEARCH_TABLE_NAME + "." + SEARCH_COL_LANG + ", " + - ARTICLES_COL_IS_PART_OF + + ARTICLES_COL_IS_PART_OF + ", " + + ARTICLES_COL_IMAGE_TITLE + " FROM " + SEARCH_TABLE_NAME + " JOIN " + ARTICLES_TABLE_NAME + " ON " + SEARCH_TABLE_NAME + "." + SEARCH_COL_ARTICLE_TITLE + " = " + ARTICLES_TABLE_NAME + "." + ARTICLES_COL_TITLE + @@ -185,6 +186,7 @@ public class WikivoyageDbHelper { res.articleTitles.add(cursor.getString(2)); res.langs.add(cursor.getString(3)); res.isPartOf = cursor.getString(4); + res.imageTitle = cursor.getString(5); return res; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageSearchResult.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageSearchResult.java index e295f9331f..8fae83a095 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageSearchResult.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageSearchResult.java @@ -17,6 +17,7 @@ public class WikivoyageSearchResult implements Parcelable { List articleTitles = new ArrayList<>(); List langs = new ArrayList<>(); String isPartOf; + String imageTitle; WikivoyageSearchResult() { @@ -28,6 +29,7 @@ public class WikivoyageSearchResult implements Parcelable { articleTitles = in.createStringArrayList(); langs = in.createStringArrayList(); isPartOf = in.readString(); + imageTitle = in.readString(); } public List getSearchTerms() { @@ -50,6 +52,10 @@ public class WikivoyageSearchResult implements Parcelable { return isPartOf; } + public String getImageTitle() { + return imageTitle; + } + public String getFirstLangsString() { StringBuilder res = new StringBuilder(); int limit = Math.min(SHOW_LANGS, langs.size()); @@ -74,6 +80,7 @@ public class WikivoyageSearchResult implements Parcelable { dest.writeStringList(articleTitles); dest.writeStringList(langs); dest.writeString(isPartOf); + dest.writeString(imageTitle); } public static final Creator CREATOR = new Creator() {