From e130c12ab083bee557fec6d762418825dc206443 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Mon, 23 Nov 2020 12:32:54 +0200 Subject: [PATCH 01/66] Wikivoyage to OBF migration: Work in progress. --- .../src/net/osmand/plus/AppInitializer.java | 12 +- .../net/osmand/plus/OsmandApplication.java | 8 +- .../plus/activities/MapActivityActions.java | 7 +- .../plus/mapmarkers/MapMarkersHelper.java | 9 +- .../adapters/MapMarkersGroupsAdapter.java | 9 +- .../TrackActivityFragmentAdapter.java | 2 +- .../wikivoyage/WikivoyageWebViewClient.java | 4 +- .../WikivoyageArticleDialogFragment.java | 17 +- .../WikivoyageArticleNavigationFragment.java | 4 +- .../plus/wikivoyage/data/TravelDbHelper.java | 22 +- .../plus/wikivoyage/data/TravelHelper.java | 56 ++++ .../data/TravelLocalDataHelper.java | 4 +- .../plus/wikivoyage/data/TravelObfHelper.java | 292 ++++++++++++++++++ .../explore/ExploreTabFragment.java | 19 +- .../explore/SavedArticlesRvAdapter.java | 2 +- .../explore/SavedArticlesTabFragment.java | 2 +- .../explore/WikivoyageExploreActivity.java | 12 +- ...oyageOptionsBottomSheetDialogFragment.java | 17 +- .../travelcards/ArticleTravelCard.java | 4 +- .../menu/WikivoyageWptPtMenuController.java | 2 +- .../WikivoyageSearchDialogFragment.java | 2 +- .../search/WikivoyageSearchHelper.java | 2 +- 22 files changed, 440 insertions(+), 68 deletions(-) create mode 100644 OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java create mode 100644 OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index a862182014..8f13681d69 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -66,6 +66,8 @@ import net.osmand.plus.voice.JSTTSCommandPlayerImpl; import net.osmand.plus.voice.MediaCommandPlayerImpl; import net.osmand.plus.voice.TTSCommandPlayerImpl; import net.osmand.plus.wikivoyage.data.TravelDbHelper; +import net.osmand.plus.wikivoyage.data.TravelHelper; +import net.osmand.plus.wikivoyage.data.TravelObfHelper; import net.osmand.render.RenderingRulesStorage; import net.osmand.router.RoutingConfiguration; import net.osmand.util.Algorithms; @@ -85,7 +87,6 @@ import java.util.Locale; import java.util.Map; import java.util.Random; -import btools.routingapp.BRouterServiceConnection; import btools.routingapp.IBRouterService; import static net.osmand.plus.AppVersionUpgradeOnInit.LAST_APP_VERSION; @@ -457,11 +458,14 @@ public class AppInitializer implements IProgress { app.mapMarkersHelper = startupInit(new MapMarkersHelper(app), MapMarkersHelper.class); app.searchUICore = startupInit(new QuickSearchHelper(app), QuickSearchHelper.class); app.mapViewTrackingUtilities = startupInit(new MapViewTrackingUtilities(app), MapViewTrackingUtilities.class); - app.travelDbHelper = new TravelDbHelper(app); + + //TODO cleanup after Travel migration complete + app.travelHelper = TravelObfHelper.checkIfObfFileExists(app) ? new TravelObfHelper(app) : new TravelDbHelper(app); if (app.getSettings().SELECTED_TRAVEL_BOOK.get() != null) { - app.travelDbHelper.initTravelBooks(); + app.travelHelper.initTravelBooks(); } - app.travelDbHelper = startupInit(app.travelDbHelper, TravelDbHelper.class); + app.travelHelper = startupInit(app.travelHelper, TravelHelper.class); + app.lockHelper = startupInit(new LockHelper(app), LockHelper.class); app.settingsHelper = startupInit(new SettingsHelper(app), SettingsHelper.class); app.quickActionRegistry = startupInit(new QuickActionRegistry(app.getSettings()), QuickActionRegistry.class); diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 97cfeb662a..233350b319 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -79,7 +79,7 @@ import net.osmand.plus.settings.backend.OsmAndAppCustomization; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.settings.backend.backup.SettingsHelper; import net.osmand.plus.voice.CommandPlayer; -import net.osmand.plus.wikivoyage.data.TravelDbHelper; +import net.osmand.plus.wikivoyage.data.TravelHelper; import net.osmand.router.GeneralRouter; import net.osmand.router.RoutingConfiguration; import net.osmand.router.RoutingConfiguration.Builder; @@ -148,7 +148,7 @@ public class OsmandApplication extends MultiDexApplication { OsmandRegions regions; GeocodingLookupService geocodingLookupService; QuickSearchHelper searchUICore; - TravelDbHelper travelDbHelper; + TravelHelper travelHelper; InAppPurchaseHelper inAppPurchaseHelper; MapViewTrackingUtilities mapViewTrackingUtilities; LockHelper lockHelper; @@ -481,8 +481,8 @@ public class OsmandApplication extends MultiDexApplication { return searchUICore; } - public TravelDbHelper getTravelDbHelper() { - return travelDbHelper; + public TravelHelper getTravelHelper() { + return travelHelper; } public InAppPurchaseHelper getInAppPurchaseHelper() { diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 749c5371ea..1a9c28a689 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -76,6 +76,7 @@ import net.osmand.plus.views.layers.MapControlsLayer; import net.osmand.plus.wikipedia.WikipediaDialogFragment; import net.osmand.plus.wikivoyage.WikivoyageWelcomeDialogFragment; import net.osmand.plus.wikivoyage.data.TravelDbHelper; +import net.osmand.plus.wikivoyage.data.TravelHelper; import net.osmand.plus.wikivoyage.explore.WikivoyageExploreActivity; import net.osmand.router.GeneralRouter; import net.osmand.util.Algorithms; @@ -924,9 +925,9 @@ public class MapActivityActions implements DialogProvider { @Override public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) { MapActivity.clearPrevActivityIntent(); - TravelDbHelper travelDbHelper = getMyApplication().getTravelDbHelper(); - travelDbHelper.initTravelBooks(); - if (travelDbHelper.getSelectedTravelBook() == null) { + TravelHelper travelHelper = getMyApplication().getTravelHelper(); + travelHelper.initTravelBooks(); + if (travelHelper.getSelectedTravelBook() == null) { WikivoyageWelcomeDialogFragment.showInstance(mapActivity.getSupportFragmentManager()); } else { Intent intent = new Intent(mapActivity, WikivoyageExploreActivity.class); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java index 9839ccffda..d14ec40f4c 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java @@ -27,6 +27,7 @@ import net.osmand.plus.R; import net.osmand.plus.Version; import net.osmand.plus.wikivoyage.data.TravelArticle; import net.osmand.plus.wikivoyage.data.TravelDbHelper; +import net.osmand.plus.wikivoyage.data.TravelHelper; import net.osmand.util.Algorithms; import net.osmand.util.MapUtils; @@ -567,11 +568,11 @@ public class MapMarkersHelper { @NonNull public List getGroupsForSavedArticlesTravelBook() { List res = new ArrayList<>(); - TravelDbHelper travelDbHelper = ctx.getTravelDbHelper(); - if (travelDbHelper.getSelectedTravelBook() != null) { - List savedArticles = travelDbHelper.getLocalDataHelper().getSavedArticles(); + TravelHelper travelHelper = ctx.getTravelHelper(); + if (travelHelper.getSelectedTravelBook() != null) { + List savedArticles = travelHelper.getLocalDataHelper().getSavedArticles(); for (TravelArticle art : savedArticles) { - String gpxName = travelDbHelper.getGPXName(art); + String gpxName = travelHelper.getGPXName(art); File path = ctx.getAppPath(IndexConstants.GPX_TRAVEL_DIR + gpxName); LOG.debug("Article group " + path.getAbsolutePath() + " " + path.exists()); MapMarkersGroup search = getMapMarkerGroupById(getMarkerGroupId(path), MapMarkersGroup.GPX_TYPE); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java index d4ba663fe4..f8aae1f9d2 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java @@ -37,6 +37,7 @@ import net.osmand.plus.mapmarkers.SelectWptCategoriesBottomSheetDialogFragment; import net.osmand.plus.wikivoyage.article.WikivoyageArticleDialogFragment; import net.osmand.plus.wikivoyage.data.TravelArticle; import net.osmand.plus.wikivoyage.data.TravelDbHelper; +import net.osmand.plus.wikivoyage.data.TravelHelper; import java.io.File; import java.text.SimpleDateFormat; @@ -163,11 +164,11 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter savedArticles = travelDbHelper.getLocalDataHelper().getSavedArticles(); + TravelHelper travelHelper = mapActivity.getMyApplication().getTravelHelper(); + if (travelHelper.getSelectedTravelBook() != null) { + List savedArticles = travelHelper.getLocalDataHelper().getSavedArticles(); for (TravelArticle art : savedArticles) { - String gpxName = travelDbHelper.getGPXName(art); + String gpxName = travelHelper.getGPXName(art); File path = mapActivity.getMyApplication().getAppPath(IndexConstants.GPX_TRAVEL_DIR + gpxName); if (path.getAbsolutePath().equals(group.getGpxPath())) { group.setWikivoyageArticle(art); diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackActivityFragmentAdapter.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackActivityFragmentAdapter.java index 7612583067..d27ceba057 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackActivityFragmentAdapter.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackActivityFragmentAdapter.java @@ -486,7 +486,7 @@ public class TrackActivityFragmentAdapter implements TrackBitmapDrawerListener { String title = metadata.getArticleTitle(); String lang = metadata.getArticleLang(); if (!TextUtils.isEmpty(title) && !TextUtils.isEmpty(lang)) { - return app.getTravelDbHelper().getArticle(title, lang); + return app.getTravelHelper().getArticle(title, lang); } return null; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageWebViewClient.java b/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageWebViewClient.java index fe47a8f370..7886ff2a7e 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageWebViewClient.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageWebViewClient.java @@ -67,7 +67,7 @@ public class WikivoyageWebViewClient extends WebViewClient { if (url.contains(WIKIVOAYAGE_DOMAIN) && isWebPage) { String lang = WikiArticleHelper.getLang(url); String articleName = WikiArticleHelper.getArticleNameFromUrl(url, lang); - long articleId = app.getTravelDbHelper().getArticleId(articleName, lang); + long articleId = app.getTravelHelper().getArticleId(articleName, lang); if (articleId != 0) { WikivoyageArticleDialogFragment.showInstance(app, fragmentManager, articleId, lang); } else { @@ -116,7 +116,7 @@ public class WikivoyageWebViewClient extends WebViewClient { fragmentManager.popBackStackImmediate(); - File path = app.getTravelDbHelper().createGpxFile(article); + File path = app.getTravelHelper().createGpxFile(article); GPXUtilities.GPXFile gpxFile = article.getGpxFile(); gpxFile.path = path.getAbsolutePath(); app.getSelectedGpxHelper().setGpxFileToDisplay(gpxFile); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java index fa704688a0..d23200f40b 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java @@ -42,6 +42,7 @@ import net.osmand.plus.wikivoyage.WikivoyageShowPicturesDialogFragment; import net.osmand.plus.wikivoyage.WikivoyageWebViewClient; import net.osmand.plus.wikivoyage.data.TravelArticle; import net.osmand.plus.wikivoyage.data.TravelDbHelper; +import net.osmand.plus.wikivoyage.data.TravelHelper; import net.osmand.plus.wikivoyage.data.TravelLocalDataHelper; import net.osmand.util.Algorithms; @@ -148,8 +149,8 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme if (article == null || activity == null || fm == null) { return; } - TravelDbHelper dbHelper = getMyApplication().getTravelDbHelper(); - File path = dbHelper.createGpxFile(article); + TravelHelper travelHelper = getMyApplication().getTravelHelper(); + File path = travelHelper.createGpxFile(article); Intent newIntent = new Intent(activity, getMyApplication().getAppCustomization().getTrackActivity()); newIntent.putExtra(TrackActivity.TRACK_FILE_NAME, path.getAbsolutePath()); newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); @@ -234,7 +235,7 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme private void updateSaveButton() { if (article != null) { - final TravelLocalDataHelper helper = getMyApplication().getTravelDbHelper().getLocalDataHelper(); + final TravelLocalDataHelper helper = getMyApplication().getTravelHelper().getLocalDataHelper(); final boolean saved = helper.isArticleSaved(article); Drawable icon = getActiveIcon(saved ? R.drawable.ic_action_read_later_fill : R.drawable.ic_action_read_later); saveBtn.setText(getString(saved ? R.string.shared_string_remove : R.string.shared_string_bookmark)); @@ -246,7 +247,7 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme if (saved) { helper.removeArticleFromSaved(article); } else { - getMyApplication().getTravelDbHelper().createGpxFile(article); + getMyApplication().getTravelHelper().createGpxFile(article); helper.addArticleToSaved(article); } updateSaveButton(); @@ -301,7 +302,7 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme selectedLang = langs.get(0); } articleToolbarText.setText(""); - article = getMyApplication().getTravelDbHelper().getArticle(tripId, selectedLang); + article = getMyApplication().getTravelHelper().getArticle(tripId, selectedLang); if (article == null) { return; } @@ -314,7 +315,7 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme trackButton.setVisibility(View.GONE); } - TravelLocalDataHelper ldh = getMyApplication().getTravelDbHelper().getLocalDataHelper(); + TravelLocalDataHelper ldh = getMyApplication().getTravelHelper().getLocalDataHelper(); ldh.addToHistory(article); updateSaveButton(); @@ -370,7 +371,7 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme @NonNull FragmentManager fm, @NonNull String title, @NonNull String lang) { - long cityId = app.getTravelDbHelper().getArticleId(title, lang); + long cityId = app.getTravelHelper().getArticleId(title, lang); return showInstance(app, fm, cityId, lang); } @@ -378,7 +379,7 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme @NonNull FragmentManager fm, long cityId, @Nullable String selectedLang) { - ArrayList langs = app.getTravelDbHelper().getArticleLangs(cityId); + ArrayList langs = app.getTravelHelper().getArticleLangs(cityId); return showInstance(fm, cityId, langs, selectedLang); } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleNavigationFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleNavigationFragment.java index 886e128d04..11ca183c50 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleNavigationFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleNavigationFragment.java @@ -73,13 +73,13 @@ public class WikivoyageArticleNavigationFragment extends MenuBottomSheetDialogFr return; } - article = getMyApplication().getTravelDbHelper().getArticle(cityId, selectedLang); + article = getMyApplication().getTravelHelper().getArticle(cityId, selectedLang); if (article == null) { return; } parentsList = new ArrayList<>(Arrays.asList(article.getAggregatedPartOf().split(","))); - LinkedHashMap> navigationMap = getMyApplication().getTravelDbHelper().getNavigationMap(article); + LinkedHashMap> navigationMap = getMyApplication().getTravelHelper().getNavigationMap(article); items.add(new TitleItem(getString(R.string.shared_string_navigation))); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java index 8ed755cf50..163f3483db 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java @@ -14,6 +14,7 @@ import net.osmand.IndexConstants; import net.osmand.Location; import net.osmand.OsmAndCollator; import net.osmand.PlatformUtil; +import net.osmand.data.Amenity; import net.osmand.data.LatLon; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; @@ -43,7 +44,7 @@ import java.util.Set; import gnu.trove.map.hash.TLongObjectHashMap; -public class TravelDbHelper { +public class TravelDbHelper implements TravelHelper { private static final Log LOG = PlatformUtil.getLog(TravelDbHelper.class); @@ -646,7 +647,7 @@ public class TravelDbHelper { return file; } - private static class PopularArticle { + protected static class PopularArticle { long tripId; String title; String lang; @@ -654,11 +655,11 @@ public class TravelDbHelper { int order; double lat; double lon; - + public boolean isLocationSpecified() { return !Double.isNaN(lat) && !Double.isNaN(lon); } - + public static PopularArticle readArticle(SQLiteCursor cursor) { PopularArticle res = new PopularArticle(); res.title = cursor.getString(0); @@ -670,5 +671,18 @@ public class TravelDbHelper { res.popIndex = cursor.isNull(6) ? 0 : cursor.getInt(6); return res; } + + public static PopularArticle readArticleFromAmenity(Amenity a, String lang) { + Map additional = a.getAdditionalInfo(); + PopularArticle res = new PopularArticle(); + res.title = a.getName(lang); + res.lat = a.getLocation().getLatitude(); + res.lon = a.getLocation().getLongitude(); + res.tripId = a.getId(); + res.lang = lang; + res.order = -1; + res.popIndex = 0; + return res; + } } } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java new file mode 100644 index 0000000000..ae621539a3 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java @@ -0,0 +1,56 @@ +package net.osmand.plus.wikivoyage.data; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import net.osmand.plus.OsmandApplication; + +import java.io.File; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +public interface TravelHelper { + + TravelLocalDataHelper getLocalDataHelper(); + + void initTravelBooks(); + + void loadDataForSelectedTravelBook(); + + File getSelectedTravelBook(); + + List getExistingTravelBooks(); + + void selectTravelBook(File f); + + @NonNull + List search(final String searchQuery); + + @NonNull + List getPopularArticles(); + + @NonNull + List loadPopularArticles(); + + public LinkedHashMap> getNavigationMap( + final TravelArticle article); + + TravelArticle getArticle(long cityId, String lang); + + TravelArticle getArticle(String title, String lang); + + long getArticleId(String title, String lang); + + ArrayList getArticleLangs(long cityId); + + String formatTravelBookName(File tb); + + String getGPXName(TravelArticle article); + + File createGpxFile(TravelArticle article); + + + +} diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java index 6127c3e5d5..68f2f7cc2c 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java @@ -260,7 +260,7 @@ public class TravelLocalDataHelper { if (oldVersion < 3) { conn.execSQL("ALTER TABLE " + HISTORY_TABLE_NAME + " ADD " + HISTORY_COL_TRAVEL_BOOK + " TEXT"); conn.execSQL("ALTER TABLE " + BOOKMARKS_TABLE_NAME + " ADD " + BOOKMARKS_COL_TRAVEL_BOOK + " TEXT"); - File selectedTravelBook = context.getTravelDbHelper().getSelectedTravelBook(); + File selectedTravelBook = context.getTravelHelper().getSelectedTravelBook(); if (selectedTravelBook != null) { Object[] args = new Object[]{selectedTravelBook.getName()}; conn.execSQL("UPDATE " + HISTORY_TABLE_NAME + " SET " + HISTORY_COL_TRAVEL_BOOK + " = ?", args); @@ -452,7 +452,7 @@ public class TravelLocalDataHelper { @Nullable private String getSelectedTravelBookName() { - File selectedTravelBook = context.getTravelDbHelper().getSelectedTravelBook(); + File selectedTravelBook = context.getTravelHelper().getSelectedTravelBook(); if (selectedTravelBook != null) { return selectedTravelBook.getName(); } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java new file mode 100644 index 0000000000..28b3f6f062 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -0,0 +1,292 @@ +package net.osmand.plus.wikivoyage.data; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import net.osmand.Collator; +import net.osmand.GPXUtilities; +import net.osmand.IndexConstants; +import net.osmand.Location; +import net.osmand.OsmAndCollator; +import net.osmand.PlatformUtil; +import net.osmand.ResultMatcher; +import net.osmand.binary.BinaryIndexPart; +import net.osmand.binary.BinaryMapIndexReader; +import net.osmand.binary.BinaryMapPoiReaderAdapter; +import net.osmand.data.Amenity; +import net.osmand.data.LatLon; +import net.osmand.osm.MapPoiTypes; +import net.osmand.osm.PoiCategory; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.activities.actions.OsmAndAction; +import net.osmand.plus.api.SQLiteAPI; +import net.osmand.plus.resources.AmenityIndexRepository; +import net.osmand.search.core.SearchResult; +import net.osmand.util.Algorithms; +import net.osmand.util.MapUtils; + +import org.apache.commons.logging.Log; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + + +public class TravelObfHelper implements TravelHelper{ + + private static final Log LOG = PlatformUtil.getLog(TravelObfHelper.class); + + private final OsmandApplication application; + private Collator collator; + private TravelLocalDataHelper localDataHelper; + + private File selectedTravelBook = null; + private List existingTravelBooks = new ArrayList<>(); + private List popularArticles = new ArrayList(); + + private BinaryMapIndexReader index = null; + + + public TravelObfHelper(OsmandApplication application) { + this.application = application; + collator = OsmAndCollator.primaryCollator(); + localDataHelper = new TravelLocalDataHelper(application); //will I need it? + } + + public static boolean checkIfObfFileExists(OsmandApplication app) { + File[] files = app.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles(); + if (files != null) { + for (File f : files) { + if (f.getName().equals("Wikivoyage.obf")) { + return true; + } + } + } + return false; + } + + @Override + public TravelLocalDataHelper getLocalDataHelper() { + return localDataHelper; + } + + /** TODO + * 1.implement regional travelbooks + * 2. check settings for default? + */ + public void initTravelBooks() { + List files = getPossibleFiles(); + String travelBook = application.getSettings().SELECTED_TRAVEL_BOOK.get(); + existingTravelBooks.clear(); + if (files != null && !files.isEmpty()) { + for (File f : files) { + existingTravelBooks.add(f); +// if (selectedTravelBook == null) { +// selectedTravelBook = f; +// } else if (Algorithms.objectEquals(travelBook, f.getName())) { +// selectedTravelBook = f; +// } + } + selectedTravelBook = files.get(0); + } else { + selectedTravelBook = null; + } + + } + + /** + * todo: get all obf files from folder, may be we should add some suffix like 'wikivoyage' + * to filenames to distinguish from other maps? Or add some checks right there. + */ + @Nullable + private List getPossibleFiles() { + File[] files = application.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles(); + if (files != null) { + List res = new ArrayList<>(); + for (File file : files) { + if (file.getName().equals("Wikivoyage.obf")) { + res.add(file); + LOG.debug(String.format("FIle name: %s", file.getAbsolutePath())); + } + } + return res; + } + return null; + } + + public void loadDataForSelectedTravelBook() { + localDataHelper.refreshCachedData(); + loadPopularArticles(); + } + + @Override + public File getSelectedTravelBook() { + return selectedTravelBook; + } + + @Override + public List getExistingTravelBooks() { + return null; + } + + @Override + public void selectTravelBook(File f) { + + } + + @NonNull + @Override + public List search(String searchQuery) { + return null; + } + + @NonNull + public List getPopularArticles() { + return popularArticles; + } + + //TODO for now it reads any articles, since we didn't have popular articles in the obf + @NonNull + public List loadPopularArticles() { + String language = application.getLanguage(); + final List articles = new ArrayList<>(); + try { + BinaryMapIndexReader bookIndexReader = getBookBinaryIndex(); + if (bookIndexReader == null) { + popularArticles = new ArrayList<>(); + return popularArticles; + } + LatLon ll = application.getMapViewTrackingUtilities().getMapLocation(); + float coeff = 2; + BinaryMapIndexReader.SearchRequest req = + BinaryMapIndexReader.buildSearchPoiRequest( + MapUtils.get31TileNumberX(ll.getLongitude() - coeff), + MapUtils.get31TileNumberX(ll.getLongitude() + coeff), + MapUtils.get31TileNumberY(ll.getLatitude() + coeff), + MapUtils.get31TileNumberY(ll.getLatitude() - coeff), + -1, + BinaryMapIndexReader.ACCEPT_ALL_POI_TYPE_FILTER, + new ResultMatcher() { + int count = 0; + + @Override + public boolean publish(Amenity object) { + if (object.getSubType().equals("route_article")) { + articles.add(object); + } + return false; + } + + @Override + public boolean isCancelled() { + return false; + } + }); + + bookIndexReader.searchPoi(req); + bookIndexReader.close(); + + if (articles.size() > 0) { + Iterator it = articles.iterator(); + while (it.hasNext()) { + Amenity a = it.next(); + popularArticles.add(readArticle(a, language)); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + + return popularArticles; + } + + + private TravelArticle readArticle(Amenity amenity, String lang) { + TravelArticle res = new TravelArticle(); + + res.title = amenity.getName(lang).equals("") ? amenity.getName() : amenity.getName(lang); + res.content = amenity.getDescription(lang); + res.isPartOf = ""; //add to file + res.lat = amenity.getLocation().getLatitude(); + res.lon = amenity.getLocation().getLongitude(); + res.imageTitle = "";//add to file + res.tripId = amenity.getId(); + res.originalId = amenity.getId()>>6; + res.lang = lang; + res.contentsJson = ""; //add to file + res.aggregatedPartOf = ""; //add to file +// try { +// String gpxContent = Algorithms.gzipToString(); + res.gpxFile = null; //GPXUtilities.loadGPXFile(new ByteArrayInputStream(gpxContent.getBytes("UTF-8"))); +// } catch (IOException e) { +// LOG.error(e.getMessage(), e); +// } + + return res; + } + + private BinaryMapIndexReader getBookBinaryIndex() throws IOException { + application.getSettings().SELECTED_TRAVEL_BOOK.set(selectedTravelBook.getName()); + try { + RandomAccessFile r = new RandomAccessFile(selectedTravelBook.getAbsolutePath(), "r"); + BinaryMapIndexReader index = new BinaryMapIndexReader(r, selectedTravelBook); + for (BinaryIndexPart p : index.getIndexes()) { + if (p instanceof BinaryMapPoiReaderAdapter.PoiRegion) { + return index; + } + } + } catch (IOException e) { + System.err.println("File doesn't have valid structure : " + selectedTravelBook.getName() + " " + e.getMessage()); + throw e; + } + return null; + } + + @Override + public LinkedHashMap> getNavigationMap(TravelArticle article) { + return null; + } + + @Override + public TravelArticle getArticle(long cityId, String lang) { + return null; + } + + @Override + public TravelArticle getArticle(String title, String lang) { + return null; + } + + @Override + public long getArticleId(String title, String lang) { + return 0; + } + + @Override + public ArrayList getArticleLangs(long cityId) { + return null; + } + + @Override + public String formatTravelBookName(File tb) { + return null; + } + + @Override + public String getGPXName(TravelArticle article) { + return null; + } + + @Override + public File createGpxFile(TravelArticle article) { + return null; + } +} diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java index bedaa96810..dc4c7bbb8a 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java @@ -29,6 +29,7 @@ import net.osmand.plus.download.DownloadValidationManager; import net.osmand.plus.download.IndexItem; import net.osmand.plus.wikivoyage.data.TravelArticle; import net.osmand.plus.wikivoyage.data.TravelDbHelper; +import net.osmand.plus.wikivoyage.data.TravelHelper; import net.osmand.plus.wikivoyage.data.TravelLocalDataHelper; import net.osmand.plus.wikivoyage.explore.travelcards.ArticleTravelCard; import net.osmand.plus.wikivoyage.explore.travelcards.BaseTravelCard; @@ -92,7 +93,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv super.onResume(); OsmandApplication app = getMyApplication(); if (app != null) { - app.getTravelDbHelper().getLocalDataHelper().addListener(this); + app.getTravelHelper().getLocalDataHelper().addListener(this); } WikivoyageExploreActivity exploreActivity = getExploreActivity(); if (exploreActivity != null) { @@ -105,7 +106,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv super.onPause(); OsmandApplication app = getMyApplication(); if (app != null) { - app.getTravelDbHelper().getLocalDataHelper().removeListener(this); + app.getTravelHelper().getLocalDataHelper().removeListener(this); } } @@ -135,9 +136,9 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv public void downloadHasFinished() { OsmandApplication app = getMyApplication(); if (app != null) { - TravelDbHelper travelDbHelper = app.getTravelDbHelper(); - if (travelDbHelper.getSelectedTravelBook() == null) { - app.getTravelDbHelper().initTravelBooks(); + TravelHelper travelHelper = app.getTravelHelper(); + if (travelHelper.getSelectedTravelBook() == null) { + app.getTravelHelper().initTravelBooks(); WikivoyageExploreActivity exploreActivity = getExploreActivity(); if (exploreActivity != null) { exploreActivity.populateData(); @@ -181,10 +182,10 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv if (!Version.isPaidVersion(app)) { items.add(new OpenBetaTravelCard(app, nightMode, fm)); } - if (app.getTravelDbHelper().getSelectedTravelBook() != null) { + if (app.getTravelHelper().getSelectedTravelBook() != null) { items.add(new HeaderTravelCard(app, nightMode, getString(R.string.popular_destinations))); - List popularArticles = app.getTravelDbHelper().getPopularArticles(); + List popularArticles = app.getTravelHelper().getPopularArticles(); for (TravelArticle article : popularArticles) { items.add(new ArticleTravelCard(app, nightMode, article, fm)); } @@ -238,7 +239,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv boolean outdated = mainIndexItem != null && mainIndexItem.isOutdated(); boolean needsDownloading = mainIndexItem != null && !mainIndexItem.isDownloaded(); - File selectedTravelBook = app.getTravelDbHelper().getSelectedTravelBook(); + File selectedTravelBook = app.getTravelHelper().getSelectedTravelBook(); if (selectedTravelBook == null || needsDownloading || (outdated && SHOW_TRAVEL_UPDATE_CARD)) { boolean showOtherMaps = false; @@ -389,7 +390,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv IndexItem mainItem = app.getDownloadThread().getIndexes().getWikivoyageItem(fileName); List neededItems = new ArrayList<>(); - for (TravelArticle article : app.getTravelDbHelper().getLocalDataHelper().getSavedArticles()) { + for (TravelArticle article : app.getTravelHelper().getLocalDataHelper().getSavedArticles()) { LatLon latLon = new LatLon(article.getLat(), article.getLon()); try { for (DownloadActivityType type : types) { diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesRvAdapter.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesRvAdapter.java index bc8025cba9..6a4864d147 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesRvAdapter.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/SavedArticlesRvAdapter.java @@ -195,7 +195,7 @@ public class SavedArticlesRvAdapter extends RecyclerView.Adapter { private WeakReference activityRef; - private TravelDbHelper travelDbHelper; + private TravelHelper travelHelper; LoadWikivoyageData(WikivoyageExploreActivity activity) { - travelDbHelper = activity.getMyApplication().getTravelDbHelper(); + travelHelper = activity.getMyApplication().getTravelHelper(); activityRef = new WeakReference<>(activity); } @Override protected Void doInBackground(Void... params) { - travelDbHelper.loadDataForSelectedTravelBook(); + travelHelper.loadDataForSelectedTravelBook(); return null; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageOptionsBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageOptionsBottomSheetDialogFragment.java index 988598c359..fe3021ba51 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageOptionsBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageOptionsBottomSheetDialogFragment.java @@ -25,6 +25,7 @@ import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerHalfItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem; import net.osmand.plus.wikivoyage.data.TravelDbHelper; +import net.osmand.plus.wikivoyage.data.TravelHelper; import net.osmand.plus.wikivoyage.data.TravelLocalDataHelper; import java.io.File; @@ -45,13 +46,13 @@ public class WikivoyageOptionsBottomSheetDialogFragment extends MenuBottomSheetD return; } final CommonPreference showImagesPref = app.getSettings().WIKI_ARTICLE_SHOW_IMAGES; - final TravelDbHelper dbHelper = app.getTravelDbHelper(); + final TravelHelper travelHelper = app.getTravelHelper(); items.add(new TitleItem(getString(R.string.shared_string_options))); - if (dbHelper.getExistingTravelBooks().size() > 1) { + if (travelHelper.getExistingTravelBooks().size() > 1) { BaseBottomSheetItem selectTravelBook = new BottomSheetItemWithDescription.Builder() - .setDescription(dbHelper.formatTravelBookName(dbHelper.getSelectedTravelBook())) + .setDescription(travelHelper.formatTravelBookName(travelHelper.getSelectedTravelBook())) .setDescriptionColorId(nightMode ? R.color.wikivoyage_active_dark : R.color.wikivoyage_active_light) .setIcon(getContentIcon(R.drawable.ic_action_travel)) .setTitle(getString(R.string.shared_string_travel_book)) @@ -125,7 +126,7 @@ public class WikivoyageOptionsBottomSheetDialogFragment extends MenuBottomSheetD public void onClick(View v) { OsmandApplication app = getMyApplication(); if (app != null) { - TravelLocalDataHelper ldh = app.getTravelDbHelper().getLocalDataHelper(); + TravelLocalDataHelper ldh = app.getTravelHelper().getLocalDataHelper(); ldh.clearHistory(); } dismiss(); @@ -149,11 +150,11 @@ public class WikivoyageOptionsBottomSheetDialogFragment extends MenuBottomSheetD return; } - final TravelDbHelper dbHelper = app.getTravelDbHelper(); - final List list = dbHelper.getExistingTravelBooks(); + final TravelHelper travelHelper = app.getTravelHelper(); + final List list = travelHelper.getExistingTravelBooks(); String[] ls = new String[list.size()]; for (int i = 0; i < ls.length; i++) { - ls[i] = dbHelper.formatTravelBookName(list.get(i)); + ls[i] = travelHelper.formatTravelBookName(list.get(i)); } new AlertDialog.Builder(ctx) @@ -161,7 +162,7 @@ public class WikivoyageOptionsBottomSheetDialogFragment extends MenuBottomSheetD .setItems(ls, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - dbHelper.selectTravelBook(list.get(which)); + travelHelper.selectTravelBook(list.get(which)); sendResult(TRAVEL_BOOK_CHANGED); } }) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java index 5b782c5757..084209674a 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/ArticleTravelCard.java @@ -91,7 +91,7 @@ public class ArticleTravelCard extends BaseTravelCard { private void updateSaveButton(final ArticleTravelVH holder) { if (article != null) { - final TravelLocalDataHelper helper = app.getTravelDbHelper().getLocalDataHelper(); + final TravelLocalDataHelper helper = app.getTravelHelper().getLocalDataHelper(); final boolean saved = helper.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_bookmark); @@ -103,7 +103,7 @@ public class ArticleTravelCard extends BaseTravelCard { if (saved) { helper.removeArticleFromSaved(article); } else { - app.getTravelDbHelper().createGpxFile(article); + app.getTravelHelper().createGpxFile(article); helper.addArticleToSaved(article); } updateSaveButton(holder); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/menu/WikivoyageWptPtMenuController.java b/OsmAnd/src/net/osmand/plus/wikivoyage/menu/WikivoyageWptPtMenuController.java index 1ea04be8b4..9ad66116cb 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/menu/WikivoyageWptPtMenuController.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/menu/WikivoyageWptPtMenuController.java @@ -42,7 +42,7 @@ public class WikivoyageWptPtMenuController extends WptPtMenuController { String title = metadata != null ? metadata.getArticleTitle() : null; String lang = metadata != null ? metadata.getArticleLang() : null; if (!TextUtils.isEmpty(title) && !TextUtils.isEmpty(lang)) { - return mapActivity.getMyApplication().getTravelDbHelper().getArticle(title, lang); + return mapActivity.getMyApplication().getTravelHelper().getArticle(title, lang); } return null; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchDialogFragment.java index 826d938562..f0aafde679 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchDialogFragment.java @@ -151,7 +151,7 @@ public class WikivoyageSearchDialogFragment extends WikiBaseDialogFragment { private void setAdapterItems(@Nullable List items) { if (items == null || items.isEmpty()) { - TravelLocalDataHelper ldh = getMyApplication().getTravelDbHelper().getLocalDataHelper(); + TravelLocalDataHelper ldh = getMyApplication().getTravelHelper().getLocalDataHelper(); adapter.setHistoryItems(ldh.getAllHistory()); } else { adapter.setItems(items); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchHelper.java index 147cfbd91e..e25feedfc1 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchHelper.java @@ -42,7 +42,7 @@ public class WikivoyageSearchHelper { } if (!isCancelled()) { - List results = application.getTravelDbHelper().search(query); + List results = application.getTravelHelper().search(query); if (!isCancelled()) { rm.publish(results); } From df3c7f5ab5d1c8f6cd4fc7f903d1d3391af1b4ef Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Mon, 23 Nov 2020 12:48:09 +0200 Subject: [PATCH 02/66] Wikivoyage to OBF migration: Work in progress 2. --- .../src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 28b3f6f062..6c41e39cff 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -198,7 +198,9 @@ public class TravelObfHelper implements TravelHelper{ Iterator it = articles.iterator(); while (it.hasNext()) { Amenity a = it.next(); - popularArticles.add(readArticle(a, language)); + if (!a.getName(language).equals("")) { + popularArticles.add(readArticle(a, language)); + } } } } catch (Exception e) { From 658b675b9b75e68dd242621a072c8fbb98e1e584 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 24 Nov 2020 14:59:30 +0200 Subject: [PATCH 03/66] add upload photo error handing --- .../plus/mapcontextmenu/MenuBuilder.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index bfd21f5abb..d441c73d8f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -6,11 +6,7 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.res.ColorStateList; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Color; -import android.graphics.PorterDuff; -import android.graphics.Typeface; +import android.graphics.*; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.net.Uri; @@ -28,14 +24,12 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; - import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.view.ContextThemeWrapper; import androidx.core.content.ContextCompat; import androidx.core.graphics.drawable.DrawableCompat; - import net.osmand.AndroidUtils; import net.osmand.PlatformUtil; import net.osmand.data.Amenity; @@ -43,11 +37,7 @@ import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.QuadRect; import net.osmand.osm.io.NetworkUtils; -import net.osmand.plus.OsmAndFormatter; -import net.osmand.plus.OsmandApplication; -import net.osmand.plus.OsmandPlugin; -import net.osmand.plus.R; -import net.osmand.plus.UiUtilities; +import net.osmand.plus.*; import net.osmand.plus.activities.ActivityResultListener; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.helpers.FontCache; @@ -70,7 +60,6 @@ import net.osmand.plus.widgets.TextViewEx; import net.osmand.plus.widgets.tools.ClickableSpanTouchListener; import net.osmand.util.Algorithms; import net.osmand.util.MapUtils; - import org.apache.commons.logging.Log; import org.openplacereviews.opendb.util.exception.FailedVerificationException; @@ -78,13 +67,7 @@ import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import static net.osmand.plus.mapcontextmenu.builders.cards.ImageCard.GetImageCardsTask.GetImageCardsListener; @@ -490,18 +473,35 @@ public class MenuBuilder { response); } catch (FailedVerificationException e) { LOG.error(e); - app.showToastMessage(R.string.cannot_upload_image); + checkTokenAndShowScreen(); } if (res != 200) { //image was uploaded but not added to blockchain - app.showToastMessage(R.string.cannot_upload_image); + checkTokenAndShowScreen(); } else { app.showToastMessage(R.string.successfully_uploaded_pattern, 1, 1); //refresh the image execute(new GetImageCardsTask(mapActivity, getLatLon(), getAdditionalCardParams(), imageCardListener)); } } else { + checkTokenAndShowScreen(); + } + } + + //This method runs on non main thread + private void checkTokenAndShowScreen() { + final String baseUrl = OPRWebviewActivity.getBaseUrl(app); + final String name = OPRWebviewActivity.getUsernameFromCookie(app); + final String privateKey = OPRWebviewActivity.getPrivateKeyFromCookie(app); + if (openDBAPI.checkPrivateKeyValid(baseUrl, name, privateKey)) { app.showToastMessage(R.string.cannot_upload_image); + } else { + app.runInUIThread(new Runnable() { + @Override + public void run() { + OprStartFragment.showInstance(mapActivity.getSupportFragmentManager()); + } + }); } } From e845d901ce134f300e7c99c5cc48d8bbd6fc684c Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 25 Nov 2020 18:10:40 +0200 Subject: [PATCH 04/66] local error handling fix added --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index a7b450841d..dc41b8c912 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -6,7 +6,6 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.res.ColorStateList; -import android.graphics.*; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; @@ -435,6 +434,8 @@ public class MenuBuilder { } } catch (Exception e) { LOG.error(e); + String str = app.getString(R.string.cannot_upload_image); + app.showToastMessage(str); } finally { Algorithms.closeStream(inputStream); } From 1c1777cd6e6ce571488a2bd513810a73ad2dd152 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 25 Nov 2020 18:59:40 +0200 Subject: [PATCH 05/66] cleanup --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index dc41b8c912..2dba9c0267 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -430,7 +430,7 @@ public class MenuBuilder { try { inputStream = app.getContentResolver().openInputStream(uri); if (inputStream != null) { - uploadImageToPlace(view, inputStream); + uploadImageToPlace(inputStream); } } catch (Exception e) { LOG.error(e); @@ -444,7 +444,7 @@ public class MenuBuilder { t.start(); } - private void uploadImageToPlace(View view, InputStream image) { + private void uploadImageToPlace(InputStream image) { InputStream serverData = new ByteArrayInputStream(compressImage(image)); final String baseUrl = OPRWebviewActivity.getBaseUrl(app); String url = baseUrl + "api/ipfs/image"; From dc45501c747c5bf2bb74a25e9bd0b932700e1f53 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 25 Nov 2020 19:02:52 +0200 Subject: [PATCH 06/66] Small Ui fixes --- .../res/layout/enough_space_warning_card.xml | 1 + OsmAnd/res/layout/fragment_import.xml | 1 + .../layout/profile_data_list_item_group.xml | 10 ++-- OsmAnd/res/values/sizes.xml | 1 + OsmAnd/res/values/strings.xml | 1 + .../settings/backend/ExportSettingsType.java | 7 ++- .../backend/backup/SettingsHelper.java | 8 +-- .../fragments/BaseSettingsListFragment.java | 40 +++++++++++-- .../fragments/ExportItemsBottomSheet.java | 60 ++++++++++++++++++- .../fragments/ExportSettingsAdapter.java | 13 ++-- .../fragments/ExportSettingsFragment.java | 8 --- .../fragments/ImportSettingsFragment.java | 7 --- 12 files changed, 119 insertions(+), 38 deletions(-) diff --git a/OsmAnd/res/layout/enough_space_warning_card.xml b/OsmAnd/res/layout/enough_space_warning_card.xml index a39076eb99..d572d20366 100644 --- a/OsmAnd/res/layout/enough_space_warning_card.xml +++ b/OsmAnd/res/layout/enough_space_warning_card.xml @@ -36,6 +36,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:letterSpacing="@dimen/text_button_letter_spacing" + android:paddingBottom="@dimen/measurement_tool_menu_title_padding_bottom" android:text="@string/export_not_enough_space" android:textColor="?android:textColorPrimary" android:textSize="@dimen/default_list_text_size" diff --git a/OsmAnd/res/layout/fragment_import.xml b/OsmAnd/res/layout/fragment_import.xml index 30f518cbfc..2088d2624a 100644 --- a/OsmAnd/res/layout/fragment_import.xml +++ b/OsmAnd/res/layout/fragment_import.xml @@ -82,6 +82,7 @@ android:layout_height="match_parent" /> diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml index c1addc1349..f91581adf6 100644 --- a/OsmAnd/res/values/sizes.xml +++ b/OsmAnd/res/values/sizes.xml @@ -397,6 +397,7 @@ 42dp 128dp 164dp + 68dp 6dp 12dp diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 72fb10e393..9da2ac6d86 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,6 +11,7 @@ Thx - Hardy --> + %1$s * %2$s OsmAnd shows photos from several sources:\nOpenPlaceReviews - POI photos;\nMapillary - street-level imagery;\nWeb / Wikimedia - POI photos specified in OpenStreetMap data. Use dev.openstreetmap.org Switch to use "dev.openstreetmap.org" instead of "openstreetmap.org" to testing uploading OSM Note / POI / GPX. diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java index bf86c42ee6..13135c0821 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java @@ -10,7 +10,6 @@ public enum ExportSettingsType { GLOBAL(R.string.general_settings_2, R.drawable.ic_action_settings), QUICK_ACTIONS(R.string.configure_screen_quick_action, R.drawable.ic_quick_action), POI_TYPES(R.string.poi_dialog_poi_type, R.drawable.ic_action_info_dark), - SEARCH_HISTORY(R.string.shared_string_search_history, R.drawable.ic_action_history), AVOID_ROADS(R.string.avoid_road, R.drawable.ic_action_alert), FAVORITES(R.string.shared_string_favorites, R.drawable.ic_action_favorite), TRACKS(R.string.shared_string_tracks, R.drawable.ic_action_route_distance), @@ -19,6 +18,7 @@ public enum ExportSettingsType { MULTIMEDIA_NOTES(R.string.audionotes_plugin_name, R.drawable.ic_grouped_by_type), ACTIVE_MARKERS(R.string.map_markers, R.drawable.ic_action_flag), HISTORY_MARKERS(R.string.markers_history, R.drawable.ic_action_flag), + SEARCH_HISTORY(R.string.shared_string_search_history, R.drawable.ic_action_history), CUSTOM_RENDER_STYLE(R.string.shared_string_rendering_style, R.drawable.ic_action_map_style), CUSTOM_ROUTING(R.string.shared_string_routing, R.drawable.ic_action_route_distance), MAP_SOURCES(R.string.quick_action_map_source_title, R.drawable.ic_map), @@ -48,12 +48,13 @@ public enum ExportSettingsType { public boolean isSettingsCategory() { return this == PROFILE || this == GLOBAL || this == QUICK_ACTIONS || this == POI_TYPES - || this == SEARCH_HISTORY || this == AVOID_ROADS; + || this == AVOID_ROADS; } public boolean isMyPlacesCategory() { return this == FAVORITES || this == TRACKS || this == OSM_EDITS || this == OSM_NOTES - || this == MULTIMEDIA_NOTES || this == ACTIVE_MARKERS || this == HISTORY_MARKERS; + || this == MULTIMEDIA_NOTES || this == ACTIVE_MARKERS || this == HISTORY_MARKERS + || this == SEARCH_HISTORY; } public boolean isResourcesCategory() { diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java index 4553cf805f..b6b7f6e5b5 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -539,10 +539,6 @@ public class SettingsHelper { if (!poiList.isEmpty()) { settingsItems.put(ExportSettingsType.POI_TYPES, poiList); } - List historyEntries = SearchHistoryHelper.getInstance(app).getHistoryEntries(false); - if (!historyEntries.isEmpty()) { - settingsItems.put(ExportSettingsType.SEARCH_HISTORY, historyEntries); - } Map impassableRoads = app.getAvoidSpecificRoads().getImpassableRoads(); if (!impassableRoads.isEmpty()) { settingsItems.put(ExportSettingsType.AVOID_ROADS, new ArrayList<>(impassableRoads.values())); @@ -611,6 +607,10 @@ public class SettingsHelper { markersGroup.setMarkers(markersHistory); myPlacesItems.put(ExportSettingsType.HISTORY_MARKERS, Collections.singletonList(markersGroup)); } + List historyEntries = SearchHistoryHelper.getInstance(app).getHistoryEntries(false); + if (!historyEntries.isEmpty()) { + myPlacesItems.put(ExportSettingsType.SEARCH_HISTORY, historyEntries); + } return myPlacesItems; } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsListFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsListFragment.java index d95b6cffea..912c189991 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsListFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsListFragment.java @@ -11,6 +11,7 @@ import android.view.ViewTreeObserver; import android.widget.ExpandableListView; import android.widget.LinearLayout; +import androidx.activity.OnBackPressedCallback; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; @@ -31,6 +32,7 @@ import net.osmand.plus.settings.backend.ExportSettingsCategory; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.fragments.ExportSettingsAdapter.OnItemSelectedListener; import net.osmand.plus.widgets.TextViewEx; +import net.osmand.util.Algorithms; import java.io.File; import java.util.ArrayList; @@ -73,6 +75,17 @@ public abstract class BaseSettingsListFragment extends BaseOsmAndFragment implem super.onCreate(savedInstanceState); app = requireMyApplication(); nightMode = !app.getSettings().isLightContent(); + + requireActivity().getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) { + @Override + public void handleOnBackPressed() { + if (!hasSelectedData()) { + dismissFragment(); + } else { + showExitDialog(); + } + } + }); } @Nullable @@ -101,10 +114,14 @@ public abstract class BaseSettingsListFragment extends BaseOsmAndFragment implem continueBtn = root.findViewById(R.id.continue_button); UiUtilities.setupDialogButton(nightMode, continueBtn, DialogButtonType.PRIMARY, getString(R.string.shared_string_continue)); - continueBtn.setOnClickListener(new View.OnClickListener() { + root.findViewById(R.id.continue_button_container).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - onContinueButtonClickAction(); + if (expandableList.getHeaderViewsCount() >= 2) { + onContinueButtonClickAction(); + } else { + expandableList.smoothScrollToPositionFromTop(0, 0, 100); + } } }); @@ -185,7 +202,11 @@ public abstract class BaseSettingsListFragment extends BaseOsmAndFragment implem toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - showExitDialog(); + if (!hasSelectedData()) { + dismissFragment(); + } else { + showExitDialog(); + } } }); } @@ -204,16 +225,25 @@ public abstract class BaseSettingsListFragment extends BaseOsmAndFragment implem continueBtn.setEnabled(false); } else { updateWarningHeaderVisibility(false); - continueBtn.setEnabled(adapter.hasSelectedData()); + continueBtn.setEnabled(hasSelectedData()); } itemsSizeContainer.setVisibility(View.VISIBLE); } else { updateWarningHeaderVisibility(false); itemsSizeContainer.setVisibility(View.INVISIBLE); - continueBtn.setEnabled(adapter.hasSelectedData()); + continueBtn.setEnabled(hasSelectedData()); } } + public boolean hasSelectedData() { + for (List items : selectedItemsMap.values()) { + if (!Algorithms.isEmpty(items)) { + return true; + } + } + return false; + } + private void updateWarningHeaderVisibility(boolean visible) { if (visible) { if (expandableList.getHeaderViewsCount() < 2) { diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java index 8c62e04ccf..49dd920841 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java @@ -153,7 +153,30 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { int checkBoxColor = checkBox.getState() == UNCHECKED ? secondaryColorRes : activeColorRes; CompoundButtonCompat.setButtonTintList(checkBox, ColorStateList.valueOf(ContextCompat.getColor(app, checkBoxColor))); - selectedSize.setText(getString(R.string.ltr_or_rtl_combine_via_slash, selectedItems.size(), allItems.size())); + String description; + if (type == ExportSettingsType.OFFLINE_MAPS && !selectedItems.isEmpty()) { + String size = AndroidUtils.formatSize(app, calculateSelectedItemsSize()); + String selected = getString(R.string.ltr_or_rtl_combine_via_slash, selectedItems.size(), allItems.size()); + description = getString(R.string.ltr_or_rtl_combine_via_comma, selected, size); + } else { + description = getString(R.string.ltr_or_rtl_combine_via_slash, selectedItems.size(), allItems.size()); + } + selectedSize.setText(description); + } + + private long calculateSelectedItemsSize() { + long itemsSize = 0; + for (int i = 0; i < allItems.size(); i++) { + Object object = allItems.get(i); + if (selectedItems.contains(object)) { + if (object instanceof FileSettingsItem) { + itemsSize += ((FileSettingsItem) object).getSize(); + } else if (object instanceof File) { + itemsSize += ((File) object).length(); + } + } + } + return itemsSize; } private void updateItems(boolean checked) { @@ -275,6 +298,10 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { builder.setTitle(group.getDisplayName(app)); int color = group.getColor() == 0 ? ContextCompat.getColor(app, R.color.color_favorite) : group.getColor(); builder.setIcon(uiUtilities.getPaintedIcon(R.drawable.ic_action_folder, color)); + + int points = group.getPoints().size(); + String itemsDescr = app.getString(R.string.shared_string_gpx_points); + builder.setDescription(getString(R.string.ltr_or_rtl_combine_via_colon, itemsDescr, points)); } else if (object instanceof GlobalSettingsItem) { GlobalSettingsItem globalSettingsItem = (GlobalSettingsItem) object; builder.setTitle(globalSettingsItem.getPublicName(app)); @@ -285,9 +312,12 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { builder.setTitle(getString(R.string.map_markers)); builder.setIcon(uiUtilities.getIcon(R.drawable.ic_action_flag, activeColorRes)); } else if (ExportSettingsType.HISTORY_MARKERS.name().equals(markersGroup.getId())) { - builder.setTitle(getString(R.string.map_markers)); + builder.setTitle(getString(R.string.markers_history)); builder.setIcon(uiUtilities.getIcon(R.drawable.ic_action_history, activeColorRes)); } + int selectedMarkers = markersGroup.getMarkers().size(); + String itemsDescr = app.getString(R.string.shared_string_items); + builder.setDescription(getString(R.string.ltr_or_rtl_combine_via_colon, itemsDescr, selectedMarkers)); } else if (object instanceof HistoryEntry) { HistoryEntry historyEntry = (HistoryEntry) object; builder.setTitle(historyEntry.getName().getName()); @@ -305,6 +335,7 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { } else if (file.getAbsolutePath().contains(IndexConstants.GPX_INDEX_DIR)) { builder.setTitle(GpxUiHelper.getGpxTitle(file.getName())); builder.setIcon(uiUtilities.getIcon(R.drawable.ic_action_route_distance, activeColorRes)); + builder.setDescription(file.getParentFile().getName()); } else if (file.getAbsolutePath().contains(IndexConstants.AV_INDEX_DIR)) { int iconId = AudioVideoNotesPlugin.getIconIdForRecordingFile(file); if (iconId == -1) { @@ -316,6 +347,31 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { || fileSubtype == FileSettingsItem.FileSubtype.VOICE) { builder.setTitle(FileNameTranslationHelper.getFileNameWithRegion(app, file.getName())); builder.setIcon(uiUtilities.getIcon(fileSubtype.getIconId(), activeColorRes)); + + if (fileSubtype.isMap()) { + String mapDescription = getMapDescription(file); + String size = AndroidUtils.formatSize(app, file.length()); + if (mapDescription != null) { + builder.setDescription(getString(R.string.ltr_or_rtl_combine_via_star, mapDescription, size)); + } else { + builder.setDescription(size); + } + } } } + + private String getMapDescription(File file) { + if (file.isDirectory() || file.getName().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT)) { + return getString(R.string.online_map); + } else if (file.getName().endsWith(IndexConstants.BINARY_ROAD_MAP_INDEX_EXT)) { + return getString(R.string.download_roads_only_item); + } else if (file.getName().endsWith(IndexConstants.BINARY_WIKI_MAP_INDEX_EXT)) { + return getString(R.string.download_wikipedia_maps); + } else if (file.getName().endsWith(IndexConstants.BINARY_SRTM_MAP_INDEX_EXT)) { + return getString(R.string.download_srtm_maps); + } else if (file.getName().endsWith(IndexConstants.BINARY_MAP_INDEX_EXT)) { + return getString(R.string.download_regular_maps); + } + return null; + } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java index d479b78a7c..edd6419c74 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java @@ -18,6 +18,7 @@ import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.OsmandBaseExpandableListAdapter; import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.FontCache; +import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.settings.backend.ExportSettingsCategory; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.backend.backup.FileSettingsItem; @@ -70,6 +71,8 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { View group = convertView; if (group == null) { group = themedInflater.inflate(R.layout.profile_data_list_item_group, parent, false); + int minHeight = app.getResources().getDimensionPixelSize(R.dimen.setting_list_item_group_height); + group.findViewById(R.id.item_container).setMinimumHeight(minHeight); } final ExportSettingsCategory category = itemsTypes.get(groupPosition); final SettingsCategoryItems items = itemsMap.get(category); @@ -122,6 +125,8 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { View child = convertView; if (child == null) { child = themedInflater.inflate(R.layout.profile_data_list_item_group, parent, false); + int minHeight = app.getResources().getDimensionPixelSize(R.dimen.setting_list_item_large_height); + child.findViewById(R.id.item_container).setMinimumHeight(minHeight); } final ExportSettingsCategory category = itemsTypes.get(groupPosition); final SettingsCategoryItems categoryItems = itemsMap.get(category); @@ -247,10 +252,6 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { notifyDataSetChanged(); } - public boolean hasSelectedData() { - return !selectedItemsMap.isEmpty(); - } - public List getData() { List selectedItems = new ArrayList<>(); for (List items : selectedItemsMap.values()) { @@ -307,6 +308,10 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { itemsSize += ((FileSettingsItem) object).getSize(); } else if (object instanceof File) { itemsSize += ((File) object).length(); + } else if (object instanceof MapMarkersGroup) { + int selectedMarkers = ((MapMarkersGroup) object).getMarkers().size(); + String itemsDescr = app.getString(R.string.shared_string_items); + return app.getString(R.string.ltr_or_rtl_combine_via_colon, itemsDescr, selectedMarkers); } } } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java index f831fd8fdd..c46168ec67 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java @@ -11,7 +11,6 @@ import android.view.ViewGroup; import android.widget.TextView; import android.widget.Toast; -import androidx.activity.OnBackPressedCallback; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.FragmentActivity; @@ -77,13 +76,6 @@ public class ExportSettingsFragment extends BaseSettingsListFragment { progressValue = savedInstanceState.getInt(PROGRESS_VALUE_KEY); } dataList = app.getSettingsHelper().getAdditionalData(globalExport); - - requireActivity().getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) { - @Override - public void handleOnBackPressed() { - showExitDialog(); - } - }); } @Nullable diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java index bb629308b9..f078d1c34b 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java @@ -12,7 +12,6 @@ import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; -import androidx.activity.OnBackPressedCallback; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.FragmentManager; @@ -102,12 +101,6 @@ public class ImportSettingsFragment extends BaseSettingsListFragment { duplicateStartTime = savedInstanceState.getLong(DUPLICATES_START_TIME_KEY); } settingsHelper = app.getSettingsHelper(); - requireActivity().getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) { - @Override - public void handleOnBackPressed() { - showExitDialog(); - } - }); ImportAsyncTask importTask = settingsHelper.getImportTask(); if (importTask != null) { From 92753fcdbc537a00b744707eee14f421fb60867c Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Wed, 25 Nov 2020 19:14:27 +0200 Subject: [PATCH 07/66] UI: Add sorting to Add to Track dialog / Follow Remove the sort button when track is selected Remove shadow below the title bar Shadow above buttons --- OsmAnd/res/layout/follow_track_options.xml | 1 - .../osmand/plus/routepreparationmenu/FollowTrackFragment.java | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/layout/follow_track_options.xml b/OsmAnd/res/layout/follow_track_options.xml index 0877fcc307..4523599e6c 100644 --- a/OsmAnd/res/layout/follow_track_options.xml +++ b/OsmAnd/res/layout/follow_track_options.xml @@ -75,7 +75,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="?attr/route_info_bg" - android:foreground="@drawable/bg_contextmenu_shadow" android:foregroundGravity="top|fill_horizontal"> points = gpxFile.getRoutePoints(); From fa2bb207bb3f5d1b9dc1a45e9e406890c1bf8db6 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Thu, 26 Nov 2020 00:11:45 +0200 Subject: [PATCH 08/66] Remove the sort button when track is selected. --- .../osmand/plus/routepreparationmenu/FollowTrackFragment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java index 0a78a631c1..2214e2052d 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java @@ -156,6 +156,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca if (view != null) { ImageButton closeButton = view.findViewById(R.id.close_button); buttonsShadow = view.findViewById(R.id.buttons_shadow); + sortButton = view.findViewById(R.id.sort_button); closeButton.setImageDrawable(getContentIcon(AndroidUtils.getNavigationIconResId(app))); closeButton.setOnClickListener(new View.OnClickListener() { @Override @@ -219,6 +220,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca if (Algorithms.isEmpty(fileName)) { fileName = app.getString(R.string.shared_string_gpx_track); } + sortButton.setVisibility(View.GONE); GPXInfo gpxInfo = new GPXInfo(fileName, file != null ? file.lastModified() : 0, file != null ? file.length() : 0); TrackEditCard importTrackCard = new TrackEditCard(mapActivity, gpxInfo); importTrackCard.setListener(this); @@ -268,6 +270,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca tracksCard = new TracksToFollowCard(mapActivity, list, defaultCategory); tracksCard.setListener(FollowTrackFragment.this); getCardsContainer().addView(tracksCard.build(mapActivity)); + sortButton.setVisibility(View.VISIBLE); } } } From c951837c34c2dcede622bdc9e7e2af1b9700c7f9 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Thu, 26 Nov 2020 00:35:53 +0200 Subject: [PATCH 09/66] Remove unnecessary visible --- .../osmand/plus/routepreparationmenu/FollowTrackFragment.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java index 2214e2052d..7730010808 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java @@ -508,8 +508,6 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca private void selectTrackToFollow(GPXFile gpxFile) { MapActivity mapActivity = getMapActivity(); - final ImageButton sortButton = getView().findViewById(R.id.sort_button); - sortButton.setVisibility(View.GONE); if (mapActivity != null) { this.gpxFile = gpxFile; List points = gpxFile.getRoutePoints(); From e1ef1b096c780267afc7fdc639fe4d704434b229 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 26 Nov 2020 02:27:48 +0200 Subject: [PATCH 10/66] Fix #10216 --- .../plus/audionotes/AudioVideoNotesPlugin.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index e1317fb630..c42e4de8aa 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -930,11 +930,21 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { stopRecording(activity, false); } + @Override + public void mapActivityResume(MapActivity activity) { + this.mapActivity = activity; + if (Build.VERSION.SDK_INT < 29) { + runAction(activity); + } + } + @Override public void mapActivityResumeOnTop(MapActivity activity) { this.mapActivity = activity; -// ((AudioManager) activity.getSystemService(Context.AUDIO_SERVICE)).registerMediaButtonEventReceiver( -// new ComponentName(activity, MediaRemoteControlReceiver.class)); + runAction(activity); + } + + private void runAction(MapActivity activity) { if (runAction != -1) { takeAction(activity, actionLon, actionLat, runAction); runAction = -1; From 139da94143d2e04683a8803bd69458871b37c01a Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 26 Nov 2020 11:42:35 +0200 Subject: [PATCH 11/66] add user-agent string --- .../net/osmand/plus/openplacereviews/OPRWebviewActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java b/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java index 14fd181f54..9acdd06729 100644 --- a/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java +++ b/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java @@ -24,6 +24,7 @@ import net.osmand.plus.settings.backend.OsmandSettings; public class OPRWebviewActivity extends OsmandActionBarActivity { public static final String KEY_LOGIN = "LOGIN_KEY"; public static String KEY_TITLE = "TITLE_KEY"; + private static String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"; private WebView webView; private boolean isLogin = false; @@ -76,6 +77,7 @@ public class OPRWebviewActivity extends OsmandActionBarActivity { } }); webView = findViewById(R.id.printDialogWebview); + webView.getSettings().setUserAgentString(USER_AGENT); webView.setWebViewClient(new CloseOnSuccessWebViewClient()); webView.getSettings().setJavaScriptEnabled(true); WebView.setWebContentsDebuggingEnabled(true); From b0203d86f518b59b4e5317a492d7bf3dae259f6c Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 26 Nov 2020 13:53:28 +0200 Subject: [PATCH 12/66] google oauth fixed --- .../openplacereviews/OPRWebviewActivity.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java b/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java index 9acdd06729..6e81d4306e 100644 --- a/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java +++ b/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java @@ -21,10 +21,13 @@ import net.osmand.plus.R; import net.osmand.plus.activities.OsmandActionBarActivity; import net.osmand.plus.settings.backend.OsmandSettings; +import java.util.ArrayList; +import java.util.List; + public class OPRWebviewActivity extends OsmandActionBarActivity { public static final String KEY_LOGIN = "LOGIN_KEY"; public static String KEY_TITLE = "TITLE_KEY"; - private static String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"; + private static String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko)"; private WebView webView; private boolean isLogin = false; @@ -44,8 +47,13 @@ public class OPRWebviewActivity extends OsmandActionBarActivity { return getBaseUrl(ctx) + "signup"; } - public static String getFinishUrl(Context ctx) { - return getCookieUrl(ctx); + public static List getFinishUrls(Context ctx) { + String googleOAuthFinishUrl = getBaseUrl(ctx) + "auth?code=4"; + String profileUrl = getCookieUrl(ctx); + List urls = new ArrayList<>(); + urls.add(googleOAuthFinishUrl); + urls.add(profileUrl); + return urls; } public void onCreate(Bundle savedInstanceState) { @@ -126,8 +134,10 @@ public class OPRWebviewActivity extends OsmandActionBarActivity { public class CloseOnSuccessWebViewClient extends WebViewClient { @Override public void onPageFinished(WebView view, String url) { - if (url.contains(getFinishUrl(OPRWebviewActivity.this)) && isLogin) { - finish(); + for (String furl : getFinishUrls(OPRWebviewActivity.this)){ + if (url.contains(furl) && isLogin) { + finish(); + } } super.onPageFinished(view, url); } From 0378348a720dfda322f0ce87d17798c153939e93 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 26 Nov 2020 13:53:50 +0200 Subject: [PATCH 13/66] google oauth fixed --- .../net/osmand/plus/openplacereviews/OPRWebviewActivity.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java b/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java index 6e81d4306e..759ac56e35 100644 --- a/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java +++ b/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java @@ -11,10 +11,8 @@ import android.webkit.CookieManager; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.TextView; - import androidx.appcompat.widget.Toolbar; import androidx.core.content.ContextCompat; - import net.osmand.AndroidUtils; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; @@ -134,7 +132,7 @@ public class OPRWebviewActivity extends OsmandActionBarActivity { public class CloseOnSuccessWebViewClient extends WebViewClient { @Override public void onPageFinished(WebView view, String url) { - for (String furl : getFinishUrls(OPRWebviewActivity.this)){ + for (String furl : getFinishUrls(OPRWebviewActivity.this)) { if (url.contains(furl) && isLogin) { finish(); } From 3ff52b7ae28286dabd23b55f24cf298914f43c18 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 26 Nov 2020 13:55:26 +0200 Subject: [PATCH 14/66] improvements --- .../net/osmand/plus/openplacereviews/OPRWebviewActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java b/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java index 759ac56e35..62e030ecca 100644 --- a/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java +++ b/OsmAnd/src/net/osmand/plus/openplacereviews/OPRWebviewActivity.java @@ -24,8 +24,8 @@ import java.util.List; public class OPRWebviewActivity extends OsmandActionBarActivity { public static final String KEY_LOGIN = "LOGIN_KEY"; - public static String KEY_TITLE = "TITLE_KEY"; - private static String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko)"; + public static final String KEY_TITLE = "TITLE_KEY"; + private static final String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko)"; private WebView webView; private boolean isLogin = false; From 5700c80108affa710be087466e996d97a6a00df8 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 26 Nov 2020 12:17:31 +0000 Subject: [PATCH 15/66] Translated using Weblate (Russian) Currently translated at 99.8% (3566 of 3570 strings) --- OsmAnd/res/values-ru/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index d7ac847575..1ae090253b 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3991,4 +3991,5 @@ Фотографии предоставлены проектом открытых данных OpenPlaceReviews.org. Чтобы отправить свои фотографии, необходимо зарегистрироваться на сайте. Невозможно отправить изображение, попробуйте позже Выбор изображения + Каяк \ No newline at end of file From 74bbeaeeea6a2bd92bf49cb0d785c4d8d392ac9f Mon Sep 17 00:00:00 2001 From: abdullah abdulrhman Date: Thu, 26 Nov 2020 11:15:38 +0000 Subject: [PATCH 16/66] Translated using Weblate (Arabic) Currently translated at 92.7% (3582 of 3860 strings) --- OsmAnd/res/values-ar/phrases.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values-ar/phrases.xml b/OsmAnd/res/values-ar/phrases.xml index a1560af76a..bc5277a310 100644 --- a/OsmAnd/res/values-ar/phrases.xml +++ b/OsmAnd/res/values-ar/phrases.xml @@ -117,7 +117,7 @@ شرطة نوع العمل الفني : نافورة نجار - سباك + سباكة معرض سيارات ورشة تصليح السيارات خراطيش الطابعة @@ -702,7 +702,7 @@ تجميل الاظافر صالون تدليك صالون وشم - التنظيف الجاف + مغسلة ملابس غسيل الملابس تأجير سيارات مشاركة السيارات @@ -1369,7 +1369,7 @@ طب الأطفال الاجتماعي طب التوليد (القيصرية) طب الإدمان - بصريات + نظارات/بصريات علاج النطق الطب الرياضي الوخز بالإبر @@ -1739,7 +1739,7 @@ جصاص طبقة الباركيه دهان - أخصائي بصريات + محل نظارات/بصريات حرفة الصناعات المعدنية ناسخ مفاتيح صانع ومصلح المفاتيح @@ -2116,7 +2116,7 @@ سهل مقياس RTSA متضرره من الرياح - فيضة/شجيرات ربيعية + فيضة/روضة براح مستوى العبور معبر خط القطار From 0d30be81ac1541ce845c2ebca7af75cf218b6dc1 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 26 Nov 2020 12:26:11 +0000 Subject: [PATCH 17/66] Translated using Weblate (Russian) Currently translated at 99.8% (3856 of 3860 strings) --- OsmAnd/res/values-ru/phrases.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index 66cbcb543b..fb1dc5e65d 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3838,4 +3838,30 @@ Радиолокационная вышка Придорожная стоянка На крыше + Нет + Да + Нет + Да + Нет + Да + Представительство + Офис + Почетный консул + Генеральное консульство + Консульский офис + Во главе с консулом + Резиденция + Нунциатура + Миссия + Верховный комиссариат + Делегация + Филиал + Во главе с послом + Связь + Посольство + Гражданские услуги + Иммиграционные визы + Неиммиграционные визы + Связь + Посольство \ No newline at end of file From 64cd40bf75939be07ace7714690041cbefb2bd10 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 26 Nov 2020 15:40:15 +0200 Subject: [PATCH 18/66] Fix #10257 --- .../builders/AmenityMenuBuilder.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index 29fb2e578d..12b1b0d497 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -48,7 +48,9 @@ import net.osmand.util.OpeningHoursParser; import org.apache.commons.logging.Log; +import java.io.UnsupportedEncodingException; import java.math.RoundingMode; +import java.net.URLDecoder; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.ArrayList; @@ -784,20 +786,29 @@ public class AmenityMenuBuilder extends MenuBuilder { String wikidataValue = amenity.getAdditionalInfo(Amenity.WIKIDATA); String wikimediaValue = amenity.getAdditionalInfo(Amenity.WIKIMEDIA_COMMONS); if (!Algorithms.isEmpty(imageValue)) { - params.put("osm_image", imageValue); + params.put("osm_image", getDecodedAdditionalInfo(imageValue)); } if (!Algorithms.isEmpty(mapillaryValue)) { - params.put("osm_mapillary_key", mapillaryValue); + params.put("osm_mapillary_key", getDecodedAdditionalInfo(mapillaryValue)); } if (!Algorithms.isEmpty(wikidataValue)) { - params.put(Amenity.WIKIDATA, wikidataValue); + params.put(Amenity.WIKIDATA, getDecodedAdditionalInfo(wikidataValue)); } if (!Algorithms.isEmpty(wikimediaValue)) { - params.put(Amenity.WIKIMEDIA_COMMONS, wikimediaValue); + params.put(Amenity.WIKIMEDIA_COMMONS, getDecodedAdditionalInfo(wikimediaValue)); } return params; } + private String getDecodedAdditionalInfo(String additionalInfo) { + try { + return URLDecoder.decode(additionalInfo, "UTF-8"); + } catch (UnsupportedEncodingException e) { + LOG.error(e); + } + return additionalInfo; + } + private CollapsableView getPoiTypeCollapsableView(final Context context, boolean collapsed, @NonNull final List categoryTypes, final boolean poiAdditional, AmenityInfoRow textRow) { From 7141ccd96b63d7a3891bea17dfe4bc37abfa5e78 Mon Sep 17 00:00:00 2001 From: PaulStets Date: Thu, 26 Nov 2020 17:20:56 +0200 Subject: [PATCH 19/66] Fix avoid road import --- .../plus/helpers/AvoidSpecificRoads.java | 4 +- .../backup/AvoidRoadsSettingsItem.java | 40 +++++++++---------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java index ccd166818a..22e0607c7f 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java +++ b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java @@ -417,7 +417,9 @@ public class AvoidSpecificRoads { AvoidRoadInfo other = (AvoidRoadInfo) obj; return Math.abs(latitude - other.latitude) < 0.00001 && Math.abs(longitude - other.longitude) < 0.00001 - && Algorithms.objectEquals(name, other.name); + && Algorithms.objectEquals(name, other.name) + && Algorithms.objectEquals(appModeKey, other.appModeKey) + && id == other.id; } } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java index 61b5f28541..09505e6b4a 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java @@ -68,13 +68,9 @@ public class AvoidRoadsSettingsItem extends CollectionSettingsItem(newItems); for (AvoidSpecificRoads.AvoidRoadInfo duplicate : duplicateItems) { - if (shouldReplace) { - LatLon latLon = new LatLon(duplicate.latitude, duplicate.longitude); - if (settings.removeImpassableRoad(latLon)) { - settings.addImpassableRoad(duplicate); - } - } else { - settings.addImpassableRoad(renameItem(duplicate)); + LatLon latLon = new LatLon(duplicate.latitude, duplicate.longitude); + if (settings.removeImpassableRoad(latLon)) { + settings.addImpassableRoad(duplicate); } } for (AvoidSpecificRoads.AvoidRoadInfo avoidRoad : appliedItems) { @@ -87,7 +83,12 @@ public class AvoidRoadsSettingsItem extends CollectionSettingsItem getReader() { From 60808c795869e8ab8ef8faaf2e38e95e0461bd75 Mon Sep 17 00:00:00 2001 From: PaulStets Date: Thu, 26 Nov 2020 17:26:21 +0200 Subject: [PATCH 20/66] Change method position --- .../backend/backup/AvoidRoadsSettingsItem.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java index 09505e6b4a..6507ab874e 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java @@ -96,6 +96,11 @@ public class AvoidRoadsSettingsItem extends CollectionSettingsItem getReader() { From de58ff5f4bb4f14a24f8389e4bde76357cf566cd Mon Sep 17 00:00:00 2001 From: max-klaus Date: Thu, 26 Nov 2020 18:41:30 +0300 Subject: [PATCH 21/66] Fix lib script --- OsmAnd/build.gradle.lib | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/OsmAnd/build.gradle.lib b/OsmAnd/build.gradle.lib index f29b9b2a10..fa1d94d3ce 100644 --- a/OsmAnd/build.gradle.lib +++ b/OsmAnd/build.gradle.lib @@ -17,6 +17,7 @@ android { } lintOptions { + tasks.lint.enabled = false abortOnError false } @@ -339,17 +340,25 @@ task appStart(type: Exec) { // commandLine 'cmd', '/c', 'adb', 'shell', 'am', 'start', '-n', 'net.osmand.plus/net.osmand.plus.activities.MapActivity' } +artifacts { + archives(file("../OsmAnd-java/build/libs/OsmAnd-java-android-1.0.jar")) { + name "OsmAnd-java-android" + type "jar" + } +} + // Uploading artifacts to local path -group = "net.osmand" +group = 'net.osmand' uploadArchives { repositories.ivy { // credentials { // username "" // password "" // } + url = System.getenv("OSMAND_BINARIES_IVY_ROOT") ?: "./" layout "pattern" , { - artifact "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" + artifact "[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" } // def gitInfo = "git describe --long".execute().text.trim() From 2f841bf23f9f051f71789c7ce7fe0f9734153d4c Mon Sep 17 00:00:00 2001 From: vshcherb Date: Thu, 26 Nov 2020 17:40:57 +0100 Subject: [PATCH 22/66] Update OpenDBAPI.java --- OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java b/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java index 7c891c25c9..f9e106e06d 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java @@ -92,11 +92,9 @@ public class OpenDBAPI { List ids = new ArrayList<>(Arrays.asList(placeId)); Map change = new TreeMap<>(); Map images = new TreeMap<>(); - Map outdoor = new TreeMap<>(); - outdoor.put("outdoor", imageResponseList); - images.put("append", outdoor); + images.put("append", imageMap); change.put("version", "increment"); - change.put("images", images); + change.put("images.review", images); edit.put("id", ids); edit.put("change", change); edit.put("current", new Object()); @@ -149,4 +147,4 @@ public class OpenDBAPI { public String cid; public String extension; } -} \ No newline at end of file +} From ca2b6f4d0e61eca55a29b7b7c43c64345766cb30 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Thu, 26 Nov 2020 19:22:33 +0200 Subject: [PATCH 23/66] Fix profiles import --- .../osmand/plus/importfiles/ImportHelper.java | 32 +++++++--- .../plus/importfiles/SettingsImportTask.java | 59 +++++++++++++++++-- .../plus/importfiles/ZipImportTask.java | 3 +- .../backend/OsmAndAppCustomization.java | 24 ++++---- .../fragments/ExportItemsBottomSheet.java | 2 +- 5 files changed, 91 insertions(+), 29 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/importfiles/ImportHelper.java b/OsmAnd/src/net/osmand/plus/importfiles/ImportHelper.java index 09d2064284..c7cad00b0c 100644 --- a/OsmAnd/src/net/osmand/plus/importfiles/ImportHelper.java +++ b/OsmAnd/src/net/osmand/plus/importfiles/ImportHelper.java @@ -34,6 +34,7 @@ import net.osmand.plus.dialogs.ImportGpxBottomSheetDialogFragment; import net.osmand.plus.helpers.GpxUiHelper; import net.osmand.plus.helpers.GpxUiHelper.GPXInfo; import net.osmand.plus.measurementtool.MeasurementToolFragment; +import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.backend.backup.SettingsHelper; import net.osmand.plus.settings.backend.backup.SettingsItem; import net.osmand.plus.views.OsmandMapTileView; @@ -67,6 +68,8 @@ import static net.osmand.IndexConstants.WPT_CHART_FILE_EXT; import static net.osmand.data.FavouritePoint.DEFAULT_BACKGROUND_TYPE; import static net.osmand.plus.myplaces.FavoritesActivity.GPX_TAB; import static net.osmand.plus.myplaces.FavoritesActivity.TAB_ID; +import static net.osmand.plus.settings.backend.backup.SettingsHelper.REPLACE_KEY; +import static net.osmand.plus.settings.backend.backup.SettingsHelper.SETTINGS_TYPE_LIST_KEY; /** * @author Koen Rabaey @@ -203,10 +206,11 @@ public class ImportHelper { } } + @Nullable public static String getNameFromContentUri(OsmandApplication app, Uri contentUri) { try { String name; - Cursor returnCursor = app.getContentResolver().query(contentUri, new String[] {OpenableColumns.DISPLAY_NAME}, null, null, null); + Cursor returnCursor = app.getContentResolver().query(contentUri, new String[]{OpenableColumns.DISPLAY_NAME}, null, null, null); if (returnCursor != null && returnCursor.moveToFirst()) { int columnIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME); if (columnIndex != -1) { @@ -257,18 +261,32 @@ public class ImportHelper { } private void handleOsmAndSettingsImport(Uri intentUri, String fileName, Bundle extras, CallbackWithObject> callback) { - if (extras != null && extras.containsKey(SettingsHelper.SETTINGS_VERSION_KEY) && extras.containsKey(SettingsHelper.SETTINGS_LATEST_CHANGES_KEY)) { + if (extras != null + && extras.containsKey(SettingsHelper.SETTINGS_VERSION_KEY) + && extras.containsKey(SettingsHelper.SETTINGS_LATEST_CHANGES_KEY)) { int version = extras.getInt(SettingsHelper.SETTINGS_VERSION_KEY, -1); String latestChanges = extras.getString(SettingsHelper.SETTINGS_LATEST_CHANGES_KEY); - handleOsmAndSettingsImport(intentUri, fileName, latestChanges, version, callback); + boolean replace = extras.getBoolean(REPLACE_KEY); + ArrayList settingsTypeKeys = extras.getStringArrayList(SETTINGS_TYPE_LIST_KEY); + List settingsTypes = null; + if (settingsTypeKeys != null) { + settingsTypes = new ArrayList<>(); + for (String key : settingsTypeKeys) { + settingsTypes.add(ExportSettingsType.valueOf(key)); + } + } + handleOsmAndSettingsImport(intentUri, fileName, settingsTypes, replace, latestChanges, version, callback); } else { - handleOsmAndSettingsImport(intentUri, fileName, null, -1, callback); + handleOsmAndSettingsImport(intentUri, fileName, null, false, null, -1, + callback); } } - protected void handleOsmAndSettingsImport(Uri uri, String name, String latestChanges, int version, - CallbackWithObject> callback) { - executeImportTask(new SettingsImportTask(activity, uri, name, latestChanges, version, callback)); + protected void handleOsmAndSettingsImport(Uri uri, String name, final List settingsTypes, + final boolean replace, String latestChanges, int version, + CallbackWithObject> callback) { + executeImportTask(new SettingsImportTask(activity, uri, name, settingsTypes, replace, latestChanges, version, + callback)); } protected void handleXmlFileImport(Uri intentUri, String fileName, CallbackWithObject routingCallback) { diff --git a/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java b/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java index 991d8a83c4..833ad34c3d 100644 --- a/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java +++ b/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java @@ -11,38 +11,49 @@ import net.osmand.AndroidUtils; import net.osmand.CallbackWithObject; import net.osmand.FileUtils; import net.osmand.IndexConstants; +import net.osmand.plus.AppInitializer; import net.osmand.plus.CustomOsmandPlugin; import net.osmand.plus.R; import net.osmand.plus.base.BaseLoadAsyncTask; +import net.osmand.plus.settings.backend.ExportSettingsType; +import net.osmand.plus.settings.backend.backup.SettingsHelper; import net.osmand.plus.settings.backend.backup.SettingsHelper.CheckDuplicatesListener; import net.osmand.plus.settings.backend.backup.PluginSettingsItem; import net.osmand.plus.settings.backend.backup.ProfileSettingsItem; import net.osmand.plus.settings.backend.backup.SettingsHelper.SettingsCollectListener; import net.osmand.plus.settings.backend.backup.SettingsHelper.SettingsImportListener; import net.osmand.plus.settings.backend.backup.SettingsItem; +import net.osmand.plus.settings.fragments.ImportCompleteFragment; import net.osmand.plus.settings.fragments.ImportSettingsFragment; import net.osmand.util.Algorithms; import java.io.File; import java.util.ArrayList; import java.util.List; +import java.util.Map; import static net.osmand.plus.AppInitializer.loadRoutingFiles; +import static net.osmand.plus.settings.backend.backup.SettingsHelper.getSettingsToOperate; class SettingsImportTask extends BaseLoadAsyncTask { private Uri uri; private String name; + private List settingsTypes; + private boolean replace; private String latestChanges; private int version; private CallbackWithObject> callback; public SettingsImportTask(@NonNull FragmentActivity activity, @NonNull Uri uri, - @NonNull String name, String latestChanges, int version, - CallbackWithObject> callback) { + @NonNull String name, List settingsTypes, + boolean replace, String latestChanges, int version, + CallbackWithObject> callback) { super(activity); this.uri = uri; this.name = name; + this.settingsTypes = settingsTypes; + this.replace = replace; this.latestChanges = latestChanges; this.version = version; this.callback = callback; @@ -60,7 +71,8 @@ class SettingsImportTask extends BaseLoadAsyncTask { File tempDir = FileUtils.getTempDir(app); final File file = new File(tempDir, name); if (error == null && file.exists()) { - app.getSettingsHelper().collectSettings(file, latestChanges, version, new SettingsCollectListener() { + final SettingsHelper settingsHelper = app.getSettingsHelper(); + settingsHelper.collectSettings(file, latestChanges, version, new SettingsCollectListener() { @Override public void onSettingsCollectFinished(boolean succeed, boolean empty, @NonNull List items) { hideProgress(); @@ -77,11 +89,15 @@ class SettingsImportTask extends BaseLoadAsyncTask { for (PluginSettingsItem pluginItem : pluginSettingsItems) { handlePluginImport(pluginItem, file); } - if (!pluginIndependentItems.isEmpty()) { - FragmentActivity activity = activityRef.get(); - if (activity != null) { + FragmentActivity activity = activityRef.get(); + if (!pluginIndependentItems.isEmpty() && activity != null) { + if (settingsTypes == null) { FragmentManager fragmentManager = activity.getSupportFragmentManager(); ImportSettingsFragment.showInstance(fragmentManager, pluginIndependentItems, file); + } else { + Map> allSettingsList = getSettingsToOperate(pluginIndependentItems, false); + List settingsList = settingsHelper.getFilteredSettingsItems(allSettingsList, settingsTypes); + settingsHelper.checkDuplicates(file, settingsList, settingsList, getDuplicatesListener(file, replace)); } } } else if (empty) { @@ -95,6 +111,37 @@ class SettingsImportTask extends BaseLoadAsyncTask { } } + private CheckDuplicatesListener getDuplicatesListener(final File file, final boolean replace) { + return new CheckDuplicatesListener() { + @Override + public void onDuplicatesChecked(@NonNull List duplicates, List items) { + if (replace) { + for (SettingsItem item : items) { + item.setShouldReplace(true); + } + } + app.getSettingsHelper().importSettings(file, items, "", 1, getImportListener(file)); + } + }; + } + + private SettingsImportListener getImportListener(final File file) { + return new SettingsImportListener() { + @Override + public void onSettingsImportFinished(boolean succeed, @NonNull List items) { + FragmentActivity activity = activityRef.get(); + if (activity != null && succeed) { + FragmentManager fm = activity.getSupportFragmentManager(); + app.getRendererRegistry().updateExternalRenderers(); + AppInitializer.loadRoutingFiles(app, null); + if (file != null) { + ImportCompleteFragment.showInstance(fm, items, file.getName()); + } + } + } + }; + } + private void handlePluginImport(final PluginSettingsItem pluginItem, final File file) { FragmentActivity activity = activityRef.get(); final ProgressDialog progress; diff --git a/OsmAnd/src/net/osmand/plus/importfiles/ZipImportTask.java b/OsmAnd/src/net/osmand/plus/importfiles/ZipImportTask.java index e9bac73258..afdb7a32f2 100644 --- a/OsmAnd/src/net/osmand/plus/importfiles/ZipImportTask.java +++ b/OsmAnd/src/net/osmand/plus/importfiles/ZipImportTask.java @@ -85,7 +85,8 @@ public class ZipImportTask extends BaseLoadAsyncTask { importHelper.handleKmzImport(uri, name + GPX_FILE_EXT, save, useImportDir); } else if (importType == ImportType.SETTINGS) { String name = createUniqueFileName(app, "settings", TEMP_DIR, OSMAND_SETTINGS_FILE_EXT); - importHelper.handleOsmAndSettingsImport(uri, name + OSMAND_SETTINGS_FILE_EXT, null, -1, null); + importHelper.handleOsmAndSettingsImport(uri, name + OSMAND_SETTINGS_FILE_EXT, + null, false, null, -1, null); } } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmAndAppCustomization.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmAndAppCustomization.java index 8a43f650ee..742d9b26e1 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmAndAppCustomization.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmAndAppCustomization.java @@ -287,20 +287,17 @@ public class OsmAndAppCustomization { if (!connectedAppDir.exists()) { connectedAppDir.mkdirs(); } - OutputStream fout = new FileOutputStream(new File(connectedAppDir, iconName)); + OutputStream fout = null; + if (!Algorithms.isEmpty(iconName)) { + fout = new FileOutputStream(new File(connectedAppDir, iconName)); + } try { - Algorithms.streamCopy(is, fout); + if (fout != null) { + Algorithms.streamCopy(is, fout); + } } finally { - try { - is.close(); - } catch (IOException e) { - LOG.error(e); - } - try { - fout.close(); - } catch (IOException e) { - LOG.error(e); - } + Algorithms.closeStream(is); + Algorithms.closeStream(fout); } JSONObject json = new JSONObject(); json.put("", connectedAppDirPath + "/" + iconName); @@ -406,8 +403,7 @@ public class OsmAndAppCustomization { return set.contains(appMode); } - public boolean setNavDrawerLogoWithParams(String imageUri, @Nullable String packageName, - @Nullable String intent) { + public boolean setNavDrawerLogoWithParams(String imageUri, @Nullable String packageName, @Nullable String intent) { return setNavDrawerLogo(imageUri, packageName, intent); } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java index 8c62e04ccf..93dff80cce 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java @@ -217,7 +217,7 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { String profileName = modeBean.userProfileName; if (Algorithms.isEmpty(profileName)) { ApplicationMode appMode = ApplicationMode.valueOfStringKey(modeBean.stringKey, null); - profileName = getString(appMode.getNameKeyResource()); + profileName = appMode.toHumanString(); } builder.setTitle(profileName); From 3bbc63e071e7c06861a169d20d26a49ad44f0779 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 26 Nov 2020 18:27:39 +0100 Subject: [PATCH 24/66] Update url --- OsmAnd/src/net/osmand/plus/AnalyticsHelper.java | 2 +- .../plus/mapcontextmenu/builders/cards/IPFSImageCard.java | 3 ++- .../src/net/osmand/plus/openplacereviews/OprStartFragment.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/AnalyticsHelper.java b/OsmAnd/src/net/osmand/plus/AnalyticsHelper.java index e906d7b9bb..2fd12a11ac 100644 --- a/OsmAnd/src/net/osmand/plus/AnalyticsHelper.java +++ b/OsmAnd/src/net/osmand/plus/AnalyticsHelper.java @@ -27,7 +27,7 @@ public class AnalyticsHelper extends SQLiteOpenHelper { private final static Log LOG = PlatformUtil.getLog(AnalyticsHelper.class); - private final static String ANALYTICS_UPLOAD_URL = "https://test.osmand.net/api/submit_analytics"; + private final static String ANALYTICS_UPLOAD_URL = "https://osmand.net/api/submit_analytics"; private final static String ANALYTICS_FILE_NAME = "analytics.json"; private final static int DATA_PARCEL_SIZE = 500; // 500 events diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/IPFSImageCard.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/IPFSImageCard.java index 0d58add034..9235a4ffaf 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/IPFSImageCard.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/IPFSImageCard.java @@ -4,6 +4,7 @@ import android.view.View; import androidx.core.content.ContextCompat; import net.osmand.AndroidNetworkUtils; import net.osmand.PlatformUtil; +import net.osmand.plus.BuildConfig; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.util.Algorithms; @@ -12,7 +13,6 @@ import org.json.JSONException; import org.json.JSONObject; public class IPFSImageCard extends ImageCard { - private static final String BASE_URL = "https://test.openplacereviews.org/api/ipfs/image-ipfs?cid="; private static final Log LOG = PlatformUtil.getLog(IPFSImageCard.class); public IPFSImageCard(MapActivity mapActivity, JSONObject imageObject) { @@ -23,6 +23,7 @@ public class IPFSImageCard extends ImageCard { } catch (JSONException e) { LOG.error(e); } + String BASE_URL = mapActivity.getString(R.string.opr_base_url); url = BASE_URL + cid; imageHiresUrl = BASE_URL + cid; imageUrl = BASE_URL + cid; diff --git a/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java b/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java index 00aba01997..d91164ff18 100644 --- a/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java +++ b/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java @@ -18,6 +18,7 @@ import androidx.annotation.Nullable; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import net.osmand.PlatformUtil; +import net.osmand.plus.BuildConfig; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.base.BaseOsmAndFragment; @@ -74,7 +75,7 @@ public class OprStartFragment extends BaseOsmAndFragment { private void setURLSpan(View v) { String desc = requireContext().getString(R.string.register_on_openplacereviews_desc); SpannableString ss = new SpannableString(desc); - ss.setSpan(new URLSpanNoUnderline("https://" + openPlaceReviewsUrl), desc.indexOf(openPlaceReviewsUrl), + ss.setSpan(new URLSpanNoUnderline(getActivity().getString(R.string.opr_base_url)), desc.indexOf(openPlaceReviewsUrl), desc.indexOf(openPlaceReviewsUrl) + openPlaceReviewsUrl.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); v.findViewById(R.id.start_opr_description).setText(ss); v.findViewById(R.id.start_opr_description).setMovementMethod(LinkMovementMethod.getInstance()); From e9f0f4696e9d062d08066f4ce8a6e8c84dab4b53 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 26 Nov 2020 18:29:03 +0100 Subject: [PATCH 25/66] Update url --- .../plus/mapcontextmenu/builders/cards/IPFSImageCard.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/IPFSImageCard.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/IPFSImageCard.java index 9235a4ffaf..63f02d10fe 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/IPFSImageCard.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/IPFSImageCard.java @@ -1,10 +1,9 @@ package net.osmand.plus.mapcontextmenu.builders.cards; + import android.view.View; import androidx.core.content.ContextCompat; -import net.osmand.AndroidNetworkUtils; import net.osmand.PlatformUtil; -import net.osmand.plus.BuildConfig; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.util.Algorithms; @@ -23,7 +22,7 @@ public class IPFSImageCard extends ImageCard { } catch (JSONException e) { LOG.error(e); } - String BASE_URL = mapActivity.getString(R.string.opr_base_url); + String BASE_URL = mapActivity.getString(R.string.opr_base_url) + "api/ipfs/image-ipfs?cid="; url = BASE_URL + cid; imageHiresUrl = BASE_URL + cid; imageUrl = BASE_URL + cid; From 4a1934e09ccdfddd0b8bfd7617ce947bbfa4f002 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 27 Nov 2020 06:14:53 +0200 Subject: [PATCH 26/66] UI fixes second part --- .../res/animator/appbar_always_elevated.xml | 10 ++ ...heet_item_with_descr_and_checkbox_56dp.xml | 2 +- OsmAnd/res/layout/fragment_import.xml | 15 ++- .../fragments/BaseSettingsListFragment.java | 59 ++++----- .../fragments/ExportItemsBottomSheet.java | 118 +++++++++++++++--- .../fragments/ExportSettingsAdapter.java | 22 ++-- .../fragments/ExportSettingsFragment.java | 1 + .../fragments/ImportSettingsFragment.java | 1 + 8 files changed, 170 insertions(+), 58 deletions(-) create mode 100644 OsmAnd/res/animator/appbar_always_elevated.xml diff --git a/OsmAnd/res/animator/appbar_always_elevated.xml b/OsmAnd/res/animator/appbar_always_elevated.xml new file mode 100644 index 0000000000..c8378c1c29 --- /dev/null +++ b/OsmAnd/res/animator/appbar_always_elevated.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/bottom_sheet_item_with_descr_and_checkbox_56dp.xml b/OsmAnd/res/layout/bottom_sheet_item_with_descr_and_checkbox_56dp.xml index 34e329d8a3..65fc03610c 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_with_descr_and_checkbox_56dp.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_with_descr_and_checkbox_56dp.xml @@ -33,7 +33,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="end" - android:maxLines="1" + android:maxLines="2" android:textAppearance="@style/TextAppearance.ListItemTitle" tools:text="Some title"/> diff --git a/OsmAnd/res/layout/fragment_import.xml b/OsmAnd/res/layout/fragment_import.xml index 2088d2624a..eb2cbc7f79 100644 --- a/OsmAnd/res/layout/fragment_import.xml +++ b/OsmAnd/res/layout/fragment_import.xml @@ -23,16 +23,22 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" - android:background="?attr/bg_color" - android:gravity="center" - android:minHeight="@dimen/bottom_sheet_title_height" android:orientation="vertical"> + + + android:background="@android:color/transparent" + android:stateListAnimator="@animator/appbar_always_elevated"> = 2) { - onContinueButtonClickAction(); - } else { - expandableList.smoothScrollToPositionFromTop(0, 0, 100); - } - } - }); - - ViewTreeObserver treeObserver = buttonsContainer.getViewTreeObserver(); - treeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { - @Override - public void onGlobalLayout() { - if (buttonsContainer != null) { - ViewTreeObserver vts = buttonsContainer.getViewTreeObserver(); - int height = buttonsContainer.getMeasuredHeight(); - expandableList.setPadding(0, 0, 0, height); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { - vts.removeOnGlobalLayoutListener(this); - } else { - vts.removeGlobalOnLayoutListener(this); + if (expandableList.getHeaderViewsCount() <= 1) { + if (hasSelectedData()) { + onContinueButtonClickAction(); } + } else { + expandableList.smoothScrollToPosition(0); } } }); @@ -202,10 +186,10 @@ public abstract class BaseSettingsListFragment extends BaseOsmAndFragment implem toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - if (!hasSelectedData()) { - dismissFragment(); - } else { + if (hasSelectedData()) { showExitDialog(); + } else { + dismissFragment(); } } }); @@ -285,13 +269,24 @@ public abstract class BaseSettingsListFragment extends BaseOsmAndFragment implem updateAvailableSpace(); } + protected List getItemsForType(ExportSettingsType type) { + for (SettingsCategoryItems categoryItems : dataList.values()) { + if (categoryItems.getTypes().contains(type)) { + return (List) categoryItems.getItemsForType(type); + } + } + return null; + } + + protected List getSelectedItemsForType(ExportSettingsType type) { + return (List) selectedItemsMap.get(type); + } + @Override - public void onTypeClicked(ExportSettingsCategory category, ExportSettingsType type) { + public void onTypeClicked(ExportSettingsType type) { FragmentManager fragmentManager = getFragmentManager(); if (fragmentManager != null && type != ExportSettingsType.GLOBAL && type != ExportSettingsType.SEARCH_HISTORY) { - List items = (List) dataList.get(category).getItemsForType(type); - List selectedItems = (List) selectedItemsMap.get(type); - ExportItemsBottomSheet.showInstance(type, selectedItems, items, fragmentManager, this); + ExportItemsBottomSheet.showInstance(fragmentManager, type, this, exportMode); } } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java index 49dd920841..45b417f6f7 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java @@ -14,11 +14,15 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import net.osmand.AndroidUtils; +import net.osmand.GPXUtilities.GPXTrackAnalysis; import net.osmand.IndexConstants; import net.osmand.PlatformUtil; import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager.TileSourceTemplate; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; +import net.osmand.plus.GPXDatabase.GpxDataItem; +import net.osmand.plus.GpxDbHelper.GpxDataItemCallback; +import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.SQLiteTileSource; @@ -28,6 +32,7 @@ import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton; import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton.Builder; +import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.SimpleDividerItem; import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; @@ -47,6 +52,7 @@ import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.backend.backup.FileSettingsItem; +import net.osmand.plus.settings.backend.backup.FileSettingsItem.FileSubtype; import net.osmand.plus.settings.backend.backup.GlobalSettingsItem; import net.osmand.plus.settings.fragments.ExportSettingsAdapter.OnItemSelectedListener; import net.osmand.util.Algorithms; @@ -67,18 +73,43 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { public static final String TAG = ExportItemsBottomSheet.class.getSimpleName(); private static final Log LOG = PlatformUtil.getLog(ExportItemsBottomSheet.class); + private static final String SETTINGS_TYPE_KEY = "settings_type_key"; + private static final String EXPORT_MODE_KEY = "export_mode_key"; + private OsmandApplication app; private UiUtilities uiUtilities; private ExportSettingsType type; - private List allItems; - private List selectedItems = new ArrayList<>(); + private final List allItems = new ArrayList<>(); + private final List selectedItems = new ArrayList<>(); private TextView selectedSize; private ThreeStateCheckbox checkBox; private int activeColorRes; private int secondaryColorRes; + private boolean exportMode; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (savedInstanceState != null) { + exportMode = savedInstanceState.getBoolean(EXPORT_MODE_KEY); + type = ExportSettingsType.valueOf(savedInstanceState.getString(SETTINGS_TYPE_KEY)); + } + Fragment target = getTargetFragment(); + if (target instanceof BaseSettingsListFragment) { + BaseSettingsListFragment fragment = (BaseSettingsListFragment) target; + List items = fragment.getItemsForType(type); + if (items != null) { + allItems.addAll(items); + } + List selectedItemsForType = fragment.getSelectedItemsForType(type); + if (selectedItemsForType != null) { + selectedItems.addAll(selectedItemsForType); + } + } + } @Override public void createMenuItems(Bundle savedInstanceState) { @@ -111,11 +142,18 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { }) .setTag(object); setupBottomSheetItem(builder, object); - item[0] = (BottomSheetItemWithCompoundButton) builder.create(); + item[0] = builder.create(); items.add(item[0]); } } + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putBoolean(EXPORT_MODE_KEY, exportMode); + outState.putString(SETTINGS_TYPE_KEY, type.name()); + } + private BaseBottomSheetItem createTitleItem() { LayoutInflater themedInflater = UiUtilities.getInflater(requireContext(), nightMode); View view = themedInflater.inflate(R.layout.settings_group_title, null); @@ -207,15 +245,13 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { dismiss(); } - public static void showInstance(@NonNull ExportSettingsType type, List selectedItems, List allItems, @NonNull FragmentManager fm, @Nullable Fragment target) { + public static void showInstance(@NonNull FragmentManager fm, @NonNull ExportSettingsType type, + @NonNull BaseSettingsListFragment target, boolean exportMode) { try { if (!fm.isStateSaved() && fm.findFragmentByTag(TAG) == null) { ExportItemsBottomSheet fragment = new ExportItemsBottomSheet(); fragment.type = type; - fragment.allItems = (List) allItems; - if (selectedItems != null) { - fragment.selectedItems.addAll(selectedItems); - } + fragment.exportMode = exportMode; fragment.setTargetFragment(target, 0); fragment.show(fm, TAG); } @@ -234,7 +270,7 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { return null; } - private void setupBottomSheetItem(BottomSheetItemWithCompoundButton.Builder builder, Object object) { + private void setupBottomSheetItem(Builder builder, Object object) { if (object instanceof ApplicationModeBean) { ApplicationModeBean modeBean = (ApplicationModeBean) object; String profileName = modeBean.userProfileName; @@ -298,9 +334,8 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { builder.setTitle(group.getDisplayName(app)); int color = group.getColor() == 0 ? ContextCompat.getColor(app, R.color.color_favorite) : group.getColor(); builder.setIcon(uiUtilities.getPaintedIcon(R.drawable.ic_action_folder, color)); - int points = group.getPoints().size(); - String itemsDescr = app.getString(R.string.shared_string_gpx_points); + String itemsDescr = getString(R.string.shared_string_gpx_points); builder.setDescription(getString(R.string.ltr_or_rtl_combine_via_colon, itemsDescr, points)); } else if (object instanceof GlobalSettingsItem) { GlobalSettingsItem globalSettingsItem = (GlobalSettingsItem) object; @@ -316,7 +351,7 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { builder.setIcon(uiUtilities.getIcon(R.drawable.ic_action_history, activeColorRes)); } int selectedMarkers = markersGroup.getMarkers().size(); - String itemsDescr = app.getString(R.string.shared_string_items); + String itemsDescr = getString(R.string.shared_string_items); builder.setDescription(getString(R.string.ltr_or_rtl_combine_via_colon, itemsDescr, selectedMarkers)); } else if (object instanceof HistoryEntry) { HistoryEntry historyEntry = (HistoryEntry) object; @@ -326,7 +361,7 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { } private void setupBottomSheetItemForFile(Builder builder, File file) { - FileSettingsItem.FileSubtype fileSubtype = FileSettingsItem.FileSubtype.getSubtypeByPath(app, file.getPath()); + FileSubtype fileSubtype = FileSubtype.getSubtypeByPath(app, file.getPath()); builder.setTitle(file.getName()); if (file.getAbsolutePath().contains(IndexConstants.RENDERERS_DIR)) { builder.setIcon(uiUtilities.getIcon(R.drawable.ic_action_map_style, activeColorRes)); @@ -334,8 +369,9 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { builder.setIcon(uiUtilities.getIcon(R.drawable.ic_action_route_distance, activeColorRes)); } else if (file.getAbsolutePath().contains(IndexConstants.GPX_INDEX_DIR)) { builder.setTitle(GpxUiHelper.getGpxTitle(file.getName())); + builder.setTag(file); + builder.setDescription(getTrackDescr(file)); builder.setIcon(uiUtilities.getIcon(R.drawable.ic_action_route_distance, activeColorRes)); - builder.setDescription(file.getParentFile().getName()); } else if (file.getAbsolutePath().contains(IndexConstants.AV_INDEX_DIR)) { int iconId = AudioVideoNotesPlugin.getIconIdForRecordingFile(file); if (iconId == -1) { @@ -360,6 +396,60 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { } } + private final GpxDataItemCallback gpxDataItemCallback = new GpxDataItemCallback() { + @Override + public boolean isCancelled() { + return false; + } + + @Override + public void onGpxDataItemReady(GpxDataItem item) { + for (BaseBottomSheetItem bottomSheetItem : items) { + if (Algorithms.objectEquals(item.getFile(), bottomSheetItem.getTag())) { + ((BottomSheetItemWithDescription) bottomSheetItem).setDescription(getTrackDescrForDataItem(item)); + break; + } + } + } + }; + + private String getTrackDescr(@NonNull File file) { + String folder = ""; + File parent = file.getParentFile(); + if (parent != null) { + folder = Algorithms.capitalizeFirstLetter(parent.getName()); + } + if (exportMode) { + GpxDataItem dataItem = getDataItem(file, gpxDataItemCallback); + if (dataItem != null) { + return getTrackDescrForDataItem(dataItem); + } + } else { + String date = OsmAndFormatter.getFormattedDate(app, file.lastModified()); + String size = AndroidUtils.formatSize(app, file.length()); + String descr = getString(R.string.ltr_or_rtl_combine_via_bold_point, folder, date); + return getString(R.string.ltr_or_rtl_combine_via_comma, descr, size); + } + return null; + } + + private String getTrackDescrForDataItem(@NonNull GpxDataItem dataItem) { + GPXTrackAnalysis analysis = dataItem.getAnalysis(); + if (analysis != null) { + File parent = dataItem.getFile().getParentFile(); + String folder = Algorithms.capitalizeFirstLetter(parent.getName()); + String dist = OsmAndFormatter.getFormattedDistance(analysis.totalDistance, app); + String points = analysis.wptPoints + " " + getString(R.string.shared_string_gpx_points).toLowerCase(); + String descr = getString(R.string.ltr_or_rtl_combine_via_bold_point, folder, dist); + return getString(R.string.ltr_or_rtl_combine_via_comma, descr, points); + } + return null; + } + + private GpxDataItem getDataItem(File file, @Nullable GpxDataItemCallback callback) { + return app.getGpxDbHelper().getItem(file, callback); + } + private String getMapDescription(File file) { if (file.isDirectory() || file.getName().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT)) { return getString(R.string.online_map); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java index edd6419c74..1eec036171 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java @@ -55,6 +55,9 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { private final boolean nightMode; private final int activeColorRes; private final int secondaryColorRes; + private final int groupViewHeight; + private final int childViewHeight; + private final int listBottomPadding; ExportSettingsAdapter(OsmandApplication app, OnItemSelectedListener listener, boolean nightMode) { this.app = app; @@ -64,6 +67,9 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { themedInflater = UiUtilities.getInflater(app, nightMode); activeColorRes = nightMode ? R.color.icon_color_active_dark : R.color.icon_color_active_light; secondaryColorRes = nightMode ? R.color.icon_color_secondary_dark : R.color.icon_color_secondary_light; + groupViewHeight = app.getResources().getDimensionPixelSize(R.dimen.setting_list_item_group_height); + childViewHeight = app.getResources().getDimensionPixelSize(R.dimen.setting_list_item_large_height); + listBottomPadding = app.getResources().getDimensionPixelSize(R.dimen.fab_recycler_view_padding_bottom); } @Override @@ -71,8 +77,7 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { View group = convertView; if (group == null) { group = themedInflater.inflate(R.layout.profile_data_list_item_group, parent, false); - int minHeight = app.getResources().getDimensionPixelSize(R.dimen.setting_list_item_group_height); - group.findViewById(R.id.item_container).setMinimumHeight(minHeight); + group.findViewById(R.id.item_container).setMinimumHeight(groupViewHeight); } final ExportSettingsCategory category = itemsTypes.get(groupPosition); final SettingsCategoryItems items = itemsMap.get(category); @@ -111,6 +116,9 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { } }); + boolean addPadding = !isExpanded && groupPosition == getGroupCount() - 1; + group.setPadding(0, 0, 0, addPadding ? listBottomPadding : 0); + adjustIndicator(app, groupPosition, isExpanded, group, nightMode); AndroidUiHelper.updateVisibility(group.findViewById(R.id.divider), isExpanded); AndroidUiHelper.updateVisibility(group.findViewById(R.id.card_top_divider), true); @@ -125,8 +133,7 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { View child = convertView; if (child == null) { child = themedInflater.inflate(R.layout.profile_data_list_item_group, parent, false); - int minHeight = app.getResources().getDimensionPixelSize(R.dimen.setting_list_item_large_height); - child.findViewById(R.id.item_container).setMinimumHeight(minHeight); + child.findViewById(R.id.item_container).setMinimumHeight(childViewHeight); } final ExportSettingsCategory category = itemsTypes.get(groupPosition); final SettingsCategoryItems categoryItems = itemsMap.get(category); @@ -162,7 +169,7 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { @Override public void onClick(View v) { if (listener != null) { - listener.onTypeClicked(category, type); + listener.onTypeClicked(type); } } }); @@ -179,7 +186,8 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { notifyDataSetChanged(); } }); - + boolean addPadding = isLastChild && groupPosition == getGroupCount() - 1; + child.setPadding(0, 0, 0, addPadding ? listBottomPadding : 0); AndroidUiHelper.updateVisibility(child.findViewById(R.id.card_bottom_divider), isLastChild); return child; @@ -337,7 +345,7 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { void onCategorySelected(ExportSettingsCategory type, boolean selected); - void onTypeClicked(ExportSettingsCategory category, ExportSettingsType type); + void onTypeClicked(ExportSettingsType type); } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java index c46168ec67..af954db7c5 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java @@ -75,6 +75,7 @@ public class ExportSettingsFragment extends BaseSettingsListFragment { progressMax = savedInstanceState.getInt(PROGRESS_MAX_KEY); progressValue = savedInstanceState.getInt(PROGRESS_VALUE_KEY); } + exportMode = true; dataList = app.getSettingsHelper().getAdditionalData(globalExport); } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java index f078d1c34b..18e4f3cec5 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java @@ -100,6 +100,7 @@ public class ImportSettingsFragment extends BaseSettingsListFragment { if (savedInstanceState != null) { duplicateStartTime = savedInstanceState.getLong(DUPLICATES_START_TIME_KEY); } + exportMode = false; settingsHelper = app.getSettingsHelper(); ImportAsyncTask importTask = settingsHelper.getImportTask(); From f26739388781a186e93956c06beb07957b67aebd Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 27 Nov 2020 07:02:45 +0200 Subject: [PATCH 27/66] Save edited files time to osf --- .../backend/backup/FileSettingsItem.java | 22 +++++++++++++++- .../backend/backup/SettingsHelper.java | 4 +-- .../backend/backup/SettingsImporter.java | 8 +++--- .../backend/backup/SettingsItemWriter.java | 6 ++++- .../fragments/ExportItemsBottomSheet.java | 25 ++++++++++--------- 5 files changed, 46 insertions(+), 19 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/FileSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/FileSettingsItem.java index 563a04fc75..493e49fa07 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/FileSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/FileSettingsItem.java @@ -19,6 +19,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class FileSettingsItem extends StreamSettingsItem { @@ -131,6 +132,7 @@ public class FileSettingsItem extends StreamSettingsItem { private final File appPath; protected FileSubtype subtype; private long size; + private long lastModified; public FileSettingsItem(@NonNull OsmandApplication app, @NonNull File file) throws IllegalArgumentException { super(app, file.getPath().replace(app.getAppPath(null).getPath(), "")); @@ -222,6 +224,14 @@ public class FileSettingsItem extends StreamSettingsItem { this.size = size; } + public long getLastModified() { + return lastModified; + } + + public void setLastModified(long lastModified) { + this.lastModified = lastModified; + } + @NonNull public File getFile() { return file; @@ -292,6 +302,9 @@ public class FileSettingsItem extends StreamSettingsItem { } finally { Algorithms.closeStream(output); } + if (lastModified != -1) { + dest.setLastModified(lastModified); + } } }; } @@ -306,7 +319,14 @@ public class FileSettingsItem extends StreamSettingsItem { warnings.add(app.getString(R.string.settings_item_read_error, file.getName())); SettingsHelper.LOG.error("Failed to set input stream from file: " + file.getName(), e); } - return super.getWriter(); + return new StreamSettingsItemWriter(this) { + @Override + public ZipEntry createNewEntry(String fileName) { + ZipEntry entry = super.createNewEntry(fileName); + entry.setTime(file.lastModified()); + return entry; + } + }; } else { return new StreamSettingsItemWriter(this) { diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java index b6b7f6e5b5..babb91a140 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -829,10 +829,10 @@ public class SettingsHelper { List routingFilesList = new ArrayList<>(); List renderFilesList = new ArrayList<>(); List multimediaFilesList = new ArrayList<>(); - List tracksFilesList = new ArrayList<>(); List ttsVoiceFilesList = new ArrayList<>(); List voiceFilesList = new ArrayList<>(); List mapFilesList = new ArrayList<>(); + List tracksFilesList = new ArrayList<>(); List avoidRoads = new ArrayList<>(); List globalSettingsItems = new ArrayList<>(); List notesPointList = new ArrayList<>(); @@ -856,7 +856,7 @@ public class SettingsHelper { } else if (fileItem.getSubtype() == FileSubtype.MULTIMEDIA_NOTES) { multimediaFilesList.add(fileItem.getFile()); } else if (fileItem.getSubtype() == FileSubtype.GPX) { - tracksFilesList.add(fileItem.getFile()); + tracksFilesList.add(fileItem); } else if (fileItem.getSubtype().isMap()) { mapFilesList.add(fileItem); } else if (fileItem.getSubtype() == FileSubtype.TTS_VOICE) { diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsImporter.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsImporter.java index 7f72761066..66c40d03cc 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsImporter.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsImporter.java @@ -60,7 +60,7 @@ class SettingsImporter { try { SettingsItemsFactory itemsFactory = new SettingsItemsFactory(app, itemsJson); List settingsItemList = itemsFactory.getItems(); - getFilesSize(file, settingsItemList); + updateFilesInfo(file, settingsItemList); items.addAll(settingsItemList); } catch (IllegalArgumentException e) { SettingsHelper.LOG.error("Error parsing items: " + itemsJson, e); @@ -81,7 +81,7 @@ class SettingsImporter { return items; } - private void getFilesSize(@NonNull File file, List settingsItemList) throws IOException { + private void updateFilesInfo(@NonNull File file, List settingsItemList) throws IOException { ZipFile zipfile = new ZipFile(file.getPath()); Enumeration zipEnum = zipfile.entries(); while (zipEnum.hasMoreElements()) { @@ -90,7 +90,9 @@ class SettingsImporter { for (SettingsItem settingsItem : settingsItemList) { if (settingsItem instanceof FileSettingsItem && zipEntry.getName().equals(settingsItem.getFileName())) { - ((FileSettingsItem) settingsItem).setSize(size); + FileSettingsItem fileSettingsItem = (FileSettingsItem) settingsItem; + fileSettingsItem.setSize(size); + fileSettingsItem.setLastModified(zipEntry.getTime()); break; } } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemWriter.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemWriter.java index 090767a493..65863f0e90 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemWriter.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemWriter.java @@ -22,9 +22,13 @@ public abstract class SettingsItemWriter { public abstract boolean writeToStream(@NonNull OutputStream outputStream) throws IOException; public void writeEntry(String fileName, @NonNull ZipOutputStream zos) throws IOException { - ZipEntry entry = new ZipEntry(fileName); + ZipEntry entry = createNewEntry(fileName); zos.putNextEntry(entry); writeToStream(zos); zos.closeEntry(); } + + public ZipEntry createNewEntry(String fileName) { + return new ZipEntry(fileName); + } } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java index 45b417f6f7..0a310e5c16 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java @@ -313,10 +313,11 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { builder.setTitle(tileSource.getName()); builder.setIcon(uiUtilities.getIcon(R.drawable.ic_map, activeColorRes)); } else if (object instanceof File) { - setupBottomSheetItemForFile(builder, (File) object); + File file = (File) object; + setupBottomSheetItemForFile(builder, file, file.lastModified(), file.length()); } else if (object instanceof FileSettingsItem) { - FileSettingsItem fileSettingsItem = (FileSettingsItem) object; - setupBottomSheetItemForFile(builder, fileSettingsItem.getFile()); + FileSettingsItem item = (FileSettingsItem) object; + setupBottomSheetItemForFile(builder, item.getFile(), item.getLastModified(), item.getSize()); } else if (object instanceof AvoidRoadInfo) { AvoidRoadInfo avoidRoadInfo = (AvoidRoadInfo) object; builder.setTitle(avoidRoadInfo.name); @@ -360,7 +361,7 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { } } - private void setupBottomSheetItemForFile(Builder builder, File file) { + private void setupBottomSheetItemForFile(Builder builder, File file, long lastModified, long size) { FileSubtype fileSubtype = FileSubtype.getSubtypeByPath(app, file.getPath()); builder.setTitle(file.getName()); if (file.getAbsolutePath().contains(IndexConstants.RENDERERS_DIR)) { @@ -370,7 +371,7 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { } else if (file.getAbsolutePath().contains(IndexConstants.GPX_INDEX_DIR)) { builder.setTitle(GpxUiHelper.getGpxTitle(file.getName())); builder.setTag(file); - builder.setDescription(getTrackDescr(file)); + builder.setDescription(getTrackDescr(file, lastModified, size)); builder.setIcon(uiUtilities.getIcon(R.drawable.ic_action_route_distance, activeColorRes)); } else if (file.getAbsolutePath().contains(IndexConstants.AV_INDEX_DIR)) { int iconId = AudioVideoNotesPlugin.getIconIdForRecordingFile(file); @@ -386,11 +387,11 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { if (fileSubtype.isMap()) { String mapDescription = getMapDescription(file); - String size = AndroidUtils.formatSize(app, file.length()); + String formattedSize = AndroidUtils.formatSize(app, size); if (mapDescription != null) { - builder.setDescription(getString(R.string.ltr_or_rtl_combine_via_star, mapDescription, size)); + builder.setDescription(getString(R.string.ltr_or_rtl_combine_via_star, mapDescription, formattedSize)); } else { - builder.setDescription(size); + builder.setDescription(formattedSize); } } } @@ -413,7 +414,7 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { } }; - private String getTrackDescr(@NonNull File file) { + private String getTrackDescr(@NonNull File file, long lastModified, long size) { String folder = ""; File parent = file.getParentFile(); if (parent != null) { @@ -425,10 +426,10 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { return getTrackDescrForDataItem(dataItem); } } else { - String date = OsmAndFormatter.getFormattedDate(app, file.lastModified()); - String size = AndroidUtils.formatSize(app, file.length()); + String date = OsmAndFormatter.getFormattedDate(app, lastModified); + String formattedSize = AndroidUtils.formatSize(app, size); String descr = getString(R.string.ltr_or_rtl_combine_via_bold_point, folder, date); - return getString(R.string.ltr_or_rtl_combine_via_comma, descr, size); + return getString(R.string.ltr_or_rtl_combine_via_comma, descr, formattedSize); } return null; } From 208f4c99ef48036388ae4e77dbbf712d965be948 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 27 Nov 2020 09:19:36 +0200 Subject: [PATCH 28/66] visibility fix --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 2dba9c0267..872d69bbb6 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -399,7 +399,7 @@ public class MenuBuilder { } }); //TODO This feature is under development - view.setVisibility(View.VISIBLE); + //view.setVisibility(View.VISIBLE); return view; } From 39da9cf44c15c1bf6259487939ef9374686efdd4 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 27 Nov 2020 09:20:33 +0200 Subject: [PATCH 29/66] visibility fix --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 872d69bbb6..6b1a05748e 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -399,7 +399,7 @@ public class MenuBuilder { } }); //TODO This feature is under development - //view.setVisibility(View.VISIBLE); + view.setVisibility(View.GONE); return view; } From 1f2b383dade0f5b639ac6d143016bd1f8c1ed320 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 27 Nov 2020 10:15:03 +0200 Subject: [PATCH 30/66] Wikivoyage to OBF migration: Work in progress 3. Add missing fields. --- .../main/java/net/osmand/data/Amenity.java | 5 ++ .../plus/wikivoyage/data/TravelObfHelper.java | 73 ++++++++++--------- 2 files changed, 45 insertions(+), 33 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java b/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java index b0fe44ecfb..bb1c911034 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java @@ -44,6 +44,11 @@ public class Amenity extends MapObject { public static final String REF = "ref"; public static final String OSM_DELETE_VALUE = "delete"; public static final String OSM_DELETE_TAG = "osmand_change"; + public static final String IMAGE_TITLE = "image_title"; + public static final String IS_PART = "is_part"; + public static final String IS_AGGR_PART = "is_aggr_part"; + public static final String CONTENT_JSON = "content_json"; + private String subType; private PoiCategory type; diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 6c41e39cff..3f6b27129e 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -6,7 +6,6 @@ import androidx.annotation.Nullable; import net.osmand.Collator; import net.osmand.GPXUtilities; import net.osmand.IndexConstants; -import net.osmand.Location; import net.osmand.OsmAndCollator; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; @@ -15,35 +14,30 @@ import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapPoiReaderAdapter; import net.osmand.data.Amenity; import net.osmand.data.LatLon; -import net.osmand.osm.MapPoiTypes; -import net.osmand.osm.PoiCategory; import net.osmand.plus.OsmandApplication; -import net.osmand.plus.activities.actions.OsmAndAction; -import net.osmand.plus.api.SQLiteAPI; -import net.osmand.plus.resources.AmenityIndexRepository; -import net.osmand.search.core.SearchResult; +import net.osmand.plus.R; import net.osmand.util.Algorithms; import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; -import java.io.ByteArrayInputStream; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; -import java.util.Map.Entry; + public class TravelObfHelper implements TravelHelper{ private static final Log LOG = PlatformUtil.getLog(TravelObfHelper.class); + private static final String WIKIVOYAGE_OBF = "Wikivoyage.obf"; + public static final String ROUTE_ARTICLE = "route_article"; + private final OsmandApplication application; private Collator collator; private TravelLocalDataHelper localDataHelper; @@ -58,14 +52,14 @@ public class TravelObfHelper implements TravelHelper{ public TravelObfHelper(OsmandApplication application) { this.application = application; collator = OsmAndCollator.primaryCollator(); - localDataHelper = new TravelLocalDataHelper(application); //will I need it? + localDataHelper = new TravelLocalDataHelper(application); } public static boolean checkIfObfFileExists(OsmandApplication app) { File[] files = app.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles(); if (files != null) { for (File f : files) { - if (f.getName().equals("Wikivoyage.obf")) { + if (f.getName().equals(WIKIVOYAGE_OBF)) { return true; } } @@ -79,7 +73,7 @@ public class TravelObfHelper implements TravelHelper{ } /** TODO - * 1.implement regional travelbooks + * 1. implement regional travelbooks * 2. check settings for default? */ public void initTravelBooks() { @@ -89,11 +83,11 @@ public class TravelObfHelper implements TravelHelper{ if (files != null && !files.isEmpty()) { for (File f : files) { existingTravelBooks.add(f); -// if (selectedTravelBook == null) { -// selectedTravelBook = f; -// } else if (Algorithms.objectEquals(travelBook, f.getName())) { -// selectedTravelBook = f; -// } + if (selectedTravelBook == null) { + selectedTravelBook = f; + } else if (Algorithms.objectEquals(travelBook, f.getName())) { + selectedTravelBook = f; + } } selectedTravelBook = files.get(0); } else { @@ -134,12 +128,12 @@ public class TravelObfHelper implements TravelHelper{ @Override public List getExistingTravelBooks() { - return null; + return existingTravelBooks; } @Override public void selectTravelBook(File f) { - + //todo } @NonNull @@ -179,7 +173,8 @@ public class TravelObfHelper implements TravelHelper{ @Override public boolean publish(Amenity object) { - if (object.getSubType().equals("route_article")) { + //TODO need more logical way to filter results + if (object.getSubType().equals(ROUTE_ARTICLE)) { articles.add(object); } return false; @@ -216,18 +211,20 @@ public class TravelObfHelper implements TravelHelper{ res.title = amenity.getName(lang).equals("") ? amenity.getName() : amenity.getName(lang); res.content = amenity.getDescription(lang); - res.isPartOf = ""; //add to file + res.isPartOf = amenity.getTagContent(Amenity.IS_PART, lang) == null ? "" : amenity.getTagContent(Amenity.IS_PART, lang); res.lat = amenity.getLocation().getLatitude(); res.lon = amenity.getLocation().getLongitude(); - res.imageTitle = "";//add to file - res.tripId = amenity.getId(); - res.originalId = amenity.getId()>>6; + res.imageTitle = amenity.getTagContent(Amenity.IMAGE_TITLE, lang) == null ? "" : amenity.getTagContent(Amenity.IMAGE_TITLE, lang); + res.tripId = amenity.getId(); //? + res.originalId = 0; //? res.lang = lang; - res.contentsJson = ""; //add to file - res.aggregatedPartOf = ""; //add to file + res.contentsJson = amenity.getTagContent(Amenity.CONTENT_JSON, lang) == null ? "" : amenity.getTagContent(Amenity.CONTENT_JSON, lang); + res.aggregatedPartOf = amenity.getTagContent(Amenity.IS_AGGR_PART, lang) == null ? "" : amenity.getTagContent(Amenity.IS_AGGR_PART, lang); + +// crash in some places, need to fix it // try { -// String gpxContent = Algorithms.gzipToString(); - res.gpxFile = null; //GPXUtilities.loadGPXFile(new ByteArrayInputStream(gpxContent.getBytes("UTF-8"))); +// String gpxContent = amenity.getAdditionalInfo("gpx_info"); +// res.gpxFile = GPXUtilities.loadGPXFile(new ByteArrayInputStream(gpxContent.getBytes("UTF-8"))); // } catch (IOException e) { // LOG.error(e.getMessage(), e); // } @@ -279,16 +276,26 @@ public class TravelObfHelper implements TravelHelper{ @Override public String formatTravelBookName(File tb) { - return null; + if (tb == null) { + return application.getString(R.string.shared_string_none); + } + String nm = tb.getName(); + return nm.substring(0, nm.indexOf('.')).replace('_', ' '); } @Override public String getGPXName(TravelArticle article) { - return null; + return article.getTitle().replace('/', '_').replace('\'', '_') + .replace('\"', '_') + IndexConstants.GPX_FILE_EXT; } @Override public File createGpxFile(TravelArticle article) { - return null; + final GPXUtilities.GPXFile gpx = article.getGpxFile(); + File file = application.getAppPath(IndexConstants.GPX_TRAVEL_DIR + getGPXName(article)); + if (!file.exists()) { + GPXUtilities.writeGpxFile(file, gpx); + } + return file; } } From 868222d8727ed3ce6d340fdc55ef85abc967e4de Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 27 Nov 2020 12:22:28 +0200 Subject: [PATCH 31/66] fixes --- .../plus/mapcontextmenu/MenuBuilder.java | 33 +++++++++++++++---- .../osmand/plus/osmedit/opr/OpenDBAPI.java | 5 +-- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 6b1a05748e..0e62a6e48f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -106,6 +106,7 @@ public class MenuBuilder { private String preferredMapLang; private String preferredMapAppLang; private boolean transliterateNames; + private View view; private final OpenDBAPI openDBAPI = new OpenDBAPI(); private String[] placeId = new String[0]; @@ -226,6 +227,7 @@ public class MenuBuilder { } public void build(View view) { + this.view = view; firstRow = true; hidden = false; buildTopInternal(view); @@ -399,7 +401,7 @@ public class MenuBuilder { } }); //TODO This feature is under development - view.setVisibility(View.GONE); + view.setVisibility(View.VISIBLE); return view; } @@ -417,7 +419,9 @@ public class MenuBuilder { OnActivityResultListener() { @Override public void onResult(int resultCode, Intent resultData) { - handleSelectedImage(view, resultData.getData()); + if (resultData != null) { + handleSelectedImage(view, resultData.getData()); + } } })); } @@ -435,7 +439,7 @@ public class MenuBuilder { } catch (Exception e) { LOG.error(e); String str = app.getString(R.string.cannot_upload_image); - app.showToastMessage(str); + showToastMessage(str); } finally { Algorithms.closeStream(inputStream); } @@ -452,12 +456,18 @@ public class MenuBuilder { if (response != null) { int res = 0; try { + StringBuilder error = new StringBuilder(); res = openDBAPI.uploadImage( placeId, baseUrl, OPRWebviewActivity.getPrivateKeyFromCookie(app), OPRWebviewActivity.getUsernameFromCookie(app), - response); + response, error); + if (res != 200) { + showToastMessage(error.toString()); + } else { + //ok, continue + } } catch (FailedVerificationException e) { LOG.error(e); checkTokenAndShowScreen(); @@ -466,7 +476,8 @@ public class MenuBuilder { //image was uploaded but not added to blockchain checkTokenAndShowScreen(); } else { - app.showToastMessage(R.string.successfully_uploaded_pattern, 1, 1); + String str = app.getString(R.string.successfully_uploaded_pattern, 1, 1); + showToastMessage(str); //refresh the image execute(new GetImageCardsTask(mapActivity, getLatLon(), getAdditionalCardParams(), imageCardListener)); } @@ -475,13 +486,23 @@ public class MenuBuilder { } } + private void showToastMessage(final String str) { + app.runInUIThread(new Runnable() { + @Override + public void run() { + Toast.makeText(view.getContext(), str, Toast.LENGTH_LONG).show(); + } + }); + } + //This method runs on non main thread private void checkTokenAndShowScreen() { final String baseUrl = OPRWebviewActivity.getBaseUrl(app); final String name = OPRWebviewActivity.getUsernameFromCookie(app); final String privateKey = OPRWebviewActivity.getPrivateKeyFromCookie(app); if (openDBAPI.checkPrivateKeyValid(baseUrl, name, privateKey)) { - app.showToastMessage(R.string.cannot_upload_image); + String str = app.getString(R.string.cannot_upload_image); + showToastMessage(str); } else { app.runInUIThread(new Runnable() { @Override diff --git a/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java b/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java index f9e106e06d..4754346805 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java @@ -68,7 +68,7 @@ public class OpenDBAPI { response.toString().contains(LOGIN_SUCCESS_MESSAGE); } - public int uploadImage(String[] placeId, String baseUrl, String privateKey, String username, String image) throws FailedVerificationException { + public int uploadImage(String[] placeId, String baseUrl, String privateKey, String username, String image, StringBuilder sb) throws FailedVerificationException { if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { Security.removeProvider("BC"); Security.addProvider(new BouncyCastleProvider()); @@ -93,7 +93,7 @@ public class OpenDBAPI { Map change = new TreeMap<>(); Map images = new TreeMap<>(); images.put("append", imageMap); - change.put("version", "increment"); + change.put("version", 25); change.put("images.review", images); edit.put("id", ids); edit.put("change", change); @@ -132,6 +132,7 @@ public class OpenDBAPI { String strCurrentLine; while ((strCurrentLine = br.readLine()) != null) { log.error(strCurrentLine); + sb.append(strCurrentLine); } } return rc; From b2ae67ba39cf72f538affed9e2ccfbb0dcfc9be3 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 27 Nov 2020 13:00:06 +0200 Subject: [PATCH 32/66] show error bug fix --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 0e62a6e48f..199d0c930c 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -14,6 +14,8 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.net.Uri; import android.os.AsyncTask; +import android.os.Handler; +import android.os.Looper; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.TextUtils; @@ -487,10 +489,10 @@ public class MenuBuilder { } private void showToastMessage(final String str) { - app.runInUIThread(new Runnable() { + new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { - Toast.makeText(view.getContext(), str, Toast.LENGTH_LONG).show(); + Toast.makeText(mapActivity.getBaseContext(), str, Toast.LENGTH_LONG).show(); } }); } From 67ef57157f206a78b26ea2c62e1ab9baff68967b Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 27 Nov 2020 14:48:37 +0200 Subject: [PATCH 33/66] version changed --- OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java b/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java index 4754346805..36d6e82b11 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/opr/OpenDBAPI.java @@ -93,7 +93,7 @@ public class OpenDBAPI { Map change = new TreeMap<>(); Map images = new TreeMap<>(); images.put("append", imageMap); - change.put("version", 25); + change.put("version", "increment"); change.put("images.review", images); edit.put("id", ids); edit.put("change", change); From 9380ba0c8e4e34d5b7a1d73ee37ee225005f9184 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 27 Nov 2020 14:53:29 +0200 Subject: [PATCH 34/66] change visibility --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 199d0c930c..a39259a9e4 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -403,7 +403,7 @@ public class MenuBuilder { } }); //TODO This feature is under development - view.setVisibility(View.VISIBLE); + view.setVisibility(View.GONE); return view; } From ac497a9f143bb67b70d524fcd5d7ad6cd8aef3bd Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Fri, 27 Nov 2020 15:26:39 +0200 Subject: [PATCH 35/66] Fix renew widgets after profiles import --- .../src/net/osmand/plus/importfiles/SettingsImportTask.java | 6 ++++++ .../plus/settings/backend/backup/ProfileSettingsItem.java | 3 +++ .../plus/settings/fragments/ProfileAppearanceFragment.java | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java b/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java index 833ad34c3d..99c321adfd 100644 --- a/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java +++ b/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java @@ -14,6 +14,7 @@ import net.osmand.IndexConstants; import net.osmand.plus.AppInitializer; import net.osmand.plus.CustomOsmandPlugin; import net.osmand.plus.R; +import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.BaseLoadAsyncTask; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.backend.backup.SettingsHelper; @@ -133,6 +134,11 @@ class SettingsImportTask extends BaseLoadAsyncTask { if (activity != null && succeed) { FragmentManager fm = activity.getSupportFragmentManager(); app.getRendererRegistry().updateExternalRenderers(); + app.getPoiFilters().loadSelectedPoiFilters(); + if (activity instanceof MapActivity) { + ((MapActivity) activity).getMapLayers().getMapWidgetRegistry().updateVisibleWidgets(); + ((MapActivity) activity).updateApplicationModeSettings(); + } AppInitializer.loadRoutingFiles(app, null); if (file != null) { ImportCompleteFragment.showInstance(fm, items, file.getName()); diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java index 4ddb04daab..10e47d4e09 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java @@ -170,6 +170,9 @@ public class ProfileSettingsItem extends OsmandSettingsItem { builder = ApplicationMode.fromModeBean(app, modeBean); appMode = ApplicationMode.saveProfile(builder, app); } else { + if (modeBean == null) { + modeBean = appMode.toModeBean(); + } builder = ApplicationMode.fromModeBean(app, modeBean); appMode = ApplicationMode.saveProfile(builder, app); } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java index 8e4dfc14c0..0374a4a42f 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java @@ -40,6 +40,7 @@ import androidx.recyclerview.widget.RecyclerView; import net.osmand.AndroidUtils; import net.osmand.IndexConstants; import net.osmand.PlatformUtil; +import net.osmand.plus.activities.MapActivity; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.R; import net.osmand.plus.settings.backend.backup.ProfileSettingsItem; @@ -873,6 +874,10 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment { private void customProfileSaved() { FragmentActivity activity = getActivity(); if (activity != null) { + if (activity instanceof MapActivity) { + ((MapActivity) activity).getMapLayers().getMapWidgetRegistry().updateVisibleWidgets(); + ((MapActivity) activity).updateApplicationModeSettings(); + } FragmentManager fragmentManager = activity.getSupportFragmentManager(); if (!fragmentManager.isStateSaved()) { fragmentManager.popBackStack(); From 71ab59e400700e8d8425a8c8f4967ee471749613 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 27 Nov 2020 16:46:03 +0200 Subject: [PATCH 36/66] bug fix --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index a39259a9e4..c89789bc33 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -109,6 +109,7 @@ public class MenuBuilder { private String preferredMapAppLang; private boolean transliterateNames; private View view; + private View photoButton; private final OpenDBAPI openDBAPI = new OpenDBAPI(); private String[] placeId = new String[0]; @@ -121,6 +122,9 @@ public class MenuBuilder { @Override public void onPlaceIdAcquired(String[] placeId) { MenuBuilder.this.placeId = placeId; + if (placeId.length < 2){ + photoButton.setVisibility(View.GONE); + } } @Override @@ -404,6 +408,7 @@ public class MenuBuilder { }); //TODO This feature is under development view.setVisibility(View.GONE); + photoButton = view; return view; } From e4d748be442bda536f02fb6cd8323a8f7d404937 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Fri, 27 Nov 2020 15:58:03 +0100 Subject: [PATCH 37/66] Update MenuBuilder.java --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index c89789bc33..456f85d556 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -407,7 +407,9 @@ public class MenuBuilder { } }); //TODO This feature is under development - view.setVisibility(View.GONE); + if (!OsmandPlugin.isDevelopment()) { + view.setVisibility(View.GONE); + } photoButton = view; return view; } @@ -1220,4 +1222,4 @@ public class MenuBuilder { public static

void execute(AsyncTask task, P... requests) { task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, requests); } -} \ No newline at end of file +} From cf5cc2d4c579b72ad526b13b659e6dd9f9d54b4b Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 27 Nov 2020 17:03:42 +0200 Subject: [PATCH 38/66] bug fix --- .../src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 456f85d556..503e52ecf0 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -122,8 +122,13 @@ public class MenuBuilder { @Override public void onPlaceIdAcquired(String[] placeId) { MenuBuilder.this.placeId = placeId; - if (placeId.length < 2){ - photoButton.setVisibility(View.GONE); + if (placeId.length < 2) { + app.runInUIThread(new Runnable() { + @Override + public void run() { + photoButton.setVisibility(View.GONE); + } + }); } } From 1508b01a3149c389578348c2c9b3e35435962098 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Fri, 27 Nov 2020 18:13:34 +0300 Subject: [PATCH 39/66] Fix lib script --- OsmAnd/build.gradle.lib | 63 ++++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/OsmAnd/build.gradle.lib b/OsmAnd/build.gradle.lib index fa1d94d3ce..419f7dd801 100644 --- a/OsmAnd/build.gradle.lib +++ b/OsmAnd/build.gradle.lib @@ -43,8 +43,6 @@ android { res.srcDirs = ["res"] assets.srcDirs = ["assets"] } - debug { - } legacy { jniLibs.srcDirs = ["libc++"] @@ -342,9 +340,60 @@ task appStart(type: Exec) { artifacts { archives(file("../OsmAnd-java/build/libs/OsmAnd-java-android-1.0.jar")) { - name "OsmAnd-java-android" + classifier "OsmAnd-java-android" + name 'OsmAnd' type "jar" } + archives(file("$buildDir/outputs/aar/OsmAnd-legacy-x86-debug.aar")) { + classifier 'legacyX86Debug' + name 'OsmAnd' + extension 'aar' + } + archives(file("$buildDir/outputs/aar/OsmAnd-legacy-x86-release.aar")) { + classifier 'legacyX86Release' + name 'OsmAnd' + extension 'aar' + } + archives(file("$buildDir/outputs/aar/OsmAnd-legacy-arm64-debug.aar")) { + classifier 'legacyArm64Debug' + name 'OsmAnd' + extension 'aar' + } + archives(file("$buildDir/outputs/aar/OsmAnd-legacy-arm64-release.aar")) { + classifier 'legacyArm64Release' + name 'OsmAnd' + extension 'aar' + } + archives(file("$buildDir/outputs/aar/OsmAnd-legacy-armonly-debug.aar")) { + classifier 'legacyArmonlyDebug' + name 'OsmAnd' + extension 'aar' + } + archives(file("$buildDir/outputs/aar/OsmAnd-legacy-armonly-release.aar")) { + classifier 'legacyArmonlyRelease' + name 'OsmAnd' + extension 'aar' + } + archives(file("$buildDir/outputs/aar/OsmAnd-legacy-armv7-debug.aar")) { + classifier 'legacyArmv7Debug' + name 'OsmAnd' + extension 'aar' + } + archives(file("$buildDir/outputs/aar/OsmAnd-legacy-armv7-release.aar")) { + classifier 'legacyArmv7Release' + name 'OsmAnd' + extension 'aar' + } + archives(file("$buildDir/outputs/aar/OsmAnd-legacy-fat-debug.aar")) { + classifier 'legacyFatDebug' + name 'OsmAnd' + extension 'aar' + } + archives(file("$buildDir/outputs/aar/OsmAnd-legacy-fat-release.aar")) { + classifier 'legacyFatRelease' + name 'OsmAnd' + extension 'aar' + } } // Uploading artifacts to local path @@ -357,14 +406,6 @@ uploadArchives { // } url = System.getenv("OSMAND_BINARIES_IVY_ROOT") ?: "./" - layout "pattern" , { - artifact "[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" - } - -// def gitInfo = "git describe --long".execute().text.trim() -// def parsedGitInfo = Pattern.compile("v(\\d+\\.\\d+)-([\\d.]+)-(\\w+)").matcher(gitInfo) -// assert parsedGitInfo.matches() -// version = parsedGitInfo.group(1) + "-SNAPSHOT" version = "1.0-SNAPSHOT" } } From 6ca63c9a440b394d28c39f5cab22447541c7c9a7 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 27 Nov 2020 17:30:34 +0200 Subject: [PATCH 40/66] Wikivoyage to OBF migration: Work in progress 3-2. pr fixes --- .../src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java | 1 - OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java index 3acc12b79d..0ca212164d 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java @@ -673,7 +673,6 @@ public class TravelDbHelper implements TravelHelper { } public static PopularArticle readArticleFromAmenity(Amenity a, String lang) { - Map additional = a.getAdditionalInfo(); PopularArticle res = new PopularArticle(); res.title = a.getName(lang); res.lat = a.getLocation().getLatitude(); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java index ae621539a3..065aff9e3f 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java @@ -34,7 +34,7 @@ public interface TravelHelper { @NonNull List loadPopularArticles(); - public LinkedHashMap> getNavigationMap( + LinkedHashMap> getNavigationMap( final TravelArticle article); TravelArticle getArticle(long cityId, String lang); @@ -50,7 +50,4 @@ public interface TravelHelper { String getGPXName(TravelArticle article); File createGpxFile(TravelArticle article); - - - } From c456fa10e8e06b8db79e42523b0dd5a5a850ef65 Mon Sep 17 00:00:00 2001 From: ssantos Date: Thu, 26 Nov 2020 22:18:43 +0000 Subject: [PATCH 41/66] Translated using Weblate (Portuguese) Currently translated at 99.2% (3545 of 3570 strings) --- OsmAnd/res/values-pt/strings.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml index cd4664a6dd..d18f8ccd4a 100644 --- a/OsmAnd/res/values-pt/strings.xml +++ b/OsmAnd/res/values-pt/strings.xml @@ -3970,14 +3970,14 @@ Público significa que o rastreamento será mostrado publicamente nos Seus traços de GPS e em listas públicas de rastreamento de GPS. Os dados servidos através da API não fazem referência à sua página de rastreamento. As marcas temporais dos pontos de rastreamento não estão disponíveis através da API pública do GPS e os pontos não estão ordenados cronologicamente. No entanto, outros utilizadores ainda são capazes de descarregar o rastreamento bruto da lista pública de rastreamento e de quaisquer carimbos de tempo contidos nela. Privado significa que o rastreamento não aparecerá em nenhuma listagem pública, mas os pontos de rastreamento dele ainda estarão disponíveis através da API pública do GPS sem carimbos de tempo, mas não serão ordenados cronologicamente. Identificável significa que o rastreamento será mostrado publicamente nos Seus traços de GPS e em listas públicas de rastreamento de GPS, ou seja, outros utilizadores serão capazes de descarregar o rastreamento bruto e associá-lo ao seu nome de utilizador. Os dados servidos através da API dos pontos de rastreamento referenciarão à sua página de rastreamento original. As marcas de tempo dos pontos de rastreamento estão disponíveis através da API pública do GPS. - Rastreável significa que o rastreamento não aparecerá em nenhuma lista pública, mas os pontos de rastreamento a partir dele ainda estarão disponíveis através da API pública do GPS com carimbos de tempo. Outros utilizadores só poderão descarregar pontos de rastreamento processados do seu rastreamento que não podem ser associados diretamente a si. + \"Rastreável\" significa que o rastreamento não aparece em nenhuma listagem pública, mas pontos de rastreamento processados com carimbos de tempo a partir dele (que não podem ser associados diretamente a si) fazem através de descarregadas da API pública do GPS. Fechar nota do OSM Comentário de nota do OSM - Faça login a usar o método seguro OAuth ou use o seu nome de utilizador e a palavra-passe. + Pode fazer login pelo método seguro OAuth ou use o seu nome de utilizador e a palavra-passe. Adicionar fotos Cadastre-se em \nOpenPlaceReviews.org - Faça login no site do projeto de dados abertos OpenPlaceReviews.org para enviar ainda mais fotos. + As fotos são fornecidas pelo projeto de dados abertos OpenPlaceReviews.org. Para enviar as suas fotos precisa cadastrar-se no site. Criar uma conta Já tenho uma conta Histórico de pesquisa @@ -3998,4 +3998,7 @@ Seleccionar os grupos que serão importados. Seleccionar os objectos que serão importados. Utilizar dev.openstreetmap.org + Não é possível enviar a imagem, por favor, tente novamente mais tarde + Selecione a imagem + Mude para usar dev.openstreetmap.org ao invés de openstreetmap.org para testar enviar uma OSM Nota / POI / GPX. \ No newline at end of file From 4622642b8bf6f37c3c1bed0ae5f996a1f98430bc Mon Sep 17 00:00:00 2001 From: Verdulo Date: Thu, 26 Nov 2020 22:16:48 +0000 Subject: [PATCH 42/66] Translated using Weblate (Esperanto) Currently translated at 100.0% (3570 of 3570 strings) --- OsmAnd/res/values-eo/strings.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index d6716c22f0..b85578312f 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -3955,12 +3955,12 @@ Ensaluti al OpenStreetMap Ensaluti al OpenStreetMap.org Ensaluti per OpenStreetMap - Ensalutu por alŝuti novajn aŭ modifitajn ŝanĝojn + Vi devas ensaluti por alŝuti novajn aŭ modifitajn ŝanĝojn. \n -\naŭ per la sekura metodo OAuth aŭ per enigi uzantnomon kaj pasvorton. - Ensaluti per uzantnomo kaj pasvorto +\nVi povas ensaluti per la sekura metodo OAuth aŭ per enigi salutnomon kaj pasvorton. + Ensaluti per salutnomo kaj pasvorto Konto - Uzantnomo + Salutnomo Historio de markoj Sendi GPX‑dosieron al OpenStreetMap Enigu etikedojn disigitajn per komo (,). @@ -3970,11 +3970,11 @@ “Spurebla” signifas, ke la GPX‑spuro ne montriĝos en publikaj listoj, sed pritraktitaj punktoj kun tempindikoj el ĝi (kiuj ne povos esti senpere ligitaj al vi) estos elŝuteblaj per la publika API GPS. Fermi OSM-rimarkon Komenti OSM-rimarkon - Ensalutii per la sekura metodo OAuth aŭ per uzi uzantnomon kaj pasvorton. + Vi povas ensalutii per la sekura metodo OAuth aŭ per uzi salutnomon kaj pasvorton. Aldoni foton Registri ĉe \nOpenPlaceReviews.org - Ensaluti en la paĝon de la malferm‑datuma projekto OpenPlaceReviews.org por alŝuti fotojn. + Fotoj estas liverataj de la malferm‑datuma projekto OpenPlaceReviews.org. Por alŝuti viajn fotojn, vi devas enlasaluti en la retejon. Krei novan konton Mi jam havas konton Serĉi en historio @@ -3996,4 +3996,6 @@ Elektu elementojn por enporti. Baskuli al dev.openstreetmap.org anstataŭ openstreetmap.org por testi alŝuti OSM‑rimarkojn, interesejojn, GPX‑spurojn. Uzi dev.openstreetmap.org + Ne povas alŝuti la bildon, reprovu poste + Elektu bildon \ No newline at end of file From d0acb1d1d47fc84e9a74b998ed8d3a3d6b719cf8 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Sat, 28 Nov 2020 21:14:45 +0200 Subject: [PATCH 43/66] Fix export empty file, refactoring --- .../plus/importfiles/SettingsImportTask.java | 24 ++++++++++--------- .../backend/backup/ProfileSettingsItem.java | 3 --- .../backend/backup/SettingsHelper.java | 22 ++++++----------- .../fragments/ExportSettingsAdapter.java | 9 ++++++- .../fragments/ExportSettingsFragment.java | 7 ++---- 5 files changed, 30 insertions(+), 35 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java b/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java index 99c321adfd..75c8d55015 100644 --- a/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java +++ b/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java @@ -90,14 +90,16 @@ class SettingsImportTask extends BaseLoadAsyncTask { for (PluginSettingsItem pluginItem : pluginSettingsItems) { handlePluginImport(pluginItem, file); } - FragmentActivity activity = activityRef.get(); - if (!pluginIndependentItems.isEmpty() && activity != null) { + if (!pluginIndependentItems.isEmpty()) { if (settingsTypes == null) { - FragmentManager fragmentManager = activity.getSupportFragmentManager(); - ImportSettingsFragment.showInstance(fragmentManager, pluginIndependentItems, file); + FragmentActivity activity = activityRef.get(); + if (activity != null) { + FragmentManager fragmentManager = activity.getSupportFragmentManager(); + ImportSettingsFragment.showInstance(fragmentManager, pluginIndependentItems, file); + } } else { - Map> allSettingsList = getSettingsToOperate(pluginIndependentItems, false); - List settingsList = settingsHelper.getFilteredSettingsItems(allSettingsList, settingsTypes); + Map> allSettingsMap = getSettingsToOperate(pluginIndependentItems, false); + List settingsList = settingsHelper.getFilteredSettingsItems(allSettingsMap, settingsTypes); settingsHelper.checkDuplicates(file, settingsList, settingsList, getDuplicatesListener(file, replace)); } } @@ -130,17 +132,17 @@ class SettingsImportTask extends BaseLoadAsyncTask { return new SettingsImportListener() { @Override public void onSettingsImportFinished(boolean succeed, @NonNull List items) { - FragmentActivity activity = activityRef.get(); - if (activity != null && succeed) { - FragmentManager fm = activity.getSupportFragmentManager(); + if (succeed) { app.getRendererRegistry().updateExternalRenderers(); app.getPoiFilters().loadSelectedPoiFilters(); + AppInitializer.loadRoutingFiles(app, null); + FragmentActivity activity = activityRef.get(); if (activity instanceof MapActivity) { ((MapActivity) activity).getMapLayers().getMapWidgetRegistry().updateVisibleWidgets(); ((MapActivity) activity).updateApplicationModeSettings(); } - AppInitializer.loadRoutingFiles(app, null); - if (file != null) { + if (file != null && activity != null) { + FragmentManager fm = activity.getSupportFragmentManager(); ImportCompleteFragment.showInstance(fm, items, file.getName()); } } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java index 10e47d4e09..4ddb04daab 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/ProfileSettingsItem.java @@ -170,9 +170,6 @@ public class ProfileSettingsItem extends OsmandSettingsItem { builder = ApplicationMode.fromModeBean(app, modeBean); appMode = ApplicationMode.saveProfile(builder, app); } else { - if (modeBean == null) { - modeBean = appMode.toModeBean(); - } builder = ApplicationMode.fromModeBean(app, modeBean); appMode = ApplicationMode.saveProfile(builder, app); } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java index 4553cf805f..c092ae054f 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -481,24 +481,19 @@ public class SettingsHelper { return getFilteredSettingsItems(typesMap, settingsTypes); } - public List getFilteredSettingsItems(Map> additionalData, - List settingsTypes) { + public List getFilteredSettingsItems(Map> allSettingsMap, + List settingsTypes) { List settingsItems = new ArrayList<>(); for (ExportSettingsType settingsType : settingsTypes) { - List settingsDataObjects = additionalData.get(settingsType); + List settingsDataObjects = allSettingsMap.get(settingsType); if (settingsDataObjects != null) { - for (Object object : settingsDataObjects) { - if (object instanceof ApplicationModeBean) { - settingsItems.add(new ProfileSettingsItem(app, null, (ApplicationModeBean) object)); - } - } - settingsItems.addAll(prepareAdditionalSettingsItems(new ArrayList<>(settingsDataObjects))); + settingsItems.addAll(prepareSettingsItems(new ArrayList<>(settingsDataObjects))); } } return settingsItems; } - public Map getAdditionalData(boolean globalExport) { + public Map getSettingsByCategory(boolean globalExport) { Map dataList = new LinkedHashMap<>(); Map> settingsItems = getSettingsItems(globalExport); @@ -692,7 +687,7 @@ public class SettingsHelper { return files; } - public List prepareAdditionalSettingsItems(List data) { + public List prepareSettingsItems(List data) { List settingsItems = new ArrayList<>(); List quickActions = new ArrayList<>(); List poiUIFilters = new ArrayList<>(); @@ -754,10 +749,7 @@ public class SettingsHelper { } if (!appModeBeans.isEmpty()) { for (ApplicationModeBean modeBean : appModeBeans) { - ApplicationMode mode = ApplicationMode.valueOfStringKey(modeBean.stringKey, null); - if (mode != null) { - settingsItems.add(new ProfileSettingsItem(app, mode)); - } + settingsItems.add(new ProfileSettingsItem(app, null, modeBean)); } } if (!osmNotesPointList.isEmpty()) { diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java index d479b78a7c..2c45919f2c 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java @@ -248,7 +248,14 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { } public boolean hasSelectedData() { - return !selectedItemsMap.isEmpty(); + boolean hasSelectedData = false; + for (ExportSettingsType key : selectedItemsMap.keySet()) { + if (!selectedItemsMap.get(key).isEmpty()) { + hasSelectedData = true; + break; + } + } + return hasSelectedData; } public List getData() { diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java index f831fd8fdd..1245290834 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java @@ -44,12 +44,9 @@ public class ExportSettingsFragment extends BaseSettingsListFragment { public static final String TAG = ImportSettingsFragment.class.getSimpleName(); public static final Log LOG = PlatformUtil.getLog(ImportSettingsFragment.class.getSimpleName()); - private static final String EXPORT_SETTINGS_TAG = "import_settings_tag"; private static final String GLOBAL_EXPORT_KEY = "global_export_key"; private static final String EXPORT_START_TIME_KEY = "export_start_time_key"; private static final String EXPORTING_STARTED_KEY = "exporting_started_key"; - private static final String INCLUDE_ADDITIONAL_DATA_KEY = "include_additional_data_key"; - private static final String INCLUDE_GLOBAL_SETTINGS_KEY = "include_global_settings_key"; private static final String PROGRESS_MAX_KEY = "progress_max_key"; private static final String PROGRESS_VALUE_KEY = "progress_value_key"; @@ -76,7 +73,7 @@ public class ExportSettingsFragment extends BaseSettingsListFragment { progressMax = savedInstanceState.getInt(PROGRESS_MAX_KEY); progressValue = savedInstanceState.getInt(PROGRESS_VALUE_KEY); } - dataList = app.getSettingsHelper().getAdditionalData(globalExport); + dataList = app.getSettingsHelper().getSettingsByCategory(globalExport); requireActivity().getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) { @Override @@ -139,7 +136,7 @@ public class ExportSettingsFragment extends BaseSettingsListFragment { showExportProgressDialog(); File tempDir = FileUtils.getTempDir(app); String fileName = getFileName(); - List items = app.getSettingsHelper().prepareAdditionalSettingsItems(adapter.getData()); + List items = app.getSettingsHelper().prepareSettingsItems(adapter.getData()); progress.setMax(getMaxProgress(items)); app.getSettingsHelper().exportSettings(tempDir, fileName, getSettingsExportListener(), items, true); } From 3f6ec04d7ab4bcbc3dc285472cf1bece2fd95a71 Mon Sep 17 00:00:00 2001 From: Hardy Date: Sat, 28 Nov 2020 20:40:47 +0100 Subject: [PATCH 44/66] missing string from https://github.com/osmandapp/OsmAnd/commit/fcc6450e8090cc124d66fe451e3fc65db38112a0#diff-0fdc438434df96f219514a0078b6d16ee6359083df99326aa3c8cef671cb1ea2 --- OsmAnd/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 9da2ac6d86..2a704b8798 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -2468,6 +2468,7 @@ French Georgian German + German (casual) Greek Hebrew Hebrew From 5f4e4bde1257e98b54231407faa4e40a57d29645 Mon Sep 17 00:00:00 2001 From: Hardy Date: Sat, 28 Nov 2020 20:48:46 +0100 Subject: [PATCH 45/66] Allow for casual language suffix --- .../src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java b/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java index b0b0be8baf..36d6e453ce 100644 --- a/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java +++ b/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java @@ -96,7 +96,7 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer, Stat } } else { language = voiceProvider.replace(IndexConstants.VOICE_PROVIDER_SUFFIX, "") - .replace("-formal", ""); + .replace("-formal", "").replace("-casual", ""); } } From 7259c75e8f104112bafef2f543ce5f09e0f0f0ec Mon Sep 17 00:00:00 2001 From: max-klaus Date: Sun, 29 Nov 2020 13:22:02 +0300 Subject: [PATCH 46/66] Fix OsmAnd-java publishing --- OsmAnd-java/build.gradle | 13 ++++++++++++- OsmAnd/build.gradle.lib | 8 -------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/OsmAnd-java/build.gradle b/OsmAnd-java/build.gradle index 2c5415a84f..d461ea8aff 100644 --- a/OsmAnd-java/build.gradle +++ b/OsmAnd-java/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'java' apply plugin: 'maven-publish' +apply plugin: 'ivy-publish' configurations { android @@ -85,12 +86,22 @@ artifacts { } publishing { + repositories { + ivy { + url = System.getenv("OSMAND_BINARIES_IVY_ROOT") ?: "./" + } + } publications { maven(MavenPublication) { artifactId "osmand-base" from components.java } - } + ivyJava(IvyPublication) { + artifact androidJar { + classifier 'android' + } + } + } } dependencies { diff --git a/OsmAnd/build.gradle.lib b/OsmAnd/build.gradle.lib index 419f7dd801..39e4a8e56b 100644 --- a/OsmAnd/build.gradle.lib +++ b/OsmAnd/build.gradle.lib @@ -339,11 +339,6 @@ task appStart(type: Exec) { } artifacts { - archives(file("../OsmAnd-java/build/libs/OsmAnd-java-android-1.0.jar")) { - classifier "OsmAnd-java-android" - name 'OsmAnd' - type "jar" - } archives(file("$buildDir/outputs/aar/OsmAnd-legacy-x86-debug.aar")) { classifier 'legacyX86Debug' name 'OsmAnd' @@ -396,8 +391,6 @@ artifacts { } } -// Uploading artifacts to local path -group = 'net.osmand' uploadArchives { repositories.ivy { // credentials { @@ -406,7 +399,6 @@ uploadArchives { // } url = System.getenv("OSMAND_BINARIES_IVY_ROOT") ?: "./" - version = "1.0-SNAPSHOT" } } From 60099fe61c82ec7e33c84927f13d31aa21f44099 Mon Sep 17 00:00:00 2001 From: josep constanti Date: Sat, 28 Nov 2020 23:04:22 +0000 Subject: [PATCH 47/66] Translated using Weblate (Catalan) Currently translated at 97.2% (3472 of 3571 strings) --- OsmAnd/res/values-ca/strings.xml | 48 +++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml index 7205f99cb0..2132e2152a 100644 --- a/OsmAnd/res/values-ca/strings.xml +++ b/OsmAnd/res/values-ca/strings.xml @@ -233,7 +233,7 @@ Velocitat de simulació de la ruta: Mitjà de transport: Edició fora de línia - Utilitza sempre l\'edició fora de línia. + "En desconnexió la edició està activada però llavors els canvis es desen d\'entrada localment i es pujaran quan es demani; altrament els canvis s\'actualitzen immediatament." Edició asincrònica de l\'OSM: Activa les funcions per a usuaris amb discapacitats. Els canvis realitzats en els PDI a l\'aplicació no afecten els fitxers de mapa baixats, els canvis es desen en un fitxer local. @@ -393,7 +393,7 @@ \n- Indicacions de carril, velocitat màxima permesa, veus enregistrades i sintetitzades \n Seleccioneu el nivell mínim de zoom per mostrar el mapa si està disponible. Caldrà el fitxer SRTM separat: - Aquest connector mostra la configuració de característiques per al desenvolupament i depuració com la verificació o simulació de rutes, el rendiment del renderitzat o les indicacions de veu. Aquestes configuracions s\'adrecen a desenvolupadors i no són d\'utilitat per a un usuari normal. + Configuració de característiques per al desenvolupament i depuració, com simulació de navegació, rendiment de renderitzat o les indicacions de veu. Adreçat a desenvolupadorsimés que a usuaris normals de l\'aplicació. En consonància amb la configuració del sistema Android El nivell de zoom és Trieu l\'estil per indicar direccions relatives mentre s\'està en moviment @@ -1872,8 +1872,8 @@ No hi ha prou espai! \nCalen {3} MB temporalment i {1} MB de permanents. \n(Només es disposa de {2} MB). - Voleu baixar {0} fitxer(s)\? -\nS\'utilitzen {3} MB temporalment i {1} MB permanentment. (De {2} MB). + Voleu baixar {0} fitxer(s)\? +\nS\'utilitzaran {3} MB temporalment i {1} MB permanentment. (De {2} MB). Puja ↑ Baixa ↓ Evita la via @@ -2151,7 +2151,7 @@ Canvia l\'origen del mapa Orígens de mapa Afegeix origen del mapa - L\'origen del mapa s\'ha canviat al de \"%s\". + L\'origen del mapa s\'ha canviat a \"%s\". Modifica la posició del botó Si premeu i arrossegueu alhora, el botó canvia la seva posició a la pantalla. Mostra un diàleg provisional @@ -2364,7 +2364,8 @@ \n• Representació i navegació a mida per ciclistes i vianants \n• Indicació opcional de les parades del transport públic (autobús, tramvia, tren), incloent-hi noms de línia \n• Enregistrament opcional del trajecte en un fitxer GPX local o a un servei a la xarxa -\n• Indicació opcional de la velocitat i l\'altitud • Visualització de corbes de nivell i ombrejat de relleu (requereix connector) +\n• Indicació opcional de la velocitat i l\'altitud +\n• Visualització de corbes de nivell i ombrejat de relleu (requereix connector addicional) Col·laboreu directament a OSM \n• Notifiqueu errors en les dades \n• Pugeu traces GPX directament a OSM des de l\'aplicació @@ -3163,7 +3164,7 @@ Grau 4 Grau 5 Dispositius d\'entrada externs - Seleccioneu un aparell com a teclat genèric o WunderLINQ per a controls externs. + Seleccioneu un aparell de control extern, com un teclat o un WunderLINQ. Cap Teclat WunderLINQ @@ -3869,4 +3870,37 @@ Proporcioneu la llargada del vostre vehicle, pot haver-hi rutes restringides als vehicles llargs. No s\'ha generat correctament l\'arxiu GPX. Indiqueu-ho a l\'equip de suport per continuar investigant. Enregistra automàticament la traça durant la navegació + Cal afegir almenys dos punts + Canvieu per utilitzar dev.openstreetmap.org en lloc d\'openstreetmap.org en provar la pujada de nota OSM / PDI / GPX. + Tanca la nota d\'OSM + Comentari de la nota d\'OSM + Podeu iniciar la sessió mitjançant el mètode segur OAuth o fer servir el vostre usuari i contrasenya. + Afegeix foto + Registreu-vos a +\nOpenPlaceReviews.org + Les fotos les proporciona el projecte OpenPlaceReviews.org de dades obertes. Per poder pujar les vostres fotos, cal que us registreu al lloc web. + Crea un compte nou + ja tinc un compte + Historial de cerques + Caiac + Llanxa motora + No es pot carregar la imatge, torneu-ho a provar més tard + Seleccioneu la imatge + Recursos + Mida aproximada del fitxer + Seleccioneu les dades a exportar cap el fitxer. + Necessari per a la importació + El vostre dispositiu només té %1$s lliures. Allibereu espai o desseleccioneu alguns articles per exportar. + No hi ha prou espai + Seleccioneu els grups que s\'importaran. + Seleccioneu els elements que s\'importaran. + Afegeix a Mapillary + Afegeix-ho a OpenPlaceReviews + Utilitza dev.openstreetmap.org + OsmAnd mostra fotos de diverses fonts: +\nOpenPlaceReviews - fotos de PDIs; +\nMapillary: imatges a nivell de carrer; +\nWeb / Wikimedia: fotos dels PDIs especificats a les dades d\'OpenStreetMap. + %1$s * %2$s + Equipament \ No newline at end of file From f764918aa5333c415bae1d73627e8b4cb35d6872 Mon Sep 17 00:00:00 2001 From: ssantos Date: Sat, 28 Nov 2020 08:16:54 +0000 Subject: [PATCH 48/66] Translated using Weblate (Portuguese) Currently translated at 100.0% (3571 of 3571 strings) --- OsmAnd/res/values-pt/strings.xml | 35 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml index d18f8ccd4a..24862b4584 100644 --- a/OsmAnd/res/values-pt/strings.xml +++ b/OsmAnd/res/values-pt/strings.xml @@ -1682,7 +1682,7 @@ Nome público Não mostrar o meu nome nos relatórios Região de suporte - O nome do ficheiro contém um carácter inválido + Carácter inválido no nome do ficheiro Relatório para Número de colaboradores Número de edições @@ -2301,7 +2301,7 @@ Adiciona paragem inicial Mover o destino para cima e criá-lo Mostrar anotações fechadas - Mostrar/esconder anotações do OSM no mapa. + Mostrar ou ocultar anotações do OSM no mapa. GPX - adequado para exportar para o JOSM ou outros editores do OSM. OSC - adequado para exportar para o OSM. Ficheiro GPX @@ -3084,9 +3084,9 @@ Alterar o zoom do mapa deslocando a roda para cima e para baixo. Escapar devolve-o à aplicação WunderLINQ. Usar WunderLINQ para controle Adicione pelo menos um item à lista nas configurações de \'Ação rápida\' - Esqui alpino/downhill + Esqui alpino e downhill Pistas para esqui alpino ou downhill e acesso a teleféricos de esqui. - Cross Country/esqui nórdico + Cross Country e esqui nórdico Trilhas para esqui nórdico ou cross-country. Passeios de esqui Rotas para excursões de esqui. @@ -3425,7 +3425,7 @@ Sombras de relevo %1$s de %2$s Pistas - Mostrar / ocultar terreno + Mostrar ou ocultar terrenos Ocultar terreno Mostrar terreno Um botão para mostrar ou esconder a camada do terreno no mapa. @@ -3676,11 +3676,11 @@ Combinar categorias de POI de categorias diferentes. Toque em trocar para selecionar tudo, toque no lado esquerdo para seleção da categoria. Ocultar o transporte público Mostrar transporte público - Mostrar/ocultar transporte público + Mostrar ou ocultar transportes públicos Botão que mostra ou oculta o transporte público no mapa. - Criar / Editar POI + Criar ou editar um POI Posições de estacionamento - Adicionar / Editar Favorito + Adicionar ou editar um favorito Restaurar ordem de itens padrão Voltar à edição O botão de ação alterna entre os perfis selecionados. @@ -3869,7 +3869,7 @@ Adicionar ponto de passagem de trilha Gravação de viagem REC - Especifique o intervalo de registo para a gravação geral da faixa (ativado através do widget de gravação Trip no mapa). + Especifique o intervalo de registo para a gravação geral do trilho (ligado através do widget de \'gravação de viagem\' no mapa). Pausar a gravação da viagem Retomar a gravação da viagem Predefinição do sistema @@ -3890,7 +3890,7 @@ Vai pausar o registo de faixas quando a app for morta (através de apps recentes). (indicação de fundo de OsmAnd desaparece da barra de notificação do Android.) - Função atualizada de Planear uma rota: permite utilizar diferentes tipos de navegação por segmento e a inclusão de faixas \n -\n - Novo menu Aparência para trilhos: selecionar cor, espessura, setas de direção de visualização, ícones de início/fim +\n - Novo menu Aparência para trilhos: selecionar cor, espessura, setas de direção de visualização, ícones de início e fim \n \n - Melhoria da visibilidade dos nós da bicicleta. \n @@ -3906,7 +3906,7 @@ Última modificação Nome: Z – A Nome: A – Z - Ícones de início/fim + Ícones de início e fim Obrigado por comprar \'Curvas de nível\' Assinatura cobrada por período selecionado. Cancele-a na AppGallery a qualquer momento. O pagamento será debitado na sua conta AppGallery no momento da confirmação da compra. @@ -3924,10 +3924,10 @@ Roteamento em duas fases para a navegação automotiva. Desenvolvimento nativos de transportes públicos Mudar para Cálculo de rotas de transporte público Java (seguro) - Realize um login OAuth para usar as funcionalidades do osmedit + Entre com o OAuth para usar os recursos do osmedit Fazer login via OAuth Limpar token do OpenStreetMap OAuth - Logout bem sucedido + Saiu O ficheiro já é importado em OsmAnd Usar algoritmo de roteamento de 2 fases A* Para a condução de motos de neve com estradas e pistas dedicadas. @@ -3961,15 +3961,15 @@ Fazer login ao OpenStreetMap Entrar com OpenStreetMap.org Entrar com OpenStreetMap - Usar nome do utilizador e palavra-passe + Usar o nome do utilizador e palavra-passe Conta Entrar Histórico de marcadores Enviar ficherio de GPX ao OpenStreetMap Insira etiquetas separadas por vírgula. - Público significa que o rastreamento será mostrado publicamente nos Seus traços de GPS e em listas públicas de rastreamento de GPS. Os dados servidos através da API não fazem referência à sua página de rastreamento. As marcas temporais dos pontos de rastreamento não estão disponíveis através da API pública do GPS e os pontos não estão ordenados cronologicamente. No entanto, outros utilizadores ainda são capazes de descarregar o rastreamento bruto da lista pública de rastreamento e de quaisquer carimbos de tempo contidos nela. - Privado significa que o rastreamento não aparecerá em nenhuma listagem pública, mas os pontos de rastreamento dele ainda estarão disponíveis através da API pública do GPS sem carimbos de tempo, mas não serão ordenados cronologicamente. - Identificável significa que o rastreamento será mostrado publicamente nos Seus traços de GPS e em listas públicas de rastreamento de GPS, ou seja, outros utilizadores serão capazes de descarregar o rastreamento bruto e associá-lo ao seu nome de utilizador. Os dados servidos através da API dos pontos de rastreamento referenciarão à sua página de rastreamento original. As marcas de tempo dos pontos de rastreamento estão disponíveis através da API pública do GPS. + \"Público\" significa que o rastreamento é mostrado publicamente em Seus traços de GPS e em listas públicas de rastreamento de GPS, e na lista pública de rastreamento com carimbos de data e hora na forma bruta. Os dados servidos através da API não fazem referência à sua página de rastreamento. Os marcadores de ponto de rastreamento não estão disponíveis através da API de GPS pública, e os pontos de rastreamento não estão ordenados cronologicamente. + \"Privado\" significa que o rastreamento não aparece em nenhuma listagem pública, mas os pontos de rastreamento dela em ordem não cronológica estão disponíveis através da API pública do GPS sem carimbos de tempo. + \"Identificável\" significa que o rastreamento será mostrado publicamente em Seus traços de GPS e em listas públicas de rastreamento de GPS, ou seja, outros utilizadoes serão capazes de descarregar o rastreamento bruto e associá-lo ao seu nome de utilizador. Os dados públicos de pontos de rastreamento marcados com a hora da API do GPS servidos através da API de pontos de rastreamento farão referência à sua página de rastreamento original. \"Rastreável\" significa que o rastreamento não aparece em nenhuma listagem pública, mas pontos de rastreamento processados com carimbos de tempo a partir dele (que não podem ser associados diretamente a si) fazem através de descarregadas da API pública do GPS. Fechar nota do OSM Comentário de nota do OSM @@ -4001,4 +4001,5 @@ Não é possível enviar a imagem, por favor, tente novamente mais tarde Selecione a imagem Mude para usar dev.openstreetmap.org ao invés de openstreetmap.org para testar enviar uma OSM Nota / POI / GPX. + %1$s * %2$s \ No newline at end of file From 5027f143264785f47de5743a7a0e56fd6b8c4c26 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Fri, 27 Nov 2020 23:30:15 +0000 Subject: [PATCH 49/66] Translated using Weblate (French) Currently translated at 99.9% (3568 of 3571 strings) --- OsmAnd/res/values-fr/strings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index ac27f7a76e..9e64844dfd 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -3952,7 +3952,7 @@ \n \nsoit avec OAuth soit avec votre identifiant et mot de passe. Vous pouvez vous connecter avec la méthode sécurisée OAuth ou avec votre identifiant et votre mot de passe. - Connectez-vous au site web du projet OpenPlaceReviews.org pour ajouter des photos. + Les photos sont fournies par le projet OpenPlaceReviews.org. Vous devez vous connecter au site web pour envoyer vos photos. Historique de recherche Kayak Votre appareil n\'a que %1$s disponible. Veuillez libérer de l\'espace ou désélectionner l\'export pour certains éléments. @@ -3975,4 +3975,5 @@ Sélectionnez les objets à importer. Impossible d\'envoyer l\'image, veuillez réessayer plus tard Sélectionnez une image + %1$s * %2$s \ No newline at end of file From bfe6c65f1c84f308f66eced592db92e596d2232a Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 28 Nov 2020 10:44:18 +0000 Subject: [PATCH 50/66] Translated using Weblate (German) Currently translated at 99.9% (3570 of 3571 strings) --- OsmAnd/res/values-de/strings.xml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 6c824c4e78..a29f18e979 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -3957,13 +3957,13 @@ OsmAnd Live Abonnement ist abgelaufen OsmAnd Live Abonnement wurde ausgesetzt OsmAnd Live Abonnement liegt auf Eis - Anmeldung für OpenStreetMap - Anmeldung für OpenStreetMap.org + Bei OpenStreetMap anmelden + Bei OpenStreetMap.org anmelden Anmelden mit OpenStreetMap - Melden Sie sich an, um Änderungen hochzuladen, + Sie müssen sich anmelden, um Änderungen hochzuladen. \n -\nentweder mit OAuth oder mit Ihrem Benutzernamen und Passwort. - Anmelden mit Benutzername und Passwort +\nSie können sich mit der sicheren OAuth-Methode anmelden oder Ihren Benutzernamen und Ihr Passwort verwenden. + Benutzername und Passwort verwenden Konto Benutzername Historie der Marker @@ -3975,11 +3975,11 @@ \"Verfolgbar\" bedeutet, dass die Spur nicht in öffentlichen Auflistungen auftaucht, aber verarbeitete Trackpunkte mit Zeitstempeln davon (die nicht direkt mit Ihnen in Verbindung gebracht werden können) durch Downloads von der öffentlichen GPS API. OSM Notiz schließen OSM Notiz kommentieren - Melden Sie sich mit der sicheren OAuth-Methode an oder verwenden Sie Ihren Benutzernamen und Ihr Passwort. + Sie können sich mit der sicheren OAuth-Methode anmelden oder Ihren Benutzernamen und Ihr Passwort verwenden. Foto hinzufügen Registrieren bei \nOpenPlaceReviews.org - Melden Sie sich auf der Open Data Website OpenPlaceReviews.org an, um noch mehr Fotos hochzuladen. + Fotos werden vom offenen Datenprojekt OpenPlaceReviews.org zur Verfügung gestellt. Um Ihre Fotos hochladen zu können, müssen Sie sich auf der Website anmelden. Neues Konto erstellen Ich habe bereits ein Konto Suchverlauf @@ -4001,4 +4001,7 @@ Wählen Sie Elemente aus, die importiert werden sollen. Wechseln Sie zu dev.openstreetmap.org anstelle von openstreetmap.org, um das Hochladen von OSM-Hinweisen / POI / GPX zu testen. dev.openstreetmap.org verwenden + Bild kann nicht hochgeladen werden, bitte versuchen Sie es später erneut + Bild auswählen + %1$s * %2$s \ No newline at end of file From 40fe7b19f00078a8f0b7824e9e9021a5edf14a8b Mon Sep 17 00:00:00 2001 From: Artem Date: Sat, 28 Nov 2020 09:52:17 +0000 Subject: [PATCH 51/66] Translated using Weblate (Russian) Currently translated at 99.8% (3567 of 3571 strings) --- OsmAnd/res/values-ru/strings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 1ae090253b..25e450c5d3 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3480,7 +3480,7 @@ Заменить все Оставить оба Импортированные элементы будут добавлены с префиксом - В OsmAnd уже есть элементы с теми же именами, что и импортированные. + В OsmAnd уже есть элементы с такими же именами, как у импортированных. \n \nВыберите действие. Некоторые элементы уже существуют @@ -3992,4 +3992,5 @@ Невозможно отправить изображение, попробуйте позже Выбор изображения Каяк + %1$s * %2$s \ No newline at end of file From 32168d90afbd300e9a77f2a105734fde9435e37c Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Sat, 28 Nov 2020 18:01:25 +0000 Subject: [PATCH 52/66] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3571 of 3571 strings) --- OsmAnd/res/values-uk/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index a9a6d024db..3e9e76b023 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -3995,4 +3995,5 @@ Використовувати dev.openstreetmap.org Не вдається завантажити зображення, повторіть спробу пізніше Вибрати зображення + %1$s * %2$s \ No newline at end of file From 153e6c69dbf42ae7459dbf673e02b2af407e8f43 Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Sat, 28 Nov 2020 08:28:16 +0000 Subject: [PATCH 53/66] Translated using Weblate (Italian) Currently translated at 89.1% (3184 of 3571 strings) --- OsmAnd/res/values-it/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index a8c2b32d25..c83c5e1385 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -3997,4 +3997,5 @@ Utilizza dev.openstreetmap.org Impossibile caricare l\'immagine, riprovare in seguito Scegli la foto + %1$s * %2$s \ No newline at end of file From 09eb24fccdda3fc8ad2f622eebb657c7b219ba75 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Fri, 27 Nov 2020 22:37:41 +0000 Subject: [PATCH 54/66] Translated using Weblate (Slovak) Currently translated at 99.5% (3556 of 3571 strings) --- OsmAnd/res/values-sk/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 264a62d5fb..840c817c8e 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -3993,4 +3993,6 @@ Zvoľte položky, ktoré budú importované. Prepnúť na dev.openstreetmap.org namiesto openstreetmap.org pre otestovanie odosielania OSM poznámok / bodov záujmu / GPX stôp. Použiť dev.openstreetmap.org + + \ No newline at end of file From 82535134aadd86a009da43452821fbe415021e7d Mon Sep 17 00:00:00 2001 From: D M Date: Sat, 28 Nov 2020 22:28:12 +0000 Subject: [PATCH 55/66] Translated using Weblate (Serbian) Currently translated at 100.0% (3571 of 3571 strings) --- OsmAnd/res/values-sr/strings.xml | 189 +++++++++++++++++++++++-------- 1 file changed, 143 insertions(+), 46 deletions(-) diff --git a/OsmAnd/res/values-sr/strings.xml b/OsmAnd/res/values-sr/strings.xml index c96a4e09e4..734562aaca 100644 --- a/OsmAnd/res/values-sr/strings.xml +++ b/OsmAnd/res/values-sr/strings.xml @@ -257,7 +257,7 @@ Језик није подржан Недостају подаци Отићи до продавнице да скинете изабрани језик? - Обрни GPX смер + Обрни смер стазе Излаз гласовног навођења Звук долазног позива (прекида и блутут у колима) Звучно обавештење @@ -964,8 +964,8 @@ Одреди %1$d излаз и иди Отпреми тачку од интереса Прорачун путање - Још увек немате ниједан GPX фајл - Такође, можете додати GPX фајлове у фасциклу + Још увек немате ниједну датотеку стаза + Такође, можете додати фајлове стаза у фасциклу Додај још… Изглед Укључи брзо снимање @@ -1024,7 +1024,7 @@ Захтеване за преузимање. Претражујем положај… Слободно место складишта - OsmAnd складиште података (за карте, GPX фајлове итд.): %1$s. + OsmAnd складиште података (за карте, фајлове стаза итд.): %1$s. Дајте дозволе Омогућите приступ одређивању положаја Узми упутства и откриј нова места, и без интернета @@ -1244,7 +1244,7 @@ Омогућава брзи допринос Мапилару. Отвори Мапилар Мрежне слике улица за све. Откријте места, сарађујте, освојите свет. - Слике на нивоу улице + Мапилари Мрежне слике улица за све. Откријте места, сарађујте, освојите свет. Ваше одредиште се налази на приватном поседу. Дозволити коришћење приватних путева на овом путовању\? Препокрени претрагу @@ -1579,7 +1579,7 @@ Тренутна Додаје пролазно стајање Додаје прво стајање - Прикажи/сакриј ОСМ белешке на карти. + Прикажи или сакриј ОСМ белешке на карти. GPX фајл • Ново: Подршка за глобалне туристичке водиче без потребе за интернет конекцијом. Референтни положаји су повезани на карти. Иницијални подаци са сајта Wikivoyage. \n @@ -1781,7 +1781,7 @@ У последњих пар метара Обавештење о доласку Колико брзо желите да добијете обавештење о пристизању? - Користи уређивање без мреже. + Ако је омогућено уређивање ван мреже, тада ће се промене прво сачувати локално и отпремити по захтеву, у супротном ће се промене одмах отпремити. Отпремам… {0} тачака од интереса/белешки отпремљено Отпреми све @@ -1812,7 +1812,7 @@ Опште Опште поставке апликације Ваше ОСМ корисничко име - Ваша ОСМ лозинка + Лозинка Прозирна тема Обриши %1$s? Засеок @@ -2156,7 +2156,7 @@ Морате имати интернет да бисте инсталирали овај додатак. Преузми Пмаетно прерачунавање пута - За дужа путовања, прерачунавај само први део пута. + Прерачунава само почетни део руте. Може се користити за дуга путовања. Да ли Вам се OsmAnd свиђа? Важно нам је да чујемо Ваше мишљење. Оцените ову апликацију @@ -2216,7 +2216,7 @@ Ујутро Број сарадника Број измена - Име фајла садржи недозвољене карактере + Недозвољен знак у имену датотеке Брзе радње Радња %d Екран %d @@ -2954,10 +2954,10 @@ Прикажи још Приказане путање Укрцавање на стајању - Прикажи/сакриј GPX путање - Дугме које приказује или сакрива одабране GPX путање са карте. - Сакриј GPX путање - Прикажи GPX путање + Прикажи/сакриј путање + Дугме које приказује или сакрива одабране путање са карте. + Сакриј путање + Прикажи путање Омогући јавни превоз на OsmAnd Live изменама. OsmAnd Live јавни превоз Калдрма @@ -3136,9 +3136,9 @@ Сакриј лењир компас Базирајте Ваш произвољни профил на једном од подразумеваних профила, овим се одређују основне поставке као што су подразуемвана видљивост справица или јединице брзине и даљине. Ово су подразумевани апликативни профили, заједно са примерима произвољних профила којима се може проширити: Додајте бар једну ставку на поставкама у „Брзим радњама“ - Алпско/спуст скијање + Алпско и спуст скијање Падине алпског скијања или спуста и приступ ски лифтовима. - Крос-кантри/нордијско скијање + Крос-кантри и нордијско скијање Путеви за нордијско или крос-кантри скијање. Ски туре Путање ски тура. @@ -3363,7 +3363,7 @@ Замени %1$s и %2$s Почетна тачка Стаза сачувана - Име фајла је празно + Празно име датотеке Поврати Дугме које центар екрана узима за тачку поласка. После пита да одаберете одредиште или рачуна пут до одредишта. Прикажи чворове мреже бициклистичких путева @@ -3425,9 +3425,9 @@ Прерачунавање пута Објави Корисничко име и лозинка - Ове поставке се примењују на све профиле. + Ова подешавања додатака су глобална и примењују се на све профиле OSM уређивање - Погледајте Ваше измене или OSM грешке које још нису отпремљене у %1$s. Отпремљене тачке се више неће приказивати. + Све своје још увек не отпремљене измене или ОСМ белешке можете погледати у %1$s. Отпремљене тачке се не приказују у ОсмАнду. OSM Иконица која се приказује за време навођења или померања. Иконица која се приказује у мировању. @@ -3547,7 +3547,7 @@ Поврати све поставке профила\? Чувам нови профил Не могу да направим резервну копију профила. - Прикажи / сакриј терен + Прикажи или сакриј терен Сакриј терен Прикажи терен Дугме да прикаже или сакрите слој терена на карти. @@ -3570,8 +3570,8 @@ Сви језици Не може се наћи такав профил. Светска општа мапа (детаљна) - Креирај / Уреди ПОИ - Додај / Уреди фаворит + Направите или измените ПОИ + Додајте или измените омиљено Повратак уређивању Додај профил Промени профил апликације @@ -3590,7 +3590,7 @@ Профили навођења Сакриј јавни превоз Прикажи јавни превоз - Прикажи/сакриј јавни превоз + Прикажи или сакриј јавни превоз Дугме које приказује или скрива јавни превоз на карти. Паркинг позиције Поврати подразумевани поредак ставки @@ -3642,12 +3642,12 @@ Можете подесити висину пловила да избегнете ниске мостове. Имајте на уму да, уколико мост може да се помера, користићемо његову висину када је отворен. Подесите висину пловила да избегнете ниске мостове. Имајте на уму да, уколико мост може да се помера, користићемо његову висину када је отворен. Подесите ширину пловила и избегните уске мостове - Укључите да омогућите контролу нивоа увећања са дугмићима за јачину звука. + Контролишите ниво зумирања на мапи помоћу дугмића за јачину звука на уређају. Дугмићи за јачину звука за зумирање Деинсталирај и поново покрени Овај уређај нема радаре. Ролери - Поновно покретање је потребно да се потпуно избришу подаци о радарима. + Поново покрените апликацију да бисте избрисали све податке брзинских камера. %1$s обрисано Лимит дужине Курс @@ -3744,14 +3744,14 @@ Додатне мапе су потребне да бисте видели нагибе на мапи. Можете прочитати више о нагибима у %1$s. Омогућите да би видели сенке брда или мапе нагиба. Можете прочитати више о овим врстама карта на нашем сајту. - Сви подаци %1$S су увезени, можете да употребите дугмад испод да би сте отворили неопходни део апликације ради управљања њима. - Османд проверава %1$S постојање дупликата са постојећим елементима у апликацији. + Сви подаци из %1$s су увезени, можете да употребите дугмад испод да би сте отворили неопходни део апликације ради управљања њима. + Османд проверава %1$s постојање дупликата са постојећим елементима у апликацији. \n \nТо може да потраје неко време. Нагиби Прилагодите количину елемената у \"Фиоци\", \"Подешавању мапе\" и \"Контекст менију\". \n -\nОнемогућите некоришћене додатке да сакријете све њихове контроле. %1$е. +\nОнемогућите некоришћене додатке да сакријете све њихове контроле. %1$s. Елементи Фиоке, Контекст мени Акције Контекст менија Наплатом ће бити оптерећен ваш Гугл Плеј налог при потврди куповине. @@ -3787,18 +3787,18 @@ \n \n%2$s: су нивои при којима ће оригиналне плочице бити видљиве, а умањење или увећање биће изван ових вредности. Унесите дужину возила, нека ограничења пута могу бити примењена за дужа возила. - Обриши следећу одредишну тачку + Обриши најближу одредишну тачку Молимо одредите име тачке Тренутна одредишна тачка биће уклоњена. Ако је она одредишна, стопираће се навигација. Преузмите мапе Википедије - Информације о тачкама од интереса потражите од Википедије. То је ваш џепни ванмрежни водич - само омогућите додатак Википедиа и уживајте у чланцима о објектима око вас. + Информације о тачкама од интереса потражите на Википедији. То је ваш џепни ванмрежни водич - само укључите додатак Википедија и уживајте у чланцима о објектима око вас. Ендуро скутер Скутер Инвалидска колица Инвалидска колица напред Корпа Затворена ОСМ белешка - За наставак морате да одредите радне дане + За наставак одредите радне дане Рута између тачака Планирај руту Додајте стази @@ -3809,7 +3809,7 @@ Стрелице смера Чврст Додата тачка неће бити видљива на мапи, пошто је одабрана група сакривена, можете је пронаћи у „%s“. - Прикажи почетно крајне иконе + Прикажи почетне и крајне иконе Последње измењена Увези путању Отвори постојећу путању @@ -3820,25 +3820,23 @@ Сачувај као нову стазу Обрнута рута Читава стаза ће се прерачунати користећи одабрани профил. - Само ће се следећи сегмент прерачунати користећи одабрани профил. - Изаберите како повезати тачке, са правом линијом, или израчунајте руту између њих са одабраним профилом. + Само ће следећи сегмент бити прерачунат користећи одабрани профил. + Изаберите како повезати тачке, по правој линији, или израчунајте руту између њих како је доле назначено. Цела стаза Следећи сегмент - Да бисте користили ову опцију, ОсмАнд мора да прилагоди вашу стазу путевима на мапи. -\n -\n На следећем кораку мора ћете одабрати навигацијски профил како бисте открили дозвољене путеве и праг удаљености и тиме приближили вашу стазу путевима. + Затим помоћу једног од ваших навигационих профила прислоните стазу на најближи дозвољени пут да бисте користили ову опцију. Праг удаљености Навигацијски профил Изаберите датотеку записа којој ће се додати нови сегмент. Слике на нивоу улице - Јесте ли сигурни да желите затворити План руте без чувања\? Изгуби ћете све промене. + Да ли сте сигурни да желите да одбаците све промене на планираној рути затварањем\? У случају обрнутог правца Сачувај као нову датотеку стазе Додај у датотеку стазе Путање Путање Путање - GPX + РЕК Уписуј путању у GPX фајл Траса руте Додајте датотеке стаза @@ -3849,9 +3847,9 @@ Сачувај као датотеку стазе Следи стазу Изаберите датотеку стазе ради праћења - Изаберите датотеку стазе ради праћења или увоза са уређаја. + Изаберите датотеку стазе ради праћења или увоза са вашег уређаја. Изаберите другу стазу - Наводите од моје локације до стазе + Наводите од моје позиције до стазе Тачка стазе за навигацију Почетак стазе Најближа тачка @@ -3865,20 +3863,20 @@ Промените врсту руте након Шта је ново Име фајла - + %s изабраних датотека стаза Паузирај снимање пута Додајте бар две тачке. - Одјава успешна + Одјављен „Приватно“ значи да се траг не појављује ни на једној јавној листи, али су тачке праћења у њему у нехронолошком редоследу доступне путем јавног ГПС АПИ-ја без временских ознака. „Могуће је идентификовати“ значи да ће се траг јавно приказати у вашим ГПС траговима и у јавним списковима ГПС трагова, тј. други корисници ће моћи да преузму необрађени траг и повежу га са вашим корисничким именом. Јавни подаци о временским тачкама трага из ГПС АПИ-ја који се сервирају путем АПИ-ја за тачке праћења имаће референцу на вашу оригиналну страницу праћења. „Следљиво“ значи да се траг не приказује нигде на јавним листама, али обрађене тачке праћења са временским ознакама у њима (које не могу бити директно повезане са вама) иду кроз преузимања са јавног ГПС АПИ-ја. Затвори ОСМ белешку Коментар ОСМ напомене - Пријавите се помоћу сигурне методе ОАутх или користите своје корисничко име и лозинку. + Можете се пријавити користећи безбедан ОАут метод или користити своје корисничко име и лозинку. Додај фотографију Региструјте се на -\nOpenPlaceReviews. - Пријавите се на веб локацију пројекта отворених података OpenPlaceReviews.орг да бисте отпремили још више фотографија. +\nOpenPlaceReviews.org + Фотографије пружа пројекат отворених података OpenPlaceReviews.org. Да бисте поставили своје фотографије, морате се пријавити на веб страницу. Направите нови налог Већ имам Претрага @@ -3896,4 +3894,103 @@ Потребно за увоз Уређај има слободно само %1$s. Ослободите мало простора или поништите одабир неких предмета за извоз. Нема довољно простора + Иконе за почетак и завршетак + МГРС + За вожњу моторних санки са наменским путевима и стазама. + МГРС + ОсмАнд користи МГРС, који је сличан УТМ НАТО формату. + Поједностављена стаза + Само линија руте ће бити сачувана, а путне тачке ће бити избрисане. + Паузираће евидентирање стазе када се апликација убије (преко скорашњих програма). (Индикатор рада OsmAnd-а у позадини тада нестаје из обавештајне траке.) + Наведите интервал евидентирања за опште снимање стаза (укључено помоћу виџета „Снимање путовања“ на мапи). + Наставите снимање путовања + Системско подразумевана + Сви наредни сегменти + Претходни сегмент + Сви претходни сегменти + Само изабрани сегмент ће се поново израчунати помоћу изабраног профила. + Сви наредни сегменти ће се поново израчунати помоћу изабраног профила. + Сви претходни сегменти ће се поново израчунати помоћу изабраног профила. + Отвори сачувану + је сачувано + Понови + • Ажурирано Функција планирања руте: омогућава употребу различитих типова навигације по сегменту и укључивање стаза +\n +\n • Нови мени Изглед за стазе: одаберите боју, дебљину, стрелице смера приказа, иконе почетка и завршетка +\n +\n • Побољшана видљивост бициклистичких чворова. +\n +\n • Стазе се сада могу додирнути, имају контекстуални мени са основним информацијама. +\n +\n • Побољшани алгоритми претраге +\n +\n • Побољшане опције праћења стаза у Навигацији +\n +\n • Решени проблеми са увозом / извозом подешавања профила +\n +\n + Последња измена + Име: З - А + Име: А - З + Хвала вам што сте купили „Контурне линије“ + Претплата се наплаћује по изабраном периоду. Откажите га у АппГалери у било ком тренутку. + Уплата ће бити наплаћена са вашег рачуна АппГалери при потврди куповине. +\n +\nПретплата се аутоматски обнавља уколико није отказана пре датума обнове. Ваш рачун ће бити задужен за период обнове (месец / три месеца / година) само на датум обнове. +\n +\nПретплатама можете управљати и отказати их тако што ћете отићи у подешавања апликације АппГалери. + Избегавајте пешачке стазе + Избегавајте пешачке стазе + Развој + ОсмАнд лајв подаци + ОсмАнд лајв подаци + Двофазно усмеравање за аутомобилску навигацију. + Развој матичног јавног превоза + Пребаците се на Јава (безбедан) прорачун рутирања јавног превоза + Пријавите се помоћу ОАут-а да бисте користили осм уређивачке функције + Пријавите се преко ОАут-а + Обришите ОпенСтритМап ОАут токен + Датотека је већ увезена у ОсмАнд + Користите двофазни алгоритам усмеравања А* + Графикон + %1$s подаци доступни само на путевима, морате израчунати руту користећи „Рута између тачака“ да бисте је добили. + Сачекајте поновно израчунавање руте. +\nГрафикон ће бити доступан након поновног израчунавања. + Локалне мапе + %1$s — %2$s + Размак + Аменити + Специал + Превоз + Услуга + Симболи + Спорт + Хитна помоћ + Путовање + Треба да додате најмање две тачке + Пријавите се на OpenStreetMap.org + Пријавите се на OpenStreetMap.org + Пријавите се помоћу ОпенСтритМап + Морате се пријавити да бисте отпремили нове или измењене промене. +\n +\nМожете се пријавити користећи безбедан ОАут метод или користите своје корисничко име и лозинку. + Користите корисничко име и лозинку + Налог + Пријавите се + Управљајте претплатом + Постоји проблем са вашом претплатом. Кликните на дугме да бисте отворили подешавања претплате за Гугле Плеј и да бисте поправили начин плаћања. + Претплата на ОсмАнд лајв је истекла + Претплата на ОсмАнд лајв је паузирана + Претплата на ОсмАнд лајв је на чекању + Историја маркера + Пошаљите ГПКС датотеку на ОпенСтритМап + Унесите ознаке одвојене зарезом. + „Јавно“ значи да је траг јавно приказан у вашим ГПС траговима и на јавним ГПС траговима, као и на јавном списку трагова са временским ознакама у сировом облику. Подаци који се приказују путем АПИ-ја не упућују на вашу страницу трагова. Временске ознаке праћења нису доступне путем јавног ГПС АПИ-ја и тачке праћења нису хронолошки поређане. + Није могуће отпремити слику, покушајте поново касније + Изаберите слику + Изаберите групе које ће бити увезене. + Изаберите ставке које ће бити увезене. + Пређите на употребу dev.openstreetmap.org уместо на openstreetmap.org да бисте тестирали отпремање ОСМ белешке / ПОИ / ГПКС. + Употреби dev.openstreetmap.org + %1$s * %2$s \ No newline at end of file From 5335bf6dd4ccfb859fa622535627c132f27ddabf Mon Sep 17 00:00:00 2001 From: Ahmad Alfrhood Date: Sat, 28 Nov 2020 18:19:13 +0000 Subject: [PATCH 56/66] Translated using Weblate (Arabic) Currently translated at 100.0% (3571 of 3571 strings) --- OsmAnd/res/values-ar/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index e7f575f576..c218ee7f72 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3986,4 +3986,5 @@ استخدم dev.openstreetmap.org لا يمكن تحميل الصورة، من فضلك، حاول مرة أخرى في وقت لاحق تحديد صورة + %1$s * %2$s \ No newline at end of file From 2fb9175fee2ffa2a89e39f62a66b08f800e0ec66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Kotr=C4=8D?= Date: Sat, 28 Nov 2020 18:23:51 +0000 Subject: [PATCH 57/66] Translated using Weblate (Czech) Currently translated at 94.4% (3372 of 3571 strings) --- OsmAnd/res/values-cs/strings.xml | 204 ++++++++++++++++--------------- 1 file changed, 105 insertions(+), 99 deletions(-) diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index 4c4069ba02..e4b9250390 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -117,9 +117,8 @@ Služba na pozadí OsmAnd běží na pozadí i při vypnuté obrazovce. Nedostatek místa pro stažení %1$s MB dat (volné: %2$s). - Stáhnout {0} soubor(ů)? - V úložišti je zapotřebí {1} MB. - (Aktuálně je k dispozici {2} MB.) + Stáhnout {0} soubor(ů)\? +\nBude použito {1} MB (z {2} MB). Transparentní téma Android native library není podporovaná na tomto zařízení. Probíhá inicializace Android native library… @@ -535,14 +534,14 @@ Určete nastavení OpenStreetMap.org (OSM) potřebné pro přispívání. Volba jazyka, stažení a aktualizace dat. Data - Editace OSM + Editace OpenStreetMap Zvětšení podle rychlosti pohybu (když je mapa synchronizována s aktuální pozicí). Automatické zvětšení mapy Další nastavení Nastavení Uložit aktuální trasu jako soubor GPX. Uložit aktuální trasu - Vyberte interval pro ukládání trasy během navigace. + Zadejte interval pro ukládání trasy během navigace Interval ukládání trasy během navigace Během navigace budou GPX trasy automaticky ukládány do adresáře s trasami. Aktualizovat mapu @@ -615,7 +614,7 @@ Hlášení Jméno autora Komentář přidán - Nepodařilo se přidat komentář + Nepodařilo se přidat komentář. Upravit POI Vytvořit POI Uzel nelze nalézt nebo vybavení sestává z několika uzlů, které ještě nejsou podporovány. @@ -651,18 +650,18 @@ Používat on-line mapy (ukládat dlaždice do mezipaměti na paměťové kartě). On-line mapy Nastavení rastrových překryvných nebo podkresových map. - S tímto modulem můžete použít mnoho druhů on-line map (tzv. dlaždicové nebo rastrové mapy), od předdefinovaných OpenStreetMap dlaždic (jako Mapnik) až po satelitní snímky a speciální vrstvy jako mapy počasí, klimatické mapy, geologické mapy, stínované vrstvy, atd. + Získejte přístup k mnoha druhům on-line map (tzv. dlaždicové nebo rastrové mapy), od předdefinovaných OpenStreetMap dlaždic (jako Mapnik) až po satelitní snímky a speciální vrstvy jako mapy počasí, klimatické mapy, geologické mapy, stínované svahy, atd. \n -\nVšechny tyto mapy mohou být použity jako hlavní (základní) mapa na obrazovce OsmAnd nebo jako překryvná popř. podkladová mapa k jiné základní mapě (např. standardní OsmAnd off-line mapě). Pro zlepšení viditelnosti podkladových map je možné vypnout některé objekty z vektorových map OsmAnd, přes menu \'Nastavení mapy\'. +\n Všechny tyto mapy mohou být použity jako hlavní (základní) mapa na obrazovce OsmAnd nebo jako překryvná popř. podkladová mapa k jiné základní mapě (např. standardní OsmAnd off-line mapě). Pro zlepšení viditelnosti podkladových map je možné vypnout některé objekty z vektorových map OsmAnd, přes menu \'Nastavení mapy\'. \n -\nDlaždicové mapy můžete získat přímo z on-line zdrojů nebo si je můžete připravit pro off-line použití (zkopírovat ručně do datového adresáře OsmAnd) jako SQLite databázi, která může být vytvořena mnoha programy pro přípravu map. +\n Dlaždicové mapy můžete získat přímo z on-line zdrojů nebo si je můžete připravit pro off-line použití (zkopírovat ručně do datového adresáře OsmAnd) jako SQLite databázi, která může být vytvořena mnoha programy pro přípravu map. Zobrazí nastavení pro zapnutí záznamu trasy a navigace na pozadí s pravidelným probouzením GPS zařízení (s vypnutou obrazovkou). - Tento modul zobrazí nastavení pro speciální funkce ulehčení přístupu přímo v OsmAnd. Například je možné měnit rychlost TTS hlasu, použít trackball na přibližování nebo například použít hlasové předčítání pro oznamování polohy. - Tento modul zobrazí nastavení vývojových a ladících funkcí, jako jsou simulace navigace, informace o rychlosti vykreslování nebo hlasová oznámení. Tato nastavení jsou určené pro vývojáře a nejsou potřebné pro běžné použití. + Zobrazí funkce usnadnění přístupu přímo v OsmAnd. Například je možné měnit rychlost TTS hlasu, nastavit navigování pomocí D-padu, použít trackball na přibližování nebo použít hlasové předčítání pro oznamování polohy. + Nastavení funkcí pro vývoj a ladění, jako jsou simulace navigace, informace o rychlosti vykreslování nebo hlasová oznámení. Tato nastavení jsou určená pro vývojáře a nejsou potřebná pro běžné použití. Správce modulů Moduly umožňují zapnout pokročilé nastavení a přídavné funkce. Moduly - Pomocí tohoto modulu může být OsmAnd použit na přispívání do OSM, například vytvářením nebo úpravami POI, vytvářením nebo komentováním OSM poznámek a přispíváním zaznamenanými GPX soubory. OSM je celosvětový komunitní projekt mapování. Pro více detailů se podívejte na https://openstreetmap.org. Aktivní účast je vítaná a příspěvky mohou být vytvářené přímo v OsmAnd, jestliže zadáte své osobní přihlašovací údaje do OSM. + Po zadání svých přihlašovacích údajů můžete přispívat do OSM - například vytvářením nebo úpravami bodů zájmu, otevíráním nebo komentováním OSM poznámek a přidáváním zaznamenanými GPX soubory. OSM je celosvětový komunitní projekt mapování. Akcelerace vykreslování pomocí \'Android native\' knihovny. Vektorové mapy se zpravidla vykreslují rychleji, pokud je tato možnost zaškrtnuta. Avšak na některých zařízeních tato funkce nemusí fungovat. Přehrát hlasové pokyny zvoleným hlasem Vývoj a ladění OsmAnd @@ -715,7 +714,8 @@ odpoledne dopoledne Místo parkování - Modul Parkovací místo umožňuje zaznamenání, kde jste zaparkovali své auto, a v případě časově omezeného parkování také kolik času zbývá. Parkovací místo a čas parkování můžete najít na panelu aktuální mapy. Je také možné přidat upomínku do kalendáře, pokud chcete být upozorněni. + Umožňuje zaznamenat, kde jste zaparkovali své auto, včetně zbývajícího času parkování. +\n Místo i čas jsou zobrazené na hlavním panelu i na mapovém widgetu. Je také možné přidat upomínku do kalendáře Android. Parkovací místo Označit jako místo parkování Smazat místo parkování @@ -880,7 +880,7 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Přehrát Zvukové/video poznámky Měření vzdálenosti - Modul Audio/video poznámek poskytuje funkce k vytváření záznamů zvukových/fotografických/video poznámek během cesty, buď tlačítkem na mapové obrazovce nebo přímo v kontextovém menu bodu na mapě. + Vytvářejte zvukové/fotografické/video poznámky během cesty, buď tlačítkem na mapové obrazovce nebo v kontextovém menu bodu na mapě. části Nahrát video Nahrát zvuk @@ -908,9 +908,9 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Modul Vrstevnice Zastavit Modul Dropbox vám umožňuje synchronizovat trasy, audio a video poznámky s vaším účtem Dropbox. - Tento modul poskytuje zobrazení vrstevnic a vrstvy stínování kopců, které mohou být zobrazené na standardních OsmAnd mapách. Tato funkce je vhodná především pro sportovce, turisty, chodce a vůbec všechny, které zajímá profil terénu. -\n -\nCelosvětová výšková data (mezi 70° severní šířky a 70° jižní šířky) se zakládají na měřeních SRTM (Shuttle Radar Topography Mission) a ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), snímkovací přístroj na palubě satelitu Terra, vlajkového satelitu Systému pozorování Země NASA. ASTER je společným projektem NASA, japonského ministerstva hospodářství, obchodu a průmyslu (METI) a Japan Space Systems (J-spacesystems). + Tento modul poskytuje zobrazení vrstevnic a vrstvy stínování kopců, které mohou být zobrazené na standardních OsmAnd mapách. Tato funkce je vhodná především pro sportovce, turisty, chodce a vůbec všechny, které zajímá profil terénu. +\n +\nCelosvětová výšková data (mezi 70° severní šířky a 70° jižní šířky) se zakládají na měřeních SRTM (Shuttle Radar Topography Mission) a ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), snímkovacího přístroje na palubě satelitu Terra, vlajkového satelitu Systému pozorování Země NASA. ASTER je společným projektem NASA, japonského ministerstva hospodářství, obchodu a průmyslu (METI) a Japan Space Systems (J-spacesystems). Opravdu chcete zastavit navigaci? Opravdu chcete smazat svůj cíl (a mezicíle)? Zobrazit @@ -951,7 +951,7 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Vybrat Oblíbené Editace OSM Další akce - Konfigurace záznamů vašich cest. + Nastavte, jak se budou zaznamenávat vaše cesty. Instalovat plnou verzi Ukončit navigaci Sníží šum v hodnotách z kompasu, ale zpomalí změny směru. @@ -962,7 +962,7 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Zrušit trasu Smazat cíl Vrstevnice - Stahování + Stahování… Ostatní Soubor se změnami mapy OSM vytvořen %1$s Nezdařilo se zálohovat změny mapy OSM @@ -986,7 +986,7 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Začít novou podtrasu Vymazat všechny body Otevřít soubor GPX - Tento modul poskytuje nástroj na vytvoření trasy klikáním na mapu nebo úpravu stávajících GPX souborů pro plánování výletů a měření vzdálenosti mezi body. Výsledek je možné uložit jako GPX a použito později jako pomůcku. + Vytvářejte cesty klikáním na mapu nebo úpravou stávajících GPX souborů pro plánování výletů a měření vzdálenosti mezi body. Výsledek je možné uložit jako GPX a později použít pro navádění. Cíl %1$s Nastavit jako cíl Zvolte nejprve město nebo ulici @@ -1036,21 +1036,21 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Vybrat existující… Ke stažení: %1$s Vytvořit/Upravit… - Doba platnosti (min) + Doba platnosti (v minutách) Vyberte dopravní oblast: USA, Evropa, Británie, Asie a další. Dopravní oblast - Doba platnosti (minut): %1$s + Doba platnosti (v minutách): %1$s Snímků za sekundu (ladění) - Eliptický mercator + Elipsoidní Mercatorovo zobrazení Základní mapa světa Lupa mapy Bez automatického přibližování Malé přiblížení Velké přiblížení Střední přiblížení - Stažené přiblížení: %1$s + Stažené úrovně přiblížení: %1$s Data dlaždic: %1$s - Zdroj dlaždic %1$s byl uložen + Zdroj dlaždic %1$s uložen Zapamatovat si volbu a nebo @@ -1058,37 +1058,37 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Simulovat pomocí vypočítané trasy Simulovat pomocí GPX trasy Odstranit vše - Chystáte se odstranit %1$d změn OSM. Jste si jisti? + Opravdu chcete odstranit %1$d OSM změn\? Turistika Motocykl Loď Letadlo Vykreslování mapy - Vyberte profily, které se zobrazí v aplikaci. + Vyberte profily, které budou viditelné. Profily aplikace Mořská značka Přidat jako další cíl Vybrat GPX… Použít zobrazenou trasu pro navigaci\? - Vybrat cíl + Zadat cíl Vybrat na mapě Oblíbené Předvolby trasy Informace trasy Upřednostňovat dálnice Upřednostňovat dálnice - Vyhnout se placeným silnicím - Vyhnout se placeným silnicím - Vyhnout se nezpevněným cestám - Povede trasu mimo nezpevněné cesty. - Vyhnout se trajektům - Vyhnout se trajektům - Vyhnout se dálnicím - Vyhnout se dálnicím + Žádné placené silnice + Vyhne se placeným silnicím + Žádné nezpevněné cesty + Vyhne se nezpevněným cestám + Žádné trajekty + Vyhne se trajektům + Žádné dálnice + Vyhne se dálnicím Hmotnostní omezení Zadejte povolenou hmotnost vozidla na trase. - Od verze Androidu 4.4 (KitKat) není možné stahovat a aktualizovat mapy ve starém adresáři (%s). Zkopírovat všechny soubory aplikace OsmAnd do nového umístění\? -\n Poznámka 1: Původní soubory zůstanou nedotčeny (ale mohou být smazány ručně). + Od verze Androidu 4.4 (KitKat) není starý adresář (%s) podporovaný. Zkopírovat všechny soubory aplikace OsmAnd do nového umístění\? +\n Poznámka 1: Původní soubory zůstanou nedotčeny (ale mohou být smazány ručně). \n Poznámka 2: V novém úložišti nebude možné sdílet soubory mezi OsmAnd a OsmAnd+. Kopírování souboru (%s) do nového umístění… Kopírování datových souborů OsmAnd do nového umístění (%s)… @@ -1210,7 +1210,7 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB). Uložit jako skupinu Oblíbených - Vybrat cíle + Určete cíle Překryvné popisky bodů On-line OSM klasifikace map s obrázky. @@ -1218,9 +1218,9 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Zobrazit tlačítka lupy Třídit podle vzdálenosti Třídit podle jména - Vybrat k zobrazení + Vyberte stopu Nic ke stažení nebylo nalezeno, prosím zkontrolujte své připojení k Internetu. - Nebyl vybrán soubor GPX. Vyberte podržením. + Dlouhým stisknutím vyberte GPX soubor. Budovy Text Lesy a křoviny @@ -1236,7 +1236,7 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Preferovaný jazyk pro nápisy na mapě (pokud není dostupný, budou použity anglické nebo lokální názvy). Preferovaný jazyk mapy Lokální názvy - Pokud je zapnutý záznam GPX trasy, odesílat data trasování určené webové službě. + Odesílat trasovací data určené webové službě, pokud je zapnutý záznam GPX. On-line sledování (vyžaduje GPX) Spustit on-line sledování Zastavit on-line sledování @@ -1279,9 +1279,9 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Stáhnout chybějící mapy %1$s (%2$d MB)? Interval ukládání trasy Autobusy, trolejbusy a kyvadlová doprava - Tento modul zapne funkci záznamu a uložení vašich tras stisknutím tlačítka GPX na panelu mapové obrazovky nebo také automatického ukládání všech vašich navigačních tras do GPX souboru. + Tento modul zapne funkci záznamu a uložení vašich stop stisknutím tlačítka GPX na panelu mapové obrazovky. Taktéž umožňuje nastavit automatické ukládání vašich navigačních tras do GPX souboru. \n -\nZaznamenávané trasy můžete sdílet se svými přáteli nebo mohou být použity jako příspěvek do OSM. Sportovci mohou použít zaznamenané trasy k sledování svých tréninků. Základní analýza může být provedena již přímo v OsmAnd, například čas okruhu, průměrná rychlost, apod. Trasy mohou být samozřejmě analyzovány později speciálními programy třetích stran. +\n Zaznamenávané stopy můžete sdílet se svými přáteli nebo mohou být použity jako příspěvek do OSM. Sportovci mohou použít zaznamenané trasy k sledování svých tréninků. Základní analýza může být provedena přímo v OsmAnd, například čas okruhu, průměrná rychlost, apod. Trasy mohou být samozřejmě analyzovány později speciálními programy třetích stran. Záznam cesty h Trvání @@ -1292,24 +1292,24 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Dopravní varování Blízké Oblíbené body Blízké body zájmu POI - Záznam do GPX souboru může být zapnut nebo vypnut pomocí widgetu Záznam trasy na mapové obrazovce. + Záznam do GPX souboru může být zapnut nebo vypnut pomocí widgetu Záznam trasy na mapě. Vždy se zeptat Globální interval záznamu Rychlostní limit Hraniční kontrola Mýtná stanice Značka STOP - Zpomalovací prvek + Zklidňování dopravy Rychlostní radar/kamera Dopravní varování Cíl Stiskněte existující položku k zobrazení více detailů, podržte pro vypnutí nebo smazání. V zařízení je %1$s volného místa: Velikost písma Nastavit velikost písma na mapě. - Název oblíbeného bodu je již použit - Název Oblíbeného bodu již existuje, byl změněn na %1$s, aby nevznikla duplicita. + Duplicitní název oblíbeného bodu + Oblíbený bod přejmenován na %1$s, aby nevznikla duplicita. Vytisknout trasu - Název oblíbeného bodu byl změněn na %1$s, protože není možné ukládat do souboru řetězce s emotikony. + Oblíbený bod přejmenován na %1$s, protože není možné ukládat do souboru řetězce s emotikony. Tolerance překročení rychlosti Zvolte toleranci překročení povolené rychlosti, po které uslyšíte hlasové varování. Anonymní uživatel nemůže: @@ -1392,20 +1392,20 @@ Proporcionální paměť %4$s MB (limit Androidu %5$s MB, Dalvik %6$s MB).Povolit HTTP proxy Nastavit HTTP proxy pro veškeré síťové požadavky. Host proxy - Nastavit hostname proxy (např. 127.0.0.1). + Zadejte hostname proxy serveru (např. 127.0.0.1). Port proxy - Nastavit číslo portu proxy (např. 8118). + Zadejte číslo portu proxy serveru (např. 8118). Parkovací místo ODSTRANIT ZNAČKU Zakázán Povolen Upravit skupinu - Pro zobrazování plavebních map je třeba stáhnout speciální mapu - Pro zobrazování lyžařských map je třeba stáhnout speciální mapu + Stáhněte si speciální offline mapu pro zobrazení námořních detailů. + Stáhněte si speciální offline mapu pro zobrazení lyžařských objektů. Lyžařský mapový pohled Plavební mapový pohled Sdílet poznámku - Poznámky + A/V poznámky On-line mapa Pouze cesty Lyžařské svahy @@ -1460,10 +1460,10 @@ Délka %2$s Navštívit po Navštívit před Vyčistit historii\? - Požadujete nahrát %1$d změn do OSM. Jste si jisti? + Opravdu chcete nahrát %1$d změn do OSM\? Sbalit Info o A-GPS - Datum posledního stažení A-GPS dat: %1$s + Datum stažení A-GPS dat: %1$s Zpráva Stáhnout mapy Vítejte @@ -1517,7 +1517,7 @@ Délka %2$s Úložiště map Kopírovat Popisná čísla domů - Nepřekračovat hranice země + Vyhne se překročení hranic státu Výškové omezení Zadejte výšku vozidla, která musí být povolena na cestách. Inteligentní přepočítávání trasy @@ -1532,7 +1532,7 @@ Délka %2$s Vypnuto Zbarvení podle příslušnosti k síti Zbarvení podle turistické značky OSMC - Chystáte se smazat %1$d poznámek. Jste si jisti? + Opravdu chcete smazat %1$d poznámek\? Wikipedie Červená Výchozí (13) @@ -1544,7 +1544,7 @@ Délka %2$s Světlemodrá Modrá Fialová - Restartujte aplikaci pro aplikování všech změn. + Pro aplikování všech změn je potřeba restartovat aplikaci. Světlý Tmavý Výchozí (průsvitná modrozelená) @@ -1558,8 +1558,8 @@ Délka %2$s Průsvitná fialová Piemontština Máte zastaralá nekompatibilní data Wikipedie. Archivovat je\? - Stáhnout dodatečná Wikipedia data (%1$s MB) \? - Služba zjištění polohy není zapnuta. Aktivovat\? + Stáhnout dodatečná data Wikipedie (%1$s MB)\? + Služba zjištění polohy je vypnuta. Aktivovat\? Zabránit samostatnému logování Okamžité aktualizace Nejsou dostupné žádné aktualizace @@ -1582,8 +1582,8 @@ Délka %2$s Moduly GPX soubor s umístěními. Umístění - Vyhnout se autovlaku - Vyhnout se použití autovlaků + Žádný autovlak + Vyhne se použití autovlaků Latina smazat Nepodařilo se odeslat @@ -1691,7 +1691,7 @@ Délka %2$s Nastavit příznak označující první spuštění aplikace, ostatní nastavení ponechat nezměněná. Silniční mapa není nutná, protože máte standardní (plnou) mapu. I přesto stáhnout? Zvolte, kam chcete uložit mapové a ostatní datové soubory. - „Vypnout“ spouští přímo obrazovku s mapou. + \'Vypnuto\' spouští přímo obrazovku s mapou. Základní mapa světa (pokrývající celý svět při malých úrovních detailů) chybí nebo je zastaralá. Prosím zvažte její stažení pro celkový přehled. QR kód Mapa stažena @@ -1749,9 +1749,9 @@ Délka %2$s Znovuotevřít poznámku Uzavřít poznámku Poznámka vytvořena - Nepodařilo se vytvořit poznámku + Nepodařilo se vytvořit poznámku. Poznámka uzavřena - Nepodařilo se uzavřít poznámku + Nepodařilo se uzavřít poznámku. Odeslat Odstranit bod GPX? Upravit bod GPX @@ -1765,9 +1765,9 @@ Délka %2$s Použít menu Domovská obrazovka nebo menu Na výběr je možnost ovládání aplikace přes flexibilní domovskou obrazovku nebo statické menu. Svůj výběr můžete kdykoliv změnit v nastavení domovské obrazovky. - Vyhnout se schodům - Vyhnout se schodům - Vyhnout se hraničním přechodům + Žádné schody + Vyhne se schodům + Žádné hraniční přechody Nedaleko Skrýt Nejnižší kvalita @@ -1784,9 +1784,9 @@ Délka %2$s Čas: Stezka pro koně Stahovat jen přes WiFi - Aplikace nemá povolen přístup k poloze. - Aplikace nemá povolen přístup k fotoaparátu. - Aplikace nemá povolen přístup k mikrofonu. + Udělit oprávnění pro přístup k poloze. + Udělit oprávnění pro přístup k fotoaparátu. + Udělit oprávnění pro přístup k mikrofonu. Aktualizovat každých Okamžité aktualizace Aktualizovat nyní @@ -1843,32 +1843,32 @@ Délka %2$s Nahrát anonymně Zobrazit posuvník průhlednosti Nedostatek místa! - V úložišti je zapotřebí dočasně {3} MB a trvale {1} MB. - Aktuálně je k dispozici pouze {2} MB. +\nV úložišti je zapotřebí dočasně {3} MB a trvale {1} MB. +\n(Aktuálně je k dispozici pouze {2} MB.) Nahrát OSM poznámku Nahrajte OSM poznámku anonymně, nebo prostřednictvím svého účtu OpenStreetMap.org. Posunout ↑ Posunout ↓ Dokončit navigaci Vyhnout se cestě - Přepnuto do interní paměti, protože aktuálně vybraná složka je pouze pro čtení. Prosím zvolte složku v zapisovatelné paměti. + Přepnuto do interní paměti, protože aktuálně vybraná složka je chráněna proti zápisu. Prosím zvolte složku v zapisovatelné paměti. Sdílená paměť Horní panel Celý výpis Výpis Přepočítat trasu - OpenStreetMap uživatelské jméno a heslo + Uživatelské jméno a heslo pro OSM Příspěvky Počet příjemců Počet úprav %1$s, pořadí %2$s, celkový počet úprav %3$s - Pořadí OSM editorů + Pořadí mezi editory OSM Předplatné OsmAnd Live Předplatit - Nutné, abychom vás mohli informovat o příspěvcích. + Nutné, abychom vás mohli informovat o vašich příspěvcích. Veřejné jméno Nezobrazovat mé jméno v hlášeních Oblast podpory - Měsíční cena + Cena za měsíc Měsíční poplatek Aktivní Neaktivní @@ -1879,10 +1879,11 @@ Délka %2$s Část vašeho příspěvku bude zaslána uživatelům OSM, kteří upravují mapu ve zvolené oblasti. Nastavení předplatného Nejprve prosím zakupte předplatné OsmAnd Live - Předplatné umožní hodinové aktualizace pro všechny mapy světa. Část příjmu jde zpět do OSM komunity a za každý příspěvek do OSM je vyplacena odměna. Pokud máte rádi OsmAnd a OSM, chcete je podpořit a být podporováni, toto je výborný způsob, jak to udělat. - Stáhnout {0} soubor(ů)? - V úložišti je zapotřebí dočasně {3} MB a trvale {1} MB. - (Aktuálně je k dispozici {2} MB.) + Předplatné umožní hodinové aktualizace pro všechny mapy světa. +\n Část příjmu jde zpět do OSM komunity a za každý příspěvek do OSM je vyplacena odměna. +\n Pokud máte rádi OsmAnd a OSM, chcete je podpořit a být podporováni, toto je výborný způsob, jak to udělat. + Stáhnout {0} soubor(ů)\? +\nV úložišti je zapotřebí dočasně {3} MB a trvale {1} MB. (Z {2} MB.) První mapová značka Druhá mapová značka Panel nástrojů @@ -1971,7 +1972,7 @@ Délka %2$s Rozšířené hledání souřadnic %1$s zastávek před Přeskočit stahování map - Nemáte nainstalovanou žádnou mapu. Můžete si vybrat mapu ze seznamu, nebo stáhnout mapy později přes \'Menu - %1$s\'. + Nemáte nainstalovanou žádnou offline mapu. Můžete si vybrat mapu ze seznamu, nebo stáhnout mapy později přes \'Menu - %1$s\'. Vybrat jinou oblast Hledání map… Povolit OsmAndu určit vaši polohu a navrhnout mapy pro tuto oblast. @@ -1980,7 +1981,7 @@ Délka %2$s Vyžadováno pro stažení map. Hledání polohy… Volné místo - Úložiště dat OsmAnd (pro mapy, GPX atd.): %1$s. + Úložiště dat OsmAnd (pro mapy, soubory stop atd.): %1$s. Udělit oprávnění Povolit přístup k poloze Nechejte se navigovat a objevte nová místa bez nutnosti připojení k Internetu @@ -1995,21 +1996,21 @@ Délka %2$s Nadzemní objekty Změnit Začít - Předplatné je strháváno měsíčně. Můžete jej kdykoliv zrušit přes Google Play. - Příspěvek komunitě OpenStreetMap - Část peněz z Vašeho příspěvku je zaslána přímo uživatelům, kteří provádějí změny v databázi OpenStreetMap. Cena předplatného pro Vás však zůstává stejná. + Předplatné je strháváno za zvolené období. Můžete jej kdykoliv zrušit přes Google Play. + Příspěvek komunitě OSM + Část peněz z vašeho příspěvku je zaslána přispěvatelům do OSM. Cena předplatného zůstává stejná. Předplatné umožňuje hodinové, denní, týdenní aktualizace a neomezené stahování map celého světa. Získat Získat za %1$s - Získejte neomezené stahování map a aktualizace více než jednou za měsíc: týdenní, denní nebo každou hodinu. + Získejte neomezené stahování map a aktualizace každý týden, den nebo dokonce hodinu. Neomezené stahování map, aktualizací a modul Wikipedie. Míle/metry Hornolužická srbština Nemáte zatím žádné soubory stop - Do složky můžete také přidat GPX soubory + Do složky můžete přidat také soubory stop Přidat další… Vzhled - Povolit rychlé spuštění záznamu + Zapnout rychlý záznam Zobrazit systémové oznámení, které umožňuje spustit nahrávání. Oznámení Pokračovat @@ -2027,8 +2028,8 @@ Délka %2$s Minimální přesnost záznamu Filtr: Nezaznamenávat, dokud není dosažena tato přesnost. Vánoční POI - Před Vánoci a Novým rokem můžete zobrazit POI spojené s Vánoci: vánoční stromky, trhy atd. - Zobrazit vánoční POI? + Jako přípravu na Vánoce a Nový rok si můžete zapnout zobrazení tematických bodů zájmu, jako vánočních stromků, trhů atd. + Zobrazit vánoční body zájmu\? Světle hnědá Tmavě hnědá Barevné schéma vrstevnic @@ -3893,12 +3894,12 @@ Zobrazená oblast: %1$s x %2$s Tato nastavení jsou globální a platí pro všechny profily Přihlásit se do OpenStreetMap Přihlásit se do OpenStreetMap.org - Přihlásit se do OpenStreetMap + Zaregistrovat se do OpenStreetMap Můžete zobrazit své dosud neodeslané změny či chyby v OSM v %1$s. Odeslané body se již v OsmAnd nezobrazují. - Přihlaste se, abyste mohli odesílat nová nebo změněná data, + Abyste mohli odesílat nová nebo změněná data, musíte se přihlásit. \n -\nbuď pomocí bezpečné metody OAuth, nebo pomocí jména a hesla. - Přihlásit se pomocí jména a hesla +\nPřihlásit se můžete pomocí bezpečné metody OAuth nebo jménem a heslem. + Použít jméno a heslo Účet Uživatelské jméno Historie značek @@ -3910,11 +3911,11 @@ Zobrazená oblast: %1$s x %2$s \"Identifikovatelná\" znamená, že trasa bude veřejně dostupná ve vašich GPS trasách a veřejných seznamech GPS tras, tzn. ostatní uživatelé si budou moci stáhnout nezpracovanou trasu a propojit ji s vaším uživatelským jménem. Veřejná data bodů trasy s časovými razítky poskytnutá prostřednictvím GPS API se budou odkazovat na vaši původní stránku s trasou. Zavřít OSM poznámku Komentovat OSM poznámku - Přihlaste se bezpečnou metodou OAuth nebo použijte své přihlašovací jméno a heslo. + Můžete se přihlásit bezpečnou metodou OAuth nebo použít své přihlašovací jméno a heslo. Přidat fotku Zaregistrovat na \nOpenPlaceReviews.org - Přihlaste se na webových stránkách open source projektu OpenPlaceReviews.org a budete moci odesílat ještě více fotografií. + Fotografie poskytuje open source projekt OpenPlaceReviews.org. Abyste mohli nahrát své fotografie, musíte se přihlásit na webové stránce. Vytvořit nový účet Už mám účet %1$s: %2$s @@ -3962,4 +3963,9 @@ Zobrazená oblast: %1$s x %2$s Není zde dostatek místa Vyberte skupiny, které se mají importovat. Vyberte položky, které se mají importovat. + Nepodařilo se odeslat obrázek, zkuste to prosím později + Vyberte obrázek + Přepnout na dev.openstreetmap.org místo openstreetmap.org pro otestování odesílání OSM poznámek, bodů zájmu a GPX stop. + Použít dev.openstreetmap.org + %1$s * %2$s \ No newline at end of file From 0778ccdb876390ef041210878195e472d066014f Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Sat, 28 Nov 2020 15:23:52 +0000 Subject: [PATCH 58/66] Translated using Weblate (Sardinian) Currently translated at 99.7% (3563 of 3571 strings) --- OsmAnd/res/values-sc/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index dd4ed9cf6b..8d461da61d 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -3996,4 +3996,5 @@ Imprea dev.openstreetmap.org Impossìbile carrigare s\'immàgine, torra a proare prus a tardu Ischerta un\'immàgine + %1$s * %2$s \ No newline at end of file From 4df5f9e5d28280d76e326ceef2599e8ace9f6c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1ns?= Date: Sat, 28 Nov 2020 14:40:49 +0000 Subject: [PATCH 59/66] Translated using Weblate (Galician) Currently translated at 100.0% (3571 of 3571 strings) --- OsmAnd/res/values-gl/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-gl/strings.xml b/OsmAnd/res/values-gl/strings.xml index c83b2f6df1..148c7fe98c 100644 --- a/OsmAnd/res/values-gl/strings.xml +++ b/OsmAnd/res/values-gl/strings.xml @@ -4023,4 +4023,5 @@ Lon %2$s \nOpenPlaceReviews - imaxes POI; \nMapillary - maxes a nivel de rúa; \nWeb / Wikimedia - imaxes POI especificadas nos datos do OpenStreetMap. + %1$s * %2$s \ No newline at end of file From 40cb512170ed914e47b55e4fe2d2d2562837ddf0 Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Sat, 28 Nov 2020 21:01:42 +0000 Subject: [PATCH 60/66] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3571 of 3571 strings) --- OsmAnd/res/values-pt-rBR/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index aa23de4b3a..5a6b16d427 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -3994,4 +3994,5 @@ Usar dev.openstreetmap.org Não é possível carregar a imagem, por favor, tente novamente mais tarde Selecione a foto + %1$s * %2$s \ No newline at end of file From 9d3fe3788f89dd781544c182e2400fb62b463c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Sat, 28 Nov 2020 21:38:27 +0000 Subject: [PATCH 61/66] Translated using Weblate (Estonian) Currently translated at 99.0% (3537 of 3571 strings) --- OsmAnd/res/values-et/strings.xml | 33 ++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-et/strings.xml b/OsmAnd/res/values-et/strings.xml index 3db38e3311..2445b43d8d 100644 --- a/OsmAnd/res/values-et/strings.xml +++ b/OsmAnd/res/values-et/strings.xml @@ -459,7 +459,7 @@ POI sildid Avaneb homme kell Kuva suletud teated - Kuva/peida OSM teated kaardil. + Kuva või peida OSM teated kaardil. OSC - sobib andmete laadimiseks OpenStreetMap\'i andmebaasi. OSC fail Vali faililiik @@ -1012,7 +1012,7 @@ Vaheta %1$s ja %2$s Lähtepunkt Rada salvestatud - Faili nimi on tühi + Faili nimi on puudu Ennista Kuva sõlmevõrgu rattateekonnad Tühjenda %1$s\? @@ -2653,9 +2653,9 @@ Lemmikute või GPX-teekonnapunktide grupina lisatud markerid, mis on märgitud läbituks, jäävad kaardile. Kui grupp pole aktiivne, kaovad markerid kaardilt. Käivita Guaraani - Alpisuusatamine/laskumine + Alpisuusatamine ja mäesuusatamine Nõlvad alpisuusatamisks või laskumiseks ja ligipääs suusatõstukitele. - Murdmaa/põhjamaa suusatamine + Murdmaasuusatamine ja põhja suusaalad Murdmaa või põhjamaa suusatamise rajad. Suusamatkad Suusamatkarajad. @@ -3774,7 +3774,7 @@ \nTellimust saad hallata ja tühistada AppGallery seadistustest. Arveldame tellimuse eest valitud ajavahemiku alusel. Seda saad sa vabalt valitud ajal tühistada AppGallery\'s. Keeruka teekonna koostamine - Väljalogimine õnnestus + Väljalogitud Arendus Kustuta OpenStreetMap\'i OAuth\'i pääsuluba Logi sisse OAuth abil @@ -3809,7 +3809,7 @@ Pruugi kasutajanime ja salasõna Täienduste või muudatuste üleslaadimiseks pead sisse logima. \n -\nSa võid selleks kasutada mõnd turvalust OAuth võimalust või oma kasutajanime ning salasõna. +\nSa võid selleks kasutada mõnd turvalist OAuth võimalust või oma kasutajanime ning salasõna. Kasutajakonto Saada GPX fail OpenStreetMappi Sulge OSM märkus @@ -3821,4 +3821,25 @@ Fotode allikaks on OpenPlaceReviews.org veebisait. Oma fotode üleslaadimiseks peaksid liituma selle veebisaidi kasutajaks. Loo uus kasutajakonto Mul juba on kasutajakonto olemas + Otsinguajalugu + Süst (merekajak) + Mootorpaat + Pildi üleslaadimine ei õnnestunud, palun proovi hiljem uuesti + Vali pilt + Ressursid + Faili ligikaudne suurus + Vali faili eksporditavad andmed. + Importimiseks vajalik + Sinu nutiseadmes on vaba ruumi vaid %1$s. Palun tee ruumi juurde või jäta osa kirjetest eksportimata. + Pole piisavalt ruumi + Vali imporditavad grupid. + Vali imporditavad kirjed. + Lisa Mapillary saiti + Lisa OpenPlaceReviews saiti + Tavasaidi openstreetmap.org asemel kasuta OSM märkuste, huvipunktide või GPX-failide üleslaadimise katsetamiseks arendussaiti dev.openstreetmap.org. + Kasuta dev.openstreetmap.org saiti + OsmAnd kuvam fotosid mitmetest allikatest: +\nOpenPlaceReviews - huvipunkti fotod; +\nMapillary - tänavavaated; +\nWikimedia või veeb - OpenStreetMap\'i andmetes kirjeldatud fotod. \ No newline at end of file From e2085886b243b7e59cc66c4eea1e8fece21a1d1a Mon Sep 17 00:00:00 2001 From: Verdulo Date: Sat, 28 Nov 2020 00:21:44 +0000 Subject: [PATCH 62/66] Translated using Weblate (Esperanto) Currently translated at 100.0% (3571 of 3571 strings) --- OsmAnd/res/values-eo/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index b85578312f..2d58674ff2 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -3998,4 +3998,5 @@ Uzi dev.openstreetmap.org Ne povas alŝuti la bildon, reprovu poste Elektu bildon + %1$s * %2$s \ No newline at end of file From a7840a711a0b95a5426304c4ca2729874d2b1796 Mon Sep 17 00:00:00 2001 From: Artem Date: Sat, 28 Nov 2020 09:53:51 +0000 Subject: [PATCH 63/66] Translated using Weblate (Russian) Currently translated at 100.0% (3860 of 3860 strings) --- OsmAnd/res/values-ru/phrases.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index fb1dc5e65d..8f3eba7cf1 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3864,4 +3864,8 @@ Неиммиграционные визы Связь Посольство + Субнациональный + Консульское агентство + Раздел интересов + Консульство \ No newline at end of file From 35ad469f540581b287dc29bbaa8ae9f95cb592e2 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Sun, 29 Nov 2020 16:19:30 +0300 Subject: [PATCH 64/66] Fix OsmAnd lib script --- OsmAnd/build.gradle.lib | 103 ++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 61 deletions(-) diff --git a/OsmAnd/build.gradle.lib b/OsmAnd/build.gradle.lib index 39e4a8e56b..bcb0999e91 100644 --- a/OsmAnd/build.gradle.lib +++ b/OsmAnd/build.gradle.lib @@ -1,4 +1,5 @@ apply plugin: 'com.android.library' +apply plugin: 'ivy-publish' task printc { configurations.each { if(it.isCanBeResolved()) println it.name } @@ -338,67 +339,47 @@ task appStart(type: Exec) { // commandLine 'cmd', '/c', 'adb', 'shell', 'am', 'start', '-n', 'net.osmand.plus/net.osmand.plus.activities.MapActivity' } -artifacts { - archives(file("$buildDir/outputs/aar/OsmAnd-legacy-x86-debug.aar")) { - classifier 'legacyX86Debug' - name 'OsmAnd' - extension 'aar' - } - archives(file("$buildDir/outputs/aar/OsmAnd-legacy-x86-release.aar")) { - classifier 'legacyX86Release' - name 'OsmAnd' - extension 'aar' - } - archives(file("$buildDir/outputs/aar/OsmAnd-legacy-arm64-debug.aar")) { - classifier 'legacyArm64Debug' - name 'OsmAnd' - extension 'aar' - } - archives(file("$buildDir/outputs/aar/OsmAnd-legacy-arm64-release.aar")) { - classifier 'legacyArm64Release' - name 'OsmAnd' - extension 'aar' - } - archives(file("$buildDir/outputs/aar/OsmAnd-legacy-armonly-debug.aar")) { - classifier 'legacyArmonlyDebug' - name 'OsmAnd' - extension 'aar' - } - archives(file("$buildDir/outputs/aar/OsmAnd-legacy-armonly-release.aar")) { - classifier 'legacyArmonlyRelease' - name 'OsmAnd' - extension 'aar' - } - archives(file("$buildDir/outputs/aar/OsmAnd-legacy-armv7-debug.aar")) { - classifier 'legacyArmv7Debug' - name 'OsmAnd' - extension 'aar' - } - archives(file("$buildDir/outputs/aar/OsmAnd-legacy-armv7-release.aar")) { - classifier 'legacyArmv7Release' - name 'OsmAnd' - extension 'aar' - } - archives(file("$buildDir/outputs/aar/OsmAnd-legacy-fat-debug.aar")) { - classifier 'legacyFatDebug' - name 'OsmAnd' - extension 'aar' - } - archives(file("$buildDir/outputs/aar/OsmAnd-legacy-fat-release.aar")) { - classifier 'legacyFatRelease' - name 'OsmAnd' - extension 'aar' - } -} - -uploadArchives { - repositories.ivy { - // credentials { - // username "" - // password "" - // } - - url = System.getenv("OSMAND_BINARIES_IVY_ROOT") ?: "./" +project.afterEvaluate { + publishing { + repositories { + ivy { + url = System.getenv("OSMAND_BINARIES_IVY_ROOT") ?: "./" + } + } + publications { + aar(IvyPublication) { + artifact bundleLegacyX86DebugAar { + classifier 'legacyX86Debug' + } + artifact bundleLegacyX86ReleaseAar { + classifier 'legacyX86Release' + } + artifact bundleLegacyArm64DebugAar { + classifier 'legacyArm64Debug' + } + artifact bundleLegacyArm64ReleaseAar { + classifier 'legacyArm64Release' + } + artifact bundleLegacyArmonlyDebugAar { + classifier 'legacyArmonlyDebug' + } + artifact bundleLegacyArmonlyReleaseAar { + classifier 'legacyArmonlyRelease' + } + artifact bundleLegacyArmv7DebugAar { + classifier 'legacyArmv7Debug' + } + artifact bundleLegacyArmv7ReleaseAar { + classifier 'legacyArmv7Release' + } + artifact bundleLegacyFatDebugAar { + classifier 'legacyFatDebug' + } + artifact bundleLegacyFatReleaseAar { + classifier 'legacyFatRelease' + } + } + } } } From 993b3727fed610044ab05e94dd712c3e662d7792 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Sun, 29 Nov 2020 16:57:45 +0300 Subject: [PATCH 65/66] Try fix OsmAnd lib script --- OsmAnd/.gitignore | 2 +- OsmAnd/build.gradle.lib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/.gitignore b/OsmAnd/.gitignore index 8bfbd5b688..b8c08a2225 100644 --- a/OsmAnd/.gitignore +++ b/OsmAnd/.gitignore @@ -2,7 +2,7 @@ gradle gradlew gradlew.bat - +/net.osmand aarDependencies libs/android*.jar libs/com.*.jar diff --git a/OsmAnd/build.gradle.lib b/OsmAnd/build.gradle.lib index bcb0999e91..2cf3182749 100644 --- a/OsmAnd/build.gradle.lib +++ b/OsmAnd/build.gradle.lib @@ -393,7 +393,7 @@ dependencies { implementation 'com.google.android.material:material:1.2.1' implementation 'androidx.browser:browser:1.0.0' implementation 'androidx.preference:preference:1.1.0' - implementation fileTree(include: ['gnu-trove-osmand.jar', 'icu4j-49_1_patched.jar'], dir: 'libs') + legacyImplementation fileTree(include: ['gnu-trove-osmand.jar', 'icu4j-49_1_patched.jar'], dir: 'libs') implementation group: 'commons-logging', name: 'commons-logging', version: '1.2' implementation 'commons-codec:commons-codec:1.11' From e82c5c1b8fbb1affd8ec47e424c8744e38bfd1df Mon Sep 17 00:00:00 2001 From: max-klaus Date: Sun, 29 Nov 2020 18:22:04 +0300 Subject: [PATCH 66/66] Fix OsmAnd lib script --- OsmAnd/build.gradle.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/build.gradle.lib b/OsmAnd/build.gradle.lib index 2cf3182749..4c82b65793 100644 --- a/OsmAnd/build.gradle.lib +++ b/OsmAnd/build.gradle.lib @@ -393,7 +393,7 @@ dependencies { implementation 'com.google.android.material:material:1.2.1' implementation 'androidx.browser:browser:1.0.0' implementation 'androidx.preference:preference:1.1.0' - legacyImplementation fileTree(include: ['gnu-trove-osmand.jar', 'icu4j-49_1_patched.jar'], dir: 'libs') + compileOnly fileTree(include: ['gnu-trove-osmand.jar', 'icu4j-49_1_patched.jar'], dir: 'libs') implementation group: 'commons-logging', name: 'commons-logging', version: '1.2' implementation 'commons-codec:commons-codec:1.11'