From bab02a6d5493901fc3832769e20038bd2644c137 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Sat, 19 Dec 2020 23:07:31 +0200 Subject: [PATCH 01/30] Add show saved articles without obf file --- .../plus/wikivoyage/data/TravelArticle.java | 1 + .../data/TravelLocalDataHelper.java | 33 +++++++++++++++---- .../plus/wikivoyage/data/TravelObfHelper.java | 5 ++- .../explore/SavedArticlesTabFragment.java | 5 +-- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelArticle.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelArticle.java index a559f3cf0f..22fe357fcf 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelArticle.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelArticle.java @@ -33,6 +33,7 @@ public class TravelArticle { String lang; String contentsJson; String aggregatedPartOf; + String fullContent; public String getTitle() { diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java index d64bed4ebe..881f6cba02 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java @@ -9,7 +9,6 @@ import net.osmand.plus.api.SQLiteAPI.SQLiteConnection; import net.osmand.plus.api.SQLiteAPI.SQLiteCursor; import net.osmand.plus.wikipedia.WikiArticleHelper; -import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -119,6 +118,7 @@ public class TravelLocalDataHelper { saved.lat = article.lat; saved.lon = article.lon; saved.routeId = article.routeId; + saved.fullContent = article.getContent(); savedArticles.add(saved); dbHelper.addSavedArticle(saved); notifySavedUpdated(); @@ -162,6 +162,17 @@ public class TravelLocalDataHelper { return null; } + @Nullable + public TravelArticle getSavedArticle(String routeId) { + for (TravelArticle article : savedArticles) { + if (article.routeId != null && article.routeId.equals(routeId)) { + article.content = article.fullContent; + return article; + } + } + return null; + } + public interface Listener { void savedArticlesUpdated(); @@ -169,7 +180,7 @@ public class TravelLocalDataHelper { private static class WikivoyageLocalDataDbHelper { - private static final int DB_VERSION = 5; + private static final int DB_VERSION = 6; private static final String DB_NAME = "wikivoyage_local_data"; private static final String HISTORY_TABLE_NAME = "wikivoyage_search_history"; @@ -204,6 +215,7 @@ public class TravelLocalDataHelper { private static final String BOOKMARKS_COL_LAT = "lat"; private static final String BOOKMARKS_COL_LON = "lon"; private static final String BOOKMARKS_COL_ROUTE_ID = "route_id"; + private static final String BOOKMARKS_COL_CONTENT = "content"; private static final String BOOKMARKS_TABLE_CREATE = "CREATE TABLE IF NOT EXISTS " + BOOKMARKS_TABLE_NAME + " (" + @@ -215,7 +227,8 @@ public class TravelLocalDataHelper { BOOKMARKS_COL_TRAVEL_BOOK + " TEXT, " + BOOKMARKS_COL_LAT + " double, " + BOOKMARKS_COL_LON + " double, " + - BOOKMARKS_COL_ROUTE_ID + " TEXT" + ");"; + BOOKMARKS_COL_ROUTE_ID + " TEXT, " + + BOOKMARKS_COL_CONTENT + " TEXT" + ");"; private static final String BOOKMARKS_TABLE_SELECT = "SELECT " + BOOKMARKS_COL_ARTICLE_TITLE + ", " + @@ -225,7 +238,8 @@ public class TravelLocalDataHelper { BOOKMARKS_COL_PARTIAL_CONTENT + ", " + BOOKMARKS_COL_LAT + ", " + BOOKMARKS_COL_LON + ", " + - BOOKMARKS_COL_ROUTE_ID + + BOOKMARKS_COL_ROUTE_ID + ", " + + BOOKMARKS_COL_CONTENT + " FROM " + BOOKMARKS_TABLE_NAME; private final OsmandApplication context; @@ -278,6 +292,9 @@ public class TravelLocalDataHelper { if (oldVersion < 5) { conn.execSQL("ALTER TABLE " + BOOKMARKS_TABLE_NAME + " ADD " + BOOKMARKS_COL_ROUTE_ID + " TEXT"); } + if (oldVersion < 6) { + conn.execSQL("ALTER TABLE " + BOOKMARKS_TABLE_NAME + " ADD " + BOOKMARKS_COL_CONTENT + " TEXT"); + } } @NonNull @@ -428,11 +445,12 @@ public class TravelLocalDataHelper { BOOKMARKS_COL_TRAVEL_BOOK + ", " + BOOKMARKS_COL_LAT + ", " + BOOKMARKS_COL_LON + ", " + - BOOKMARKS_COL_ROUTE_ID + - ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; + BOOKMARKS_COL_ROUTE_ID + ", " + + BOOKMARKS_COL_CONTENT + + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; conn.execSQL(query, new Object[]{article.title, article.lang, article.aggregatedPartOf, article.imageTitle, article.content, - travelBook, article.lat, article.lon, article.routeId}); + travelBook, article.lat, article.lon, article.routeId, article.fullContent}); } finally { conn.close(); } @@ -484,6 +502,7 @@ public class TravelLocalDataHelper { res.lat = cursor.getDouble(cursor.getColumnIndex(BOOKMARKS_COL_LAT)); res.lon = cursor.getDouble(cursor.getColumnIndex(BOOKMARKS_COL_LON)); res.routeId = cursor.getString(cursor.getColumnIndex(BOOKMARKS_COL_ROUTE_ID)); + res.fullContent = cursor.getString(cursor.getColumnIndex(BOOKMARKS_COL_CONTENT)); return res; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index c760baa04b..2ff29d1a33 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -169,9 +169,12 @@ public class TravelObfHelper implements TravelHelper { TravelArticle article = cachedArticles.get(routeId); if (article != null) { return article; - } else { + } + article = getArticleByIdFromTravelBooks(routeId, lang); + if (article != null) { return getArticleByIdFromTravelBooks(routeId, lang); } + return localDataHelper.getSavedArticle(routeId); } public TravelArticle getArticleByIdFromTravelBooks(final String routeId, final String lang) { diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java index 3bcb969f47..bb058c04e0 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java @@ -50,7 +50,7 @@ public class SavedArticlesTabFragment extends BaseOsmAndFragment implements Trav public void openArticle(TravelArticle article) { FragmentManager fm = getFragmentManager(); if (fm != null) { - WikivoyageArticleDialogFragment.showInstanceByTitle(app, fm, article.getTitle(), article.getLang()); + WikivoyageArticleDialogFragment.showInstance(app, fm, article.getRouteId(), article.getLang()); } } }); @@ -161,7 +161,8 @@ public class SavedArticlesTabFragment extends BaseOsmAndFragment implements Trav } TravelArticle oldArticle = (TravelArticle) oldItem; TravelArticle newArticle = (TravelArticle) newItem; - return oldArticle.getRouteId().equals(newArticle.getRouteId()) + return oldArticle.getRouteId() != null && newArticle.getRouteId() != null && + oldArticle.getRouteId().equals(newArticle.getRouteId()) && oldArticle.getLang().equals(newArticle.getLang()); } return false; From a06749b0e397bda55b74cee994b9575cc06c5239 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Mon, 21 Dec 2020 11:02:45 +0200 Subject: [PATCH 02/30] Add language show saved articles --- .../osmand/plus/wikivoyage/data/TravelLocalDataHelper.java | 5 +++-- .../src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java | 2 +- .../plus/wikivoyage/explore/SavedArticlesTabFragment.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java index 881f6cba02..26e6b06582 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java @@ -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; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 2ff29d1a33..1b94b138ac 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -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) { diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java index bb058c04e0..14790abfec 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesTabFragment.java @@ -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()); } From 01ea9d599842ba9f5862f45d1b6531e1e4dd3742 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Mon, 21 Dec 2020 15:30:57 +0200 Subject: [PATCH 03/30] Fix check empty first paragraph in the wiki article --- OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java index 9caf70d5b9..b4f21895f4 100644 --- a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java @@ -301,7 +301,7 @@ public class WikiArticleHelper { return null; } String firstParagraphHtml = content.substring(firstParagraphStart, firstParagraphEnd + P_CLOSED.length()); - while (firstParagraphHtml.length() == (P_OPENED.length() + P_CLOSED.length()) + while (firstParagraphHtml.substring(P_OPENED.length(), firstParagraphHtml.length() - P_CLOSED.length()).trim().isEmpty() && (firstParagraphEnd + P_CLOSED.length()) < content.length()) { firstParagraphStart = content.indexOf(P_OPENED, firstParagraphEnd); firstParagraphEnd = firstParagraphStart == -1 ? -1 : content.indexOf(P_CLOSED, firstParagraphStart); From 7944fc3a2b504b06796b095ad93e22ada12f36e5 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Tue, 22 Dec 2020 19:23:32 +0200 Subject: [PATCH 04/30] Fix Wikivoyage Card to suggest download maps --- .../net/osmand/plus/download/DownloadResources.java | 2 +- .../net/osmand/plus/wikipedia/WikiArticleHelper.java | 2 +- .../osmand/plus/wikivoyage/data/TravelDbHelper.java | 6 ++++++ .../osmand/plus/wikivoyage/data/TravelHelper.java | 2 ++ .../osmand/plus/wikivoyage/data/TravelObfHelper.java | 11 +++++++++-- .../plus/wikivoyage/explore/ExploreTabFragment.java | 12 +----------- .../explore/WikivoyageExploreActivity.java | 7 ++++++- 7 files changed, 26 insertions(+), 16 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java index 2bff73d7b2..b66ca9c467 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java @@ -80,7 +80,7 @@ public class DownloadResources extends DownloadResourceGroup { List items = getWikivoyageItems(); if (items != null) { for (IndexItem ii : items) { - if (ii.getFileName().equals(fileName)) { + if (ii.getTargetFile(app).getName().equals(fileName)) { return ii; } } diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java index 9caf70d5b9..b4f21895f4 100644 --- a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java @@ -301,7 +301,7 @@ public class WikiArticleHelper { return null; } String firstParagraphHtml = content.substring(firstParagraphStart, firstParagraphEnd + P_CLOSED.length()); - while (firstParagraphHtml.length() == (P_OPENED.length() + P_CLOSED.length()) + while (firstParagraphHtml.substring(P_OPENED.length(), firstParagraphHtml.length() - P_CLOSED.length()).trim().isEmpty() && (firstParagraphEnd + P_CLOSED.length()) < content.length()) { firstParagraphStart = content.indexOf(P_OPENED, firstParagraphEnd); firstParagraphEnd = firstParagraphStart == -1 ? -1 : content.indexOf(P_CLOSED, firstParagraphStart); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java index d50d05e42b..ef6dbd921e 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java @@ -46,6 +46,7 @@ public class TravelDbHelper implements TravelHelper { private static final Log LOG = PlatformUtil.getLog(TravelDbHelper.class); + private static final String WORLD_WIKIVOYAGE_FILE_NAME = "World_wikivoyage.sqlite"; private static final String ARTICLES_TABLE_NAME = "travel_articles"; private static final String POPULAR_TABLE_NAME = "popular_articles"; private static final String ARTICLES_POP_INDEX = "popularity_index"; @@ -185,6 +186,11 @@ public class TravelDbHelper implements TravelHelper { return null; } + @Override + public String getWikivoyageFileName() { + return WORLD_WIKIVOYAGE_FILE_NAME; + } + public List getExistingTravelBooks() { return existingTravelBooks; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java index b55c398817..d8112cee0c 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java @@ -49,4 +49,6 @@ public interface TravelHelper { // For TravelOBFHelper it could always return "" and should be no problem // Bookmarks should be refactored properly to support multiple files String getSelectedTravelBookName(); + + String getWikivoyageFileName(); } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index e1dc65ebfd..94d342ddc6 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -37,8 +37,10 @@ import static net.osmand.CollatorStringMatcher.StringMatcherMode.CHECK_EQUALS_FR public class TravelObfHelper implements TravelHelper { private static final Log LOG = PlatformUtil.getLog(TravelObfHelper.class); - public static final String ROUTE_ARTICLE = "route_article"; - public static final int SEARCH_RADIUS = 100000; + + private static final String WORLD_WIKIVOYAGE_FILE_NAME = "World_wikivoyage.travel.obf"; + private static final String ROUTE_ARTICLE = "route_article"; + private static final int SEARCH_RADIUS = 100000; private final OsmandApplication app; private final Collator collator; @@ -392,4 +394,9 @@ public class TravelObfHelper implements TravelHelper { public String getSelectedTravelBookName() { return ""; } + + @Override + public String getWikivoyageFileName() { + return WORLD_WIKIVOYAGE_FILE_NAME; + } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java index 22310e4292..c53027fb7a 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java @@ -45,8 +45,6 @@ import java.util.List; public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEvents, TravelLocalDataHelper.Listener { - private static final String WORLD_WIKIVOYAGE_FILE_NAME = "World_wikivoyage.sqlite"; - private static boolean SHOW_TRAVEL_UPDATE_CARD = true; private static boolean SHOW_TRAVEL_NEEDED_MAPS_CARD = true; @@ -342,14 +340,6 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv return res.toArray(new IndexItem[0]); } - @NonNull - private String getWikivoyageFileName() { -// OsmandApplication app = getMyApplication(); -// File selectedTravelBook = app != null ? app.getTravelDbHelper().getSelectedTravelBook() : null; -// return selectedTravelBook == null ? WORLD_WIKIVOYAGE_FILE_NAME : selectedTravelBook.getName(); - return WORLD_WIKIVOYAGE_FILE_NAME; - } - private void removeDownloadUpdateCard() { if (adapter != null) { adapter.removeDownloadUpdateCard(); @@ -379,7 +369,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv ProcessIndexItemsTask(ExploreTabFragment fragment) { app = fragment.getMyApplication(); weakFragment = new WeakReference<>(fragment); - fileName = fragment.getWikivoyageFileName(); + fileName = app.getTravelHelper().getWikivoyageFileName(); } @Override diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java index 45047e2e1c..a3522a8329 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java @@ -61,6 +61,7 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv protected List> fragments = new ArrayList<>(); private LockableViewPager viewPager; + private boolean finishDownloading = false; @Override public void onCreate(Bundle savedInstanceState) { @@ -313,10 +314,12 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv public void populateData() { switchProgressBarVisibility(true); + finishDownloading = false; new LoadWikivoyageData(this).execute(); } private void onDataLoaded() { + finishDownloading = true; switchProgressBarVisibility(false); updateSearchBarVisibility(); updateFragments(); @@ -353,7 +356,9 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv } public void onTabFragmentResume(Fragment fragment) { - updateFragments(); + if(finishDownloading) { + updateFragments(); + } } @Override From ca9d2a03f5c2fef3801ad93fe6a20016b4c2291e Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Wed, 23 Dec 2020 15:16:09 +0200 Subject: [PATCH 05/30] Fix bookmark contents --- .../plus/wikivoyage/data/TravelLocalDataHelper.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java index 26e6b06582..3cb7cf776e 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java @@ -119,6 +119,7 @@ public class TravelLocalDataHelper { saved.lon = article.lon; saved.routeId = article.routeId; saved.fullContent = article.getContent(); + saved.contentsJson = article.contentsJson; savedArticles.add(saved); dbHelper.addSavedArticle(saved); notifySavedUpdated(); @@ -216,6 +217,7 @@ public class TravelLocalDataHelper { private static final String BOOKMARKS_COL_LAT = "lat"; private static final String BOOKMARKS_COL_LON = "lon"; private static final String BOOKMARKS_COL_ROUTE_ID = "route_id"; + private static final String BOOKMARKS_COL_CONTENT_JSON = "content_json"; private static final String BOOKMARKS_COL_CONTENT = "content"; private static final String BOOKMARKS_TABLE_CREATE = "CREATE TABLE IF NOT EXISTS " + @@ -229,6 +231,7 @@ public class TravelLocalDataHelper { BOOKMARKS_COL_LAT + " double, " + BOOKMARKS_COL_LON + " double, " + BOOKMARKS_COL_ROUTE_ID + " TEXT, " + + BOOKMARKS_COL_CONTENT_JSON + " TEXT, " + BOOKMARKS_COL_CONTENT + " TEXT" + ");"; private static final String BOOKMARKS_TABLE_SELECT = "SELECT " + @@ -240,6 +243,7 @@ public class TravelLocalDataHelper { BOOKMARKS_COL_LAT + ", " + BOOKMARKS_COL_LON + ", " + BOOKMARKS_COL_ROUTE_ID + ", " + + BOOKMARKS_COL_CONTENT_JSON + ", " + BOOKMARKS_COL_CONTENT + " FROM " + BOOKMARKS_TABLE_NAME; @@ -294,6 +298,7 @@ public class TravelLocalDataHelper { conn.execSQL("ALTER TABLE " + BOOKMARKS_TABLE_NAME + " ADD " + BOOKMARKS_COL_ROUTE_ID + " TEXT"); } if (oldVersion < 6) { + conn.execSQL("ALTER TABLE " + BOOKMARKS_TABLE_NAME + " ADD " + BOOKMARKS_COL_CONTENT_JSON + " TEXT"); conn.execSQL("ALTER TABLE " + BOOKMARKS_TABLE_NAME + " ADD " + BOOKMARKS_COL_CONTENT + " TEXT"); } } @@ -447,11 +452,13 @@ public class TravelLocalDataHelper { BOOKMARKS_COL_LAT + ", " + BOOKMARKS_COL_LON + ", " + BOOKMARKS_COL_ROUTE_ID + ", " + + BOOKMARKS_COL_CONTENT_JSON + ", " + BOOKMARKS_COL_CONTENT + - ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; conn.execSQL(query, new Object[]{article.title, article.lang, article.aggregatedPartOf, article.imageTitle, article.content, - travelBook, article.lat, article.lon, article.routeId, article.fullContent}); + travelBook, article.lat, article.lon, article.routeId, article.contentsJson, + article.fullContent}); } finally { conn.close(); } @@ -503,6 +510,7 @@ public class TravelLocalDataHelper { res.lat = cursor.getDouble(cursor.getColumnIndex(BOOKMARKS_COL_LAT)); res.lon = cursor.getDouble(cursor.getColumnIndex(BOOKMARKS_COL_LON)); res.routeId = cursor.getString(cursor.getColumnIndex(BOOKMARKS_COL_ROUTE_ID)); + res.contentsJson = cursor.getString(cursor.getColumnIndex(BOOKMARKS_COL_CONTENT_JSON)); res.fullContent = cursor.getString(cursor.getColumnIndex(BOOKMARKS_COL_CONTENT)); return res; From 33dec4240421b5cc43a601b49b334ae416895afd Mon Sep 17 00:00:00 2001 From: Michel GERDAY Date: Sun, 27 Dec 2020 17:17:29 +0000 Subject: [PATCH 06/30] Translated using Weblate (French) Currently translated at 99.9% (3588 of 3590 strings) --- OsmAnd/res/values-fr/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 3e52b62a0e..b52ca23ec8 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -4002,4 +4002,6 @@ Dernier utilisé Pirivilégier les itinéraires de randonnée Pirivilégier les itinéraires de randonnée + Autoriser les voies navigables intermittentes + Autoriser les voies navigables intermittentes \ No newline at end of file From ba388b318cfedbb6548d7c39dc3eb7397e501af4 Mon Sep 17 00:00:00 2001 From: Hakuchi Date: Mon, 28 Dec 2020 01:29:31 +0000 Subject: [PATCH 07/30] Translated using Weblate (German) Currently translated at 100.0% (3590 of 3590 strings) --- OsmAnd/res/values-de/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 47098cf9fb..13db3f7737 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -3181,7 +3181,7 @@ %s ist gespeichert Track öffnen Track %s ist gespeichert - Keine + Keines WunderLINQ Parrot Ein externes Steuergerät, wie beispielsweise eine Tastatur oder ein WunderLINQ, wählen. From 03081ecb64e6d84d4e9568f8719a7b1585d64e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=2E=20R=C3=BCdinger?= Date: Mon, 28 Dec 2020 01:27:18 +0000 Subject: [PATCH 08/30] Translated using Weblate (German) Currently translated at 100.0% (3590 of 3590 strings) --- OsmAnd/res/values-de/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 13db3f7737..95344ac93f 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -2418,7 +2418,7 @@ Ermöglicht schnelle Beiträge zu Mapillary. Fotos von der Straße aus dem Netz für jeden. Orte entdecken, mitwirken und die Welt in Bildern festhalten. Mapillary - Mit Mapillary Bilder dieses Orts beitragen. + Mit Mapillary Bilder von diesem Ort beisteuern. Installieren Online-Fotos Keine Fotos hier. @@ -3839,7 +3839,7 @@ Nächstes Segment Navigationsprofil Wählen Sie eine Trackdatei, für die ein neues Segment hinzugefügt werden soll. - Track auswählen, der verfolgt werden soll + Track auswählen, dem gefolgt werden soll Adresse löschen Adresse hinzufügen Adresse eingeben From ad7db9b438ec6ab86686267534d53e45acc05bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Babos=20G=C3=A1bor?= Date: Sun, 27 Dec 2020 13:52:57 +0000 Subject: [PATCH 09/30] Translated using Weblate (Hungarian) Currently translated at 100.0% (3590 of 3590 strings) --- OsmAnd/res/values-hu/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index 0ddc2b3f86..2142695973 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -1621,7 +1621,7 @@ Kihagyás OsmAnd Offline térképek\nés navigáció - Tovább + Következő Műszerfal beállításai Veszély törlés @@ -4015,8 +4015,8 @@ Utoljára használt Túraútvonalak előnyben részesítése Túraútvonalak előnyben részesítése - Patakok és csatornák engedélyezése - Patakok és csatornák engedélyezése + Patakok és vízelvezető árkok engedélyezése + Patakok és vízelvezető árkok engedélyezése Időszakos vízfolyások engedélyezése Időszakos vízfolyások engedélyezése \ No newline at end of file From 011c1ad78e14cfd16e77999f06e5f4b0acba14de Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Mon, 28 Dec 2020 01:13:47 +0000 Subject: [PATCH 10/30] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3590 of 3590 strings) --- OsmAnd/res/values-uk/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index 16ab9db234..5fecd504a6 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -4019,4 +4019,8 @@ Востаннє використовувалось Дозволити переривчасті водні шляхи Дозволити переривчасті водні шляхи + Надавати перевагу пішохідним маршрутам + Надавати перевагу пішохідним маршрутам + Дозволити потоки та стічні канали + Дозволити потоки та стічні канали \ No newline at end of file From d3dc64732190108256a87471fc9fb6ef445c66e3 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Sat, 26 Dec 2020 23:32:32 +0000 Subject: [PATCH 11/30] Translated using Weblate (Slovak) Currently translated at 100.0% (3590 of 3590 strings) --- OsmAnd/res/values-sk/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 216eebcf1d..ca4436bcc3 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -4021,4 +4021,10 @@ Otočiť všetky body Zvoľte profil, ktorý bude použitý pri štarte aplikácie. Naposledy použité + Uprednostniť turistické trasy + Uprednostniť turistické trasy + Povoliť potoky a odtokové kanály + Povoliť potoky a odtokové kanály + Povoliť dočasné vodné toky + Povoliť dočasné vodné toky \ No newline at end of file From bf4684795447fcd511cf46a969a32f9a13b795f9 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Sun, 27 Dec 2020 09:40:28 +0000 Subject: [PATCH 12/30] Translated using Weblate (Hebrew) Currently translated at 99.8% (3585 of 3590 strings) --- OsmAnd/res/values-iw/strings.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml index 0faf759a72..97db038f97 100644 --- a/OsmAnd/res/values-iw/strings.xml +++ b/OsmAnd/res/values-iw/strings.xml @@ -3913,7 +3913,7 @@ תודה לך על רכישת ‚קווי מתאר’ הימנעות משבילי הולכי רגל הימנעות משבילי הולכי רגל - המינוי חויב לתקופה הנבחרת. ניתן לבטל דרך ה־AppGallery בכל עת. + המינוי מחויב לפי התקופה הנבחרת. ניתן לבטל אותו דרך ה־AppGallery בכל עת. חשבון ה־AppGallery שלך יחויב עם אישור הרכישה. \n \nתוקף המינוי מתארך אוטומטי אלא אם כן בוטל בטרם תאריך החידוש. החשבון שלך יחויב על תקופת החידוש (חודש/שלושה חודשים/שנה) רק בתאריך החידוש. @@ -4023,4 +4023,10 @@ להפוך את כל הנקודות נא לבחור את הפרופיל בו יעשה שימוש עם הפעלת היישומון. שימוש אחרון + להעדיף מסלולי הליכה + להעדיף מסלולי הליכה + לאפשר נחלים וניקוזים + לאפשר נחלים וניקוזים + לאפשר מקטעים עם דרכי מים עונתיים + לאפשר מקטעים עם דרכי מים עונתיים \ No newline at end of file From 597f54e7d130cc5a02a177064339e899d1db66c6 Mon Sep 17 00:00:00 2001 From: Softmap Date: Sun, 27 Dec 2020 20:20:46 +0000 Subject: [PATCH 13/30] Translated using Weblate (Arabic) Currently translated at 100.0% (3590 of 3590 strings) --- OsmAnd/res/values-ar/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index 31907c0417..ebc6a7b115 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -4008,4 +4008,10 @@ عكس جميع النقاط حدد ملف التعريف، الذي سيتم استخدامه في بدء التطبيق. آخر استخدام + تفضيل طرق التنزه + تفضيل طرق التنزه + السماح بالتيارات والمصارف + السماح بالتيارات والمصارف + السماح بالممرات المائية المتقطعة + السماح بالممرات المائية المتقطعة \ No newline at end of file From 29db0daa014aba81cdbd0f5e9ac1e1aee2e36a10 Mon Sep 17 00:00:00 2001 From: Hakuchi Date: Mon, 28 Dec 2020 01:39:25 +0000 Subject: [PATCH 14/30] Translated using Weblate (German) Currently translated at 100.0% (3877 of 3877 strings) --- OsmAnd/res/values-de/phrases.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index e39de1583c..216951a62c 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -3832,7 +3832,7 @@ kein Vibrieren Pfeil Vibrieren - Give box + Tauschbox Stadtteil Bezirk Aufzug @@ -3848,7 +3848,7 @@ Kleine Elektrogeräte Nussladen Flüssigerdgas - Rastplatz + Parkbucht Überdachter Parkplatz Dachparkplätze GPX-Wegpunkt From f8dd7a2391373db10e03bf59c0f84a43ede833b4 Mon Sep 17 00:00:00 2001 From: syl Date: Sun, 27 Dec 2020 19:13:25 +0000 Subject: [PATCH 15/30] Translated using Weblate (French) Currently translated at 99.8% (3873 of 3877 strings) --- OsmAnd/res/values-fr/phrases.xml | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/OsmAnd/res/values-fr/phrases.xml b/OsmAnd/res/values-fr/phrases.xml index 5371880ddc..92e6a64d53 100644 --- a/OsmAnd/res/values-fr/phrases.xml +++ b/OsmAnd/res/values-fr/phrases.xml @@ -1128,7 +1128,7 @@ Autorisés en été seulement Entrée uniquement Sortie uniquement - Entrée et Sortie + Entrée et sortie Accès d\'été : entrée uniquement Accès d\'été : sortie uniquement Accès d\'été : entrée et sortie @@ -3559,7 +3559,7 @@ Trail (moto) Institution pour les transports Point d\'eau pour poids lourds - Multi-famille + Multi-familles Magasin de parquet Point de livraison Service des eaux @@ -3625,7 +3625,7 @@ Accès véhicules : militaires Accès véhicules : livraisons Accès véhicules : foresterie - Accès véhicules à moteur : non + Accès véhicule motorisé : non Accès motoneige : non Oui Livraison @@ -3633,22 +3633,22 @@ Indiqué Oui suspendu - Accès véhicules : oui - accès-voiture : privé - accès-voiture : impossible - accès-voiture : possible - Accès aux automobiles:forestiers - accès-voiture : autorisé - Accès-voiture : privé - Accès aux véhicules à moteur : livraison - Accès-véhicules : agricoles - Accès aux automobiles:riverains - Accès aux automobiles:forestiers - Accès aux véhicules à moteurs:riverains - Accès véhicule à moteur:toléré - Accès au véhicule à moteur:clients - Accès aux véhicules à moteur:militaires - Accès aux véhicules à moteurs:forestiers + Accès voiture : oui + Accès voiture : privé + Accès voiture : non + Accès voiture : permis + Accès voiture : clientèle + Accès véhicule motorisé : oui + Accès véhicule motorisé : privé + Accès véhicule motorisé : livraison + Accès véhicule motorisé : agricole + Accès voiture : riverains + Accès voiture : forestier + Accès véhicule motorisé : riverains + Accès véhicule motorisé : toléré + Accès véhicule motorisé : clientèle + Accès véhicule motorisé : militaire + Accès véhicule motorisé : forestier Entrée de cave Magasin de diététique Constructeur @@ -3688,7 +3688,7 @@ Type Plein-air Lac - Accès à cheval : forestiers seuls + Accès à cheval : forestier Accès piétonnier : riverains Accès aux remorques : non Accès aux transports publics ou taxis : oui From 63dfe5dd8aca207774c1a5fb85f08f8760f1d040 Mon Sep 17 00:00:00 2001 From: Franco Date: Sat, 26 Dec 2020 22:53:39 +0000 Subject: [PATCH 16/30] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3590 of 3590 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 01a7bc425a..101029bd57 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -3935,7 +3935,7 @@ El archivo ya fue importado en OsmAnd Usar el algoritmo de navegación A* bifásica Gráfico - Hay %1$s datos disponibles sólo en los caminos, calcular una ruta usando «Ruta entre puntos» para ver los gráficos. + Los datos de «%1$s» sólo están disponibles con los caminos, calcula una ruta usando «Ruta entre puntos» para ver los gráficos. Ten paciencia. \nEl gráfico estará disponible al recalcular la ruta. %1$s — %2$s @@ -4024,4 +4024,12 @@ Perfil de OsmAnd Perfil de usuario Invertir todos los puntos + Elige el perfil que será usado al iniciar la aplicación. + Usado por última vez + Prefiere rutas de senderismo + Preferir rutas de senderismo + Permite arroyos y desagües + Permitir arroyos y desagües + Permite cursos de agua intermitentes + Permitir cursos de agua intermitentes \ No newline at end of file From 56f3eacde90a115f4f9f115840c98116c18fbb8c Mon Sep 17 00:00:00 2001 From: Franco Date: Sat, 26 Dec 2020 22:59:20 +0000 Subject: [PATCH 17/30] Translated using Weblate (Spanish (American)) Currently translated at 100.0% (3590 of 3590 strings) --- OsmAnd/res/values-es-rUS/strings.xml | 31 +++++++++++++++++++--------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/OsmAnd/res/values-es-rUS/strings.xml b/OsmAnd/res/values-es-rUS/strings.xml index e5909587a9..311a2c875c 100644 --- a/OsmAnd/res/values-es-rUS/strings.xml +++ b/OsmAnd/res/values-es-rUS/strings.xml @@ -1952,7 +1952,7 @@ Lapso de tiempo mínimo entre avisos. Rumbo relativo Rumbo magnético - Destino indefinido + Complemento de accesibilidad: Destino indefinido Activa la navegación para cambios en vivo de OsmAnd. Navegación con OsmAnd Live Síguenos @@ -2396,7 +2396,7 @@ Descarga el mapa de «Curvas de nivel» para usarlas en esta región. Complemento Compra e instala el complemento «Curvas de nivel» para mostrar áreas verticales graduadas. - Descarga el mapa «Superposición de sombreado» para mostrar el sombreado vertical. + Descarga la capa superpuesta del mapa «Sombreado» para mostrar el sombreado vertical. Instala el complemento «Curvas de nivel» para mostrar las áreas verticales graduadas. Ocultar desde el nivel de zoom Mostrar u ocultar notas de OSM @@ -3432,7 +3432,7 @@ Nombre de usuario y contraseña Los ajustes de este complemento son globales y se aplican a todos los perfiles Edición de OSM - Puedes ver todas tus ediciones aún no subidas o errores de OSM en «%1$s». Los puntos subidos no se muestran en OsmAnd. + Vea todas las ediciones aún no subidas o errores de OSM en «%1$s». Los cambios ya cargados no se mostrarán más. OSM El icono se muestra mientras se navega o se mueve. El icono se muestra en reposo. @@ -3794,9 +3794,9 @@ Controla el nivel de zoom del mapa usando los botones de volumen del dispositivo. Botones de volumen como zoom Descargar datos de Wikipedia - El punto de destino actual de la ruta será borrado. Si será el destino, la navegación se detendrá. + Quita el siguiente destino de la ruta. Si es el destino final, la navegación se detendrá. Borrar el punto de destino más cercano - Obtén información sobre los puntos de interés de Wikipedia. Es tu guía de bolsillo sin conexión - sólo activa el complemento de Wikipedia y disfruta los artículos sobre los objetos de alrededor. + Obtén información sobre los puntos de interés de Wikipedia, una guía de bolsillo sin conexión que incluye artículos sobre objetos y destinos. Proporciona un nombre para el punto Proporciona la longitud del vehículo, se pueden aplicar algunas restricciones de rutas para vehículos largos. Motoneta (motor) @@ -3851,7 +3851,7 @@ Abrir traza existente Última edición Importar traza - ¿Cerrar el plan de ruta sin guardar\?, se descartarán todos los cambios. + ¿Descartar todos los cambios en la ruta planificada\? Crear nueva ruta Cambiar el tipo de ruta anterior Cambiar el tipo de ruta posterior @@ -3908,12 +3908,12 @@ Último modificado Iconos de inicio y fin Gracias por comprar las «Curvas de nivel» - La suscripción se cobra por el período elegido. Puedes cancelarlo en cualquier momento en AppGallery. + La suscripción se cobra por el período elegido. Puedes cancelarlo en AppGallery en cualquier momento. El pago será cargado a la cuenta de AppGallery al confirmar la compra. \n \nLa suscripción se renueva automáticamente a menos que se cancele antes de la fecha de renovación. La cuenta será cargada por el período de renovación (mes/trimestre/año) sólo en la fecha de renovación. \n -\nPuedes administrar y cancelar las suscripciones accediendo a los ajustes de AppGallery. +\nPuedes administrar y cancelar las suscripciones en los ajustes de AppGallery. Evita pasar por aceras o veredas Evitar aceras Novedades @@ -3935,8 +3935,8 @@ MGRS MGRS OsmAnd usa MGRS, similar al formato UTM de la OTAN. - Hay %1$s datos disponibles sólo en los caminos, calcular una ruta usando «Ruta entre puntos» para ver los gráficos. - Ten paciencia + Los datos de «%1$s» sólo están disponibles con los caminos, calcula una ruta usando «Ruta entre puntos» para ver los gráficos. + Ten paciencia. \nEl gráfico estará disponible al recalcular la ruta. %1$s — %2$s Viaje @@ -4018,4 +4018,15 @@ Alemán (casual) Puedes usar los datos de elevación para tener en cuenta el ascenso y descenso del viaje Avión ligero + Usado por última vez + Preferir rutas de senderismo + Prefiere rutas de senderismo + Permitir arroyos y desagües + Permite arroyos y desagües + Permitir cursos de agua intermitentes + Permite cursos de agua intermitentes + Invertir todos los puntos + Perfil de usuario + Perfil de OsmAnd + Elige el perfil que será usado al iniciar la aplicación. \ No newline at end of file From 5c30ce696f1048d5e7e6123ac1b2612d214eec56 Mon Sep 17 00:00:00 2001 From: Franco Date: Sat, 26 Dec 2020 23:06:39 +0000 Subject: [PATCH 18/30] Translated using Weblate (Spanish (American)) Currently translated at 100.0% (3877 of 3877 strings) --- OsmAnd/res/values-es-rUS/phrases.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/OsmAnd/res/values-es-rUS/phrases.xml b/OsmAnd/res/values-es-rUS/phrases.xml index ca1d54f2d3..b46dce884c 100644 --- a/OsmAnd/res/values-es-rUS/phrases.xml +++ b/OsmAnd/res/values-es-rUS/phrases.xml @@ -3893,4 +3893,16 @@ Agente de dinero móvil Vacunación: COVID19 Vacunación + Lavadero público de ropa + Estación de transferencia de residuos + Báscula puente + Estación de guardabosque + Lago + Río + Pozo + Bomba accionada + Tanque de agua + Grifo + Planta potabilizadora + Pozo entubado \ No newline at end of file From 729b88516bc11df33ff3af1caef15f40543f49fe Mon Sep 17 00:00:00 2001 From: abdullah abdulrhman Date: Sun, 27 Dec 2020 08:54:48 +0000 Subject: [PATCH 19/30] Translated using Weblate (Arabic) Currently translated at 92.7% (3597 of 3877 strings) --- OsmAnd/res/values-ar/phrases.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ar/phrases.xml b/OsmAnd/res/values-ar/phrases.xml index 77ca89347a..da2bfb09a0 100644 --- a/OsmAnd/res/values-ar/phrases.xml +++ b/OsmAnd/res/values-ar/phrases.xml @@ -2510,7 +2510,7 @@ بتروجليف مقبرة كبيرة قديمة دائرة الكوخ - مستعمرة + مستوطنة/هجرة حصن تومولوس المغليث حجر ضخم From a8dfe2cf4c01e2dbe850ce13a5bc447af3916a02 Mon Sep 17 00:00:00 2001 From: ssantos Date: Sun, 27 Dec 2020 09:03:56 +0000 Subject: [PATCH 20/30] Translated using Weblate (Portuguese) Currently translated at 99.8% (3873 of 3877 strings) --- OsmAnd/res/values-pt/phrases.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-pt/phrases.xml b/OsmAnd/res/values-pt/phrases.xml index f523f432af..a1ee9f3b00 100644 --- a/OsmAnd/res/values-pt/phrases.xml +++ b/OsmAnd/res/values-pt/phrases.xml @@ -3878,4 +3878,5 @@ Tanque de água Torneira Estação de tratamento de água + Posto de guarda florestal \ No newline at end of file From 46791d9cdddd8e5a0ed981c74e2088855b642e94 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Mon, 28 Dec 2020 02:02:41 +0000 Subject: [PATCH 21/30] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3590 of 3590 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 28a6ff15b6..17c657df59 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -4016,4 +4016,10 @@ 反轉所有點 選取要在應用程式啟動時使用的設定檔。 最後使用 + 偏好遠足路線 + 偏好遠足路線 + 允許溪流與水溝 + 允許溪流與水溝 + 允許間歇水路 + 允許間歇水路 \ No newline at end of file From 777d93f69612a4057ca16feba3a49ea13651f827 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 28 Dec 2020 13:27:16 +0200 Subject: [PATCH 22/30] Add logs for index item update --- .../plus/download/DownloadResources.java | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java index 2bff73d7b2..c8951b29f7 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java @@ -8,9 +8,9 @@ import net.osmand.PlatformUtil; import net.osmand.data.LatLon; import net.osmand.map.OsmandRegions; import net.osmand.map.WorldRegion; +import net.osmand.plus.CustomRegion; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; -import net.osmand.plus.CustomRegion; import net.osmand.plus.download.DownloadOsmandIndexesHelper.AssetIndexItem; import net.osmand.plus.inapp.InAppPurchaseHelper; import net.osmand.util.Algorithms; @@ -21,6 +21,7 @@ import java.io.File; import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStream; +import java.text.DateFormat; import java.text.ParseException; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -177,6 +178,8 @@ public class DownloadResources extends DownloadResourceGroup { } } if (date != null && !date.equals(indexActivatedDate) && !date.equals(indexFilesDate)) { + long oldItemSize = 0; + long itemSize = item.getContentSize(); if ((item.getType() == DownloadActivityType.NORMAL_FILE && !item.extra) || item.getType() == DownloadActivityType.ROADS_FILE || item.getType() == DownloadActivityType.WIKIPEDIA_FILE @@ -185,15 +188,12 @@ public class DownloadResources extends DownloadResourceGroup { outdated = true; } else if (item.getType() == DownloadActivityType.WIKIVOYAGE_FILE || item.getType() == DownloadActivityType.TRAVEL_FILE) { - long itemSize = item.getContentSize(); - long oldItemSize = app.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR + + oldItemSize = app.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR + item.getTargetFileName()).length(); if (itemSize != oldItemSize) { outdated = true; } } else { - long itemSize = item.getContentSize(); - long oldItemSize = 0; if (parsed && item.getTimestamp() > item.getLocalTimestamp()) { outdated = true; } else if (item.getType() == DownloadActivityType.VOICE_FILE) { @@ -223,12 +223,23 @@ public class DownloadResources extends DownloadResourceGroup { outdated = true; } } + if (outdated) { + logItemUpdateInfo(item, format, itemSize, oldItemSize); + } } item.setOutdated(outdated); return outdated; } - + private void logItemUpdateInfo(IndexItem item, DateFormat format, long itemSize, long oldItemSize) { + String date = item.getDate(format); + String sfName = item.getTargetFileName(); + String indexActivatedDate = indexActivatedFileNames.get(sfName); + String indexFilesDate = indexFileNames.get(sfName); + LOG.info("timestamp " + item.timestamp + " localTimestamp " + item.localTimestamp + " date " + date + + " indexActivatedDate " + indexActivatedDate + " indexFilesDate " + indexFilesDate + + " itemSize " + itemSize + " oldItemSize " + oldItemSize); + } protected void updateFilesToUpdate() { initAlreadyLoadedFiles(); From 8375f7f107b71aefc0ccaeac20a2677f4841436a Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Mon, 28 Dec 2020 14:09:06 +0200 Subject: [PATCH 23/30] One inter --- OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java index 91440912d2..de373ce221 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java @@ -522,7 +522,7 @@ public class WaypointDialogHelper { }) .create(); int intermediateSize = targetsHelper.getIntermediatePoints().size(); - if (intermediateSize > 1) { + if (intermediateSize >= 1) { items.add(reorderAllItems); } From bd0ee52f913ddfa91efdb2f975ea9db88c5f68f2 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Mon, 28 Dec 2020 14:17:13 +0200 Subject: [PATCH 24/30] Fix --- OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java index de373ce221..59d0c90026 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java @@ -521,8 +521,7 @@ public class WaypointDialogHelper { } }) .create(); - int intermediateSize = targetsHelper.getIntermediatePoints().size(); - if (intermediateSize >= 1) { + if (!Algorithms.isEmpty(targetsHelper.getIntermediatePoints())) { items.add(reorderAllItems); } From e968a030063940678750ddfbcbe5ceb16a80b574 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Mon, 28 Dec 2020 14:19:03 +0200 Subject: [PATCH 25/30] Update WaypointDialogHelper.java --- .../plus/helpers/WaypointDialogHelper.java | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java index 59d0c90026..112364a6ba 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java @@ -502,26 +502,26 @@ public class WaypointDialogHelper { .create(); items.add(reorderStartAndFinishItem); - BaseBottomSheetItem reorderAllItems = new SimpleBottomSheetItem.Builder() - .setIcon(getContentIcon(R.drawable.ic_action_sort_reverse_order)) - .setTitle(getString(R.string.reverse_all_points)) - .setLayoutId(R.layout.bottom_sheet_item_simple) - .setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - MapActivity mapActivity = getMapActivity(); - if (mapActivity != null) { - WaypointDialogHelper.reverseAllPoints( - app, - mapActivity, - mapActivity.getDashboard().getWaypointDialogHelper() - ); - } - dismiss(); - } - }) - .create(); if (!Algorithms.isEmpty(targetsHelper.getIntermediatePoints())) { + BaseBottomSheetItem reorderAllItems = new SimpleBottomSheetItem.Builder() + .setIcon(getContentIcon(R.drawable.ic_action_sort_reverse_order)) + .setTitle(getString(R.string.reverse_all_points)) + .setLayoutId(R.layout.bottom_sheet_item_simple) + .setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + MapActivity mapActivity = getMapActivity(); + if (mapActivity != null) { + WaypointDialogHelper.reverseAllPoints( + app, + mapActivity, + mapActivity.getDashboard().getWaypointDialogHelper() + ); + } + dismiss(); + } + }) + .create(); items.add(reorderAllItems); } From 144f812f40dfc8c8b9075f0d5776361f17dcafa1 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Mon, 28 Dec 2020 17:14:18 +0200 Subject: [PATCH 26/30] Fix review --- .../osmand/plus/wikivoyage/explore/ExploreRvAdapter.java | 1 + .../plus/wikivoyage/explore/WikivoyageExploreActivity.java | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java index 29951db19a..c0ab357e0c 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java @@ -182,6 +182,7 @@ public class ExploreRvAdapter extends RecyclerView.Adapter> fragments = new ArrayList<>(); private LockableViewPager viewPager; - private boolean finishDownloading = false; @Override public void onCreate(Bundle savedInstanceState) { @@ -314,12 +313,10 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv public void populateData() { switchProgressBarVisibility(true); - finishDownloading = false; new LoadWikivoyageData(this).execute(); } private void onDataLoaded() { - finishDownloading = true; switchProgressBarVisibility(false); updateSearchBarVisibility(); updateFragments(); @@ -356,9 +353,7 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv } public void onTabFragmentResume(Fragment fragment) { - if(finishDownloading) { - updateFragments(); - } + updateFragments(); } @Override From 75afb2b2270204e30ed30f1a1f034eeda808d119 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Tue, 29 Dec 2020 10:17:41 +0200 Subject: [PATCH 27/30] Fix review --- .../src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java | 1 - .../plus/wikivoyage/explore/WikivoyageExploreActivity.java | 1 - 2 files changed, 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java index c0ab357e0c..29951db19a 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java @@ -182,7 +182,6 @@ public class ExploreRvAdapter extends RecyclerView.Adapter Date: Tue, 29 Dec 2020 10:36:20 +0200 Subject: [PATCH 28/30] Add file name --- OsmAnd/src/net/osmand/plus/download/DownloadResources.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java index c8951b29f7..648d3d3a00 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java @@ -236,7 +236,7 @@ public class DownloadResources extends DownloadResourceGroup { String sfName = item.getTargetFileName(); String indexActivatedDate = indexActivatedFileNames.get(sfName); String indexFilesDate = indexFileNames.get(sfName); - LOG.info("timestamp " + item.timestamp + " localTimestamp " + item.localTimestamp + " date " + date + LOG.info("name " + item.getFileName() + " timestamp " + item.timestamp + " localTimestamp " + item.localTimestamp + " date " + date + " indexActivatedDate " + indexActivatedDate + " indexFilesDate " + indexFilesDate + " itemSize " + itemSize + " oldItemSize " + oldItemSize); } From 8716d49a25a1aa3efc008d744e114d80beb5ed20 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Tue, 29 Dec 2020 11:16:11 +0200 Subject: [PATCH 29/30] Fix ExploreRvAdapter --- .../osmand/plus/wikivoyage/explore/ExploreRvAdapter.java | 8 ++++++-- .../wikivoyage/explore/WikivoyageExploreActivity.java | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java index 29951db19a..a95614bdb8 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreRvAdapter.java @@ -142,7 +142,9 @@ public class ExploreRvAdapter extends RecyclerView.Adapter Date: Tue, 29 Dec 2020 11:49:02 +0200 Subject: [PATCH 30/30] change default settings for the "Close changeset" switch --- .../dialogs/SendPoiBottomSheetFragment.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java index a715c33354..21b61d1fe3 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java @@ -72,20 +72,13 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment { String userNameOpenID = settings.USER_NAME.get(); String userName = isLoginOAuth(settings) ? userNameOAuth : userNameOpenID; accountName.setText(userName); - closeChangeSet.setBackgroundResource(isNightMode ? R.drawable.layout_bg_dark : R.drawable.layout_bg); final int paddingSmall = app.getResources().getDimensionPixelSize(R.dimen.content_padding_small); - closeChangeSet.setPadding(paddingSmall, 0, paddingSmall, 0); + closeChangeSet.setChecked(true); + setCloseChangeSet(isNightMode, paddingSmall); closeChangeSet.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - if (isNightMode) { - closeChangeSet.setBackgroundResource( - isChecked ? R.drawable.layout_bg_dark_solid : R.drawable.layout_bg_dark); - } else { - closeChangeSet.setBackgroundResource( - isChecked ? R.drawable.layout_bg_solid : R.drawable.layout_bg); - } - closeChangeSet.setPadding(paddingSmall, 0, paddingSmall, 0); + setCloseChangeSet(isNightMode, paddingSmall); } }); LinearLayout account = sendOsmPoiView.findViewById(R.id.account_container); @@ -254,5 +247,16 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment { } return comment; } + + private void setCloseChangeSet(boolean isNightMode, int paddingSmall) { + if (isNightMode) { + closeChangeSet.setBackgroundResource( + closeChangeSet.isChecked() ? R.drawable.layout_bg_dark_solid : R.drawable.layout_bg_dark); + } else { + closeChangeSet.setBackgroundResource( + closeChangeSet.isChecked() ? R.drawable.layout_bg_solid : R.drawable.layout_bg); + } + closeChangeSet.setPadding(paddingSmall, 0, paddingSmall, 0); + } }