From 1e8983ce58b2218f8455f1d2c2f3b31714334ffc Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Wed, 9 Dec 2020 13:15:04 +0200 Subject: [PATCH 01/91] Truck profile --- .../plus/profiles/RoutingProfileDataObject.java | 1 + .../routepreparationmenu/RoutingOptionsHelper.java | 3 +++ .../plus/settings/backend/ApplicationMode.java | 14 +++++++++----- .../plus/settings/backend/OsmandSettings.java | 5 +++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java b/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java index 3cd3c74293..da6e370fde 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java +++ b/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java @@ -29,6 +29,7 @@ public class RoutingProfileDataObject extends ProfileDataObject { SKI(R.string.routing_profile_ski, R.drawable.ic_action_skiing), PUBLIC_TRANSPORT(R.string.app_mode_public_transport, R.drawable.ic_action_bus_dark), BOAT(R.string.app_mode_boat, R.drawable.ic_action_sail_boat_dark), + TRUCK(R.string.app_mode_truck, R.drawable.ic_action_truck_dark), GEOCODING(R.string.routing_profile_geocoding, R.drawable.ic_action_world_globe); int stringRes; diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java index d34144cbdc..de3924fe0f 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java @@ -1050,6 +1050,7 @@ public class RoutingOptionsHelper { BOAT(MuteSoundRoutingParameter.KEY), AIRCRAFT(MuteSoundRoutingParameter.KEY), SKI(MuteSoundRoutingParameter.KEY, DRIVING_STYLE, GeneralRouter.USE_HEIGHT_OBSTACLES), + TRUCK(MuteSoundRoutingParameter.KEY, AvoidRoadsRoutingParameter.KEY), OTHER(MuteSoundRoutingParameter.KEY); List routingParameters; @@ -1078,6 +1079,8 @@ public class RoutingOptionsHelper { return PermanentAppModeOptions.AIRCRAFT.routingParameters; } else if (appMode.isDerivedRoutingFrom(ApplicationMode.SKI)) { return PermanentAppModeOptions.SKI.routingParameters; + } else if (appMode.isDerivedRoutingFrom(ApplicationMode.TRUCK)) { + return PermanentAppModeOptions.TRUCK.routingParameters; } else { return PermanentAppModeOptions.OTHER.routingParameters; } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java index 8c64654b41..b1b98e17f2 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java @@ -108,6 +108,10 @@ public class ApplicationMode { .icon(R.drawable.ic_action_skiing) .description(R.string.base_profile_descr_ski).reg(); + public static final ApplicationMode TRUCK = createBase(R.string.app_mode_truck, "ic_action_truck_dark") + .icon(R.drawable.ic_action_truck_dark) + .description(R.string.app_mode_truck).reg(); + public static List values(OsmandApplication app) { if (customizationListener == null) { customizationListener = new OsmAndAppCustomization.OsmAndAppCustomizationListener() { @@ -179,13 +183,13 @@ public class ApplicationMode { } private static void initRegVisibility() { - // DEFAULT, CAR, BICYCLE, PEDESTRIAN, PUBLIC_TRANSPORT, BOAT, AIRCRAFT, SKI - ApplicationMode[] exceptDefault = new ApplicationMode[] {CAR, BICYCLE, PEDESTRIAN, PUBLIC_TRANSPORT, BOAT, AIRCRAFT, SKI}; + // DEFAULT, CAR, BICYCLE, PEDESTRIAN, PUBLIC_TRANSPORT, BOAT, AIRCRAFT, SKI, TRUCK + ApplicationMode[] exceptDefault = new ApplicationMode[] {CAR, BICYCLE, PEDESTRIAN, PUBLIC_TRANSPORT, BOAT, AIRCRAFT, SKI, TRUCK}; ApplicationMode[] all = null; ApplicationMode[] none = new ApplicationMode[] {}; // left - ApplicationMode[] navigationSet1 = new ApplicationMode[] {CAR, BICYCLE, BOAT, SKI}; + ApplicationMode[] navigationSet1 = new ApplicationMode[] {CAR, BICYCLE, BOAT, SKI, TRUCK}; ApplicationMode[] navigationSet2 = new ApplicationMode[] {PEDESTRIAN, PUBLIC_TRANSPORT, AIRCRAFT}; regWidgetVisibility(WIDGET_NEXT_TURN, navigationSet1); @@ -200,8 +204,8 @@ public class ApplicationMode { regWidgetVisibility(WIDGET_DISTANCE, all); regWidgetVisibility(WIDGET_TIME, all); regWidgetVisibility(WIDGET_INTERMEDIATE_TIME, all); - regWidgetVisibility(WIDGET_SPEED, CAR, BICYCLE, BOAT, SKI, PUBLIC_TRANSPORT, AIRCRAFT); - regWidgetVisibility(WIDGET_MAX_SPEED, CAR); + regWidgetVisibility(WIDGET_SPEED, CAR, BICYCLE, BOAT, SKI, PUBLIC_TRANSPORT, AIRCRAFT, TRUCK); + regWidgetVisibility(WIDGET_MAX_SPEED, CAR, TRUCK); regWidgetVisibility(WIDGET_ALTITUDE, PEDESTRIAN, BICYCLE); regWidgetAvailability(WIDGET_INTERMEDIATE_DISTANCE, all); regWidgetAvailability(WIDGET_DISTANCE, all); diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index 90c63d3334..f5283854b6 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -936,6 +936,7 @@ public class OsmandSettings { DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.BOAT, 1.38f); DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.AIRCRAFT, 40f); DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.SKI, 1.38f); + DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.TRUCK, 10.5f); } public final OsmandPreference MIN_SPEED = new FloatPreference(this, @@ -955,6 +956,7 @@ public class OsmandSettings { ICON_RES_NAME.setModeDefaultValue(ApplicationMode.BOAT, "ic_action_sail_boat_dark"); ICON_RES_NAME.setModeDefaultValue(ApplicationMode.AIRCRAFT, "ic_action_aircraft"); ICON_RES_NAME.setModeDefaultValue(ApplicationMode.SKI, "ic_action_skiing"); + ICON_RES_NAME.setModeDefaultValue(ApplicationMode.TRUCK, "ic_action_truck_dark"); } public final CommonPreference ICON_COLOR = new EnumStringPreference<>(this, @@ -974,6 +976,7 @@ public class OsmandSettings { ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.BOAT, "boat"); ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.AIRCRAFT, "STRAIGHT_LINE_MODE"); ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.SKI, "ski"); + ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.TRUCK, "truck"); } public final CommonPreference ROUTE_SERVICE = new EnumStringPreference<>(this, "route_service", RouteService.OSMAND, RouteService.values()).makeProfile().cache(); @@ -992,6 +995,7 @@ public class OsmandSettings { NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.BOAT, NavigationIcon.NAUTICAL); NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.AIRCRAFT, NavigationIcon.DEFAULT); NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.SKI, NavigationIcon.DEFAULT); + NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.TRUCK,NavigationIcon.DEFAULT); } public final CommonPreference LOCATION_ICON = new EnumStringPreference<>(this, "location_icon", LocationIcon.DEFAULT, LocationIcon.values()).makeProfile().cache(); @@ -1003,6 +1007,7 @@ public class OsmandSettings { LOCATION_ICON.setModeDefaultValue(ApplicationMode.BOAT, LocationIcon.DEFAULT); LOCATION_ICON.setModeDefaultValue(ApplicationMode.AIRCRAFT, LocationIcon.CAR); LOCATION_ICON.setModeDefaultValue(ApplicationMode.SKI, LocationIcon.BICYCLE); + LOCATION_ICON.setModeDefaultValue(ApplicationMode.TRUCK, LocationIcon.CAR); } public final CommonPreference APP_MODE_ORDER = new IntPreference(this, "app_mode_order", 0).makeProfile().cache(); From 16ae7b28c1699ccdecfba1d9283bfa3a63ff2f91 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 9 Dec 2020 14:55:35 +0200 Subject: [PATCH 02/91] travel obf resource manager reader added --- .../plus/resources/ResourceManager.java | 233 ++++++++++-------- .../plus/wikivoyage/data/TravelObfHelper.java | 11 +- 2 files changed, 132 insertions(+), 112 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 8e7857b33a..c8b5bdec16 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -19,8 +19,10 @@ import net.osmand.IndexConstants; import net.osmand.Location; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; +import net.osmand.binary.BinaryIndexPart; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader.SearchPoiTypeFilter; +import net.osmand.binary.BinaryMapPoiReaderAdapter; import net.osmand.binary.CachedOsmandIndexes; import net.osmand.data.Amenity; import net.osmand.data.RotatedTileBox; @@ -75,15 +77,14 @@ import java.util.Map.Entry; import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; - import static net.osmand.IndexConstants.VOICE_INDEX_DIR; /** - * Resource manager is responsible to work with all resources + * Resource manager is responsible to work with all resources * that could consume memory (especially with file resources). * Such as indexes, tiles. * Also it is responsible to create cache for that resources if they - * can't be loaded fully into memory & clear them on request. + * can't be loaded fully into memory & clear them on request. */ public class ResourceManager { @@ -91,10 +92,10 @@ public class ResourceManager { private static final String INDEXES_CACHE = "ind.cache"; private static final Log log = PlatformUtil.getLog(ResourceManager.class); - + protected static ResourceManager manager = null; - protected File dirWithTiles ; + protected File dirWithTiles; private List tilesCacheList = new ArrayList<>(); private BitmapTilesCache bitmapTilesCache; @@ -115,21 +116,22 @@ public class ResourceManager { STREET_LOOKUP, TRANSPORT, ADDRESS, - QUICK_SEARCH, + QUICK_SEARCH, ROUTING, TRANSPORT_ROUTING } - + public static class BinaryMapReaderResource { private BinaryMapIndexReader initialReader; private File filename; private List readers = new ArrayList<>(BinaryMapReaderResourceType.values().length); private boolean useForRouting; private boolean useForPublicTransport; + public BinaryMapReaderResource(File f, BinaryMapIndexReader initialReader) { this.filename = f; this.initialReader = initialReader; - while(readers.size() < BinaryMapReaderResourceType.values().length) { + while (readers.size() < BinaryMapReaderResourceType.values().length) { readers.add(null); } } @@ -173,7 +175,7 @@ public class ResourceManager { } initialReader = null; } - + public boolean isClosed() { return initialReader == null; } @@ -189,7 +191,7 @@ public class ResourceManager { public void setUseForRouting(boolean useForRouting) { this.useForRouting = useForRouting; } - + public boolean isUseForRouting() { return useForRouting; } @@ -202,34 +204,34 @@ public class ResourceManager { this.useForPublicTransport = useForPublicTransport; } } - + protected final Map fileReaders = new ConcurrentHashMap(); - - + + private final Map addressMap = new ConcurrentHashMap(); - protected final Map amenityRepositories = new ConcurrentHashMap(); -// protected final Map routingMapFiles = new ConcurrentHashMap(); + protected final Map amenityRepositories = new ConcurrentHashMap(); + // protected final Map routingMapFiles = new ConcurrentHashMap(); protected final Map transportRepositories = new ConcurrentHashMap(); - + protected final Map indexFileNames = new ConcurrentHashMap(); protected final Map basemapFileNames = new ConcurrentHashMap(); - - + + protected final IncrementalChangesManager changesManager = new IncrementalChangesManager(this); - + protected final MapRenderRepositories renderer; protected final MapTileDownloader tileDownloader; - + public final AsyncLoadingThread asyncLoadingThread = new AsyncLoadingThread(this); - + private HandlerThread renderingBufferImageThread; - + protected boolean internetIsNotAccessible = false; private boolean depthContours; - + public ResourceManager(OsmandApplication context) { - + this.context = context; this.renderer = new MapRenderRepositories(context); @@ -271,7 +273,7 @@ public class ResourceManager { public MapTileDownloader getMapTileDownloader() { return tileDownloader; } - + public HandlerThread getRenderingBufferImageThread() { return renderingBufferImageThread; } @@ -293,17 +295,17 @@ public class ResourceManager { // ".nomedia" indicates there are no pictures and no music to list in this dir for the Gallery app try { context.getAppPath(".nomedia").createNewFile(); //$NON-NLS-1$ - } catch( Exception e ) { + } catch (Exception e) { } for (TilesCache tilesCache : tilesCacheList) { tilesCache.setDirWithTiles(dirWithTiles); } } - + public java.text.DateFormat getDateFormat() { return DateFormat.getDateFormat(context); } - + public OsmandApplication getContext() { return context; } @@ -323,7 +325,7 @@ public class ResourceManager { return null; } - public synchronized void tileDownloaded(DownloadRequest request){ + public synchronized void tileDownloaded(DownloadRequest request) { if (request instanceof TileLoadDownloadRequest) { TileLoadDownloadRequest req = ((TileLoadDownloadRequest) request); TilesCache cache = getTilesCache(req.tileSource); @@ -332,13 +334,13 @@ public class ResourceManager { } } } - + public synchronized boolean tileExistOnFileSystem(String file, ITileSource map, int x, int y, int zoom) { TilesCache cache = getTilesCache(map); return cache != null && cache.tileExistOnFileSystem(file, map, x, y, zoom); } - - public void clearTileForMap(String file, ITileSource map, int x, int y, int zoom){ + + public void clearTileForMap(String file, ITileSource map, int x, int y, int zoom) { TilesCache cache = getTilesCache(map); if (cache != null) { cache.getTileForMap(file, map, x, y, zoom, true, false, true, true); @@ -376,7 +378,7 @@ public class ResourceManager { ////////////////////////////////////////////// Working with indexes //////////////////////////////////////////////// - public List reloadIndexesOnStart(AppInitializer progress, List warnings){ + public List reloadIndexesOnStart(AppInitializer progress, List warnings) { close(); // check we have some assets to copy to sdcard warnings.addAll(checkAssets(progress, false)); @@ -429,7 +431,7 @@ public class ResourceManager { return warnings; } - public List indexFontFiles(IProgress progress){ + public List indexFontFiles(IProgress progress) { File file = context.getAppPath(IndexConstants.FONT_INDEX_DIR); file.mkdirs(); List warnings = new ArrayList(); @@ -473,10 +475,10 @@ public class ResourceManager { log.error("Error while loading tts files from assets", e); } } - + public List checkAssets(IProgress progress, boolean forceUpdate) { String fv = Version.getFullVersion(context); - if(context.getAppInitializer().isAppVersionChanged()) { + if (context.getAppInitializer().isAppVersionChanged()) { copyMissingJSAssets(); } if (!fv.equalsIgnoreCase(context.getSettings().PREVIOUS_INSTALLED_VERSION.get()) || forceUpdate) { @@ -509,7 +511,7 @@ public class ResourceManager { } return Collections.emptyList(); } - + private void copyRegionsBoundaries() { try { File file = context.getAppPath("regions.ocbf"); @@ -522,7 +524,7 @@ public class ResourceManager { log.error(e.getMessage(), e); } } - + private void copyPoiTypes() { try { File file = context.getAppPath(IndexConstants.SETTINGS_DIR + "poi_types.xml"); @@ -540,6 +542,7 @@ public class ResourceManager { private final static String ASSET_COPY_MODE__overwriteOnlyIfExists = "overwriteOnlyIfExists"; private final static String ASSET_COPY_MODE__alwaysOverwriteOrCopy = "alwaysOverwriteOrCopy"; private final static String ASSET_COPY_MODE__copyOnlyIfDoesNotExist = "copyOnlyIfDoesNotExist"; + private void unpackBundledAssets(AssetManager assetManager, File appDataDir, IProgress progress, boolean isFirstInstall) throws IOException, XmlPullParserException { List assetEntries = DownloadOsmandIndexesHelper.getBundledAssets(assetManager); for (AssetEntry asset : assetEntries) { @@ -581,7 +584,7 @@ public class ResourceManager { } public static void copyAssets(AssetManager assetManager, String assetName, File file) throws IOException { - if(file.exists()){ + if (file.exists()) { Algorithms.removeAllFiles(file); } file.getParentFile().mkdirs(); @@ -593,9 +596,9 @@ public class ResourceManager { } private List collectFiles(File dir, String ext, List files) { - if(dir.exists() && dir.canRead()) { + if (dir.exists() && dir.canRead()) { File[] lf = dir.listFiles(); - if(lf == null || lf.length == 0) { + if (lf == null || lf.length == 0) { return files; } for (File f : lf) { @@ -606,12 +609,11 @@ public class ResourceManager { } return files; } - - - + + private void renameRoadsFiles(ArrayList files, File roadsPath) { Iterator it = files.iterator(); - while(it.hasNext()) { + while (it.hasNext()) { File f = it.next(); if (f.getName().endsWith("-roads" + IndexConstants.BINARY_MAP_INDEX_EXT)) { f.renameTo(new File(roadsPath, f.getName().replace("-roads" + IndexConstants.BINARY_MAP_INDEX_EXT, @@ -628,17 +630,18 @@ public class ResourceManager { File appPath = context.getAppPath(null); File roadsPath = context.getAppPath(IndexConstants.ROADS_INDEX_DIR); roadsPath.mkdirs(); - + collectFiles(appPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); renameRoadsFiles(files, roadsPath); collectFiles(roadsPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); if (Version.isPaidVersion(context)) { collectFiles(context.getAppPath(IndexConstants.WIKI_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); + collectFiles(context.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); } if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isSubscribedToLiveUpdates(context)) { collectFiles(context.getAppPath(IndexConstants.SRTM_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); } - + changesManager.collectChangesFiles(context.getAppPath(IndexConstants.LIVE_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); Collections.sort(files, Algorithms.getFileVersionComparator()); @@ -707,9 +710,9 @@ public class ResourceManager { if (dateCreated == 0) { dateCreated = f.lastModified(); } - if(f.getParentFile().getName().equals(liveDir.getName())) { + if (f.getParentFile().getName().equals(liveDir.getName())) { boolean toUse = changesManager.index(f, dateCreated, mapReader); - if(!toUse) { + if (!toUse) { try { mapReader.close(); } catch (IOException e) { @@ -717,7 +720,7 @@ public class ResourceManager { } continue; } - } else if(!wikiMap && !srtmMap) { + } else if (!wikiMap && !srtmMap) { changesManager.indexMainMap(f, dateCreated); } indexFileNames.put(f.getName(), dateFormat.format(dateCreated)); //$NON-NLS-1$ @@ -726,7 +729,7 @@ public class ResourceManager { } renderer.initializeNewResource(progress, f, mapReader); BinaryMapReaderResource resource = new BinaryMapReaderResource(f, mapReader); - + fileReaders.put(f.getName(), resource); if (!mapReader.getRegionNames().isEmpty()) { RegionAddressRepositoryBinary rarb = new RegionAddressRepositoryBinary(this, resource); @@ -736,7 +739,7 @@ public class ResourceManager { transportRepositories.put(f.getName(), resource); } // disable osmc for routing temporarily due to some bugs - if (mapReader.containsRouteData() && (!f.getParentFile().equals(liveDir) || + if (mapReader.containsRouteData() && (!f.getParentFile().equals(liveDir) || context.getSettings().USE_OSM_LIVE_FOR_ROUTING.get())) { resource.setUseForRouting(true); } @@ -779,7 +782,7 @@ public class ResourceManager { } } Iterator>> it = toAddPoiTypes.entrySet().iterator(); - while(it.hasNext()) { + while (it.hasNext()) { Entry> next = it.next(); PoiCategory category = next.getKey(); category.addExtraPoiTypes(next.getValue()); @@ -798,7 +801,6 @@ public class ResourceManager { return warnings; } - public void initMapBoundariesCacheNative() { File indCache = context.getAppPath(INDEXES_CACHE); @@ -809,7 +811,7 @@ public class ResourceManager { } } } - + ////////////////////////////////////////////// Working with amenities //////////////////////////////////////////////// public List getAmenityRepositories() { @@ -826,7 +828,7 @@ public class ResourceManager { } public List searchAmenities(SearchPoiTypeFilter filter, - double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, final ResultMatcher matcher) { + double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, final ResultMatcher matcher) { final List amenities = new ArrayList(); searchAmenitiesInProgress = true; try { @@ -855,8 +857,8 @@ public class ResourceManager { return amenities; } - public List searchAmenitiesOnThePath(List locations, double radius, SearchPoiTypeFilter filter, - ResultMatcher matcher) { + public List searchAmenitiesOnThePath(List locations, double radius, SearchPoiTypeFilter filter, + ResultMatcher matcher) { searchAmenitiesInProgress = true; final List amenities = new ArrayList(); try { @@ -875,9 +877,9 @@ public class ResourceManager { if (!filter.isEmpty()) { for (AmenityIndexRepository index : getAmenityRepositories()) { if (index.checkContainsInt( - MapUtils.get31TileNumberY(topLatitude), - MapUtils.get31TileNumberX(leftLongitude), - MapUtils.get31TileNumberY(bottomLatitude), + MapUtils.get31TileNumberY(topLatitude), + MapUtils.get31TileNumberX(leftLongitude), + MapUtils.get31TileNumberY(bottomLatitude), MapUtils.get31TileNumberX(rightLongitude))) { repos.add(index); } @@ -885,7 +887,7 @@ public class ResourceManager { if (!repos.isEmpty()) { for (AmenityIndexRepository r : repos) { List res = r.searchAmenitiesOnThePath(locations, radius, filter, matcher); - if(res != null) { + if (res != null) { amenities.addAll(res); } } @@ -897,12 +899,12 @@ public class ResourceManager { } return amenities; } - - - public boolean containsAmenityRepositoryToSearch(boolean searchByName){ + + + public boolean containsAmenityRepositoryToSearch(boolean searchByName) { for (AmenityIndexRepository index : getAmenityRepositories()) { - if(searchByName){ - if(index instanceof AmenityIndexRepositoryBinary){ + if (searchByName) { + if (index instanceof AmenityIndexRepositoryBinary) { return true; } } else { @@ -911,10 +913,10 @@ public class ResourceManager { } return false; } - + public List searchAmenitiesByName(String searchQuery, - double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, - double lat, double lon, ResultMatcher matcher) { + double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, + double lat, double lon, ResultMatcher matcher) { List amenities = new ArrayList(); List list = new ArrayList(); int left = MapUtils.get31TileNumberX(leftLongitude); @@ -927,16 +929,16 @@ public class ResourceManager { } if (index instanceof AmenityIndexRepositoryBinary) { if (index.checkContainsInt(top, left, bottom, right)) { - if(index.checkContains(lat, lon)){ + if (index.checkContains(lat, lon)) { list.add(0, (AmenityIndexRepositoryBinary) index); } else { list.add((AmenityIndexRepositoryBinary) index); } - + } } } - + // Not using boundares results in very slow initial search if user has many maps installed // int left = 0; // int top = 0; @@ -954,7 +956,7 @@ public class ResourceManager { return amenities; } - + public Map> searchAmenityCategoriesByName(String searchQuery, double lat, double lon) { Map> map = new LinkedHashMap>(); for (AmenityIndexRepository index : getAmenityRepositories()) { @@ -970,17 +972,17 @@ public class ResourceManager { public AmenityIndexRepositoryBinary getAmenityRepositoryByFileName(String filename) { return (AmenityIndexRepositoryBinary) amenityRepositories.get(filename); } - + ////////////////////////////////////////////// Working with address /////////////////////////////////////////// - - public RegionAddressRepository getRegionRepository(String name){ + + public RegionAddressRepository getRegionRepository(String name) { return addressMap.get(name); } - - public Collection getAddressRepositories(){ + + public Collection getAddressRepositories() { return addressMap.values(); } - + public Collection getFileReaders() { List fileNames = new ArrayList<>(fileReaders.keySet()); Collections.sort(fileNames, Algorithms.getStringVersionComparator()); @@ -993,8 +995,8 @@ public class ResourceManager { } return res; } - - + + ////////////////////////////////////////////// Working with transport //////////////////////////////////////////////// private List getTransportRepositories(double topLat, double leftLon, double bottomLat, double rightLon) { @@ -1013,7 +1015,7 @@ public class ResourceManager { public List searchTransportSync(double topLat, double leftLon, double bottomLat, double rightLon, - ResultMatcher matcher) throws IOException { + ResultMatcher matcher) throws IOException { TransportStopsRouteReader readers = new TransportStopsRouteReader(getTransportRepositories(topLat, leftLon, bottomLat, rightLon)); List stops = new ArrayList<>(); @@ -1030,7 +1032,7 @@ public class ResourceManager { public List getRoutesForStop(TransportStop stop) { List rts = stop.getRoutes(); - if(rts != null) { + if (rts != null) { return rts; } return Collections.emptyList(); @@ -1040,26 +1042,26 @@ public class ResourceManager { public boolean updateRenderedMapNeeded(RotatedTileBox rotatedTileBox, DrawSettings drawSettings) { return renderer.updateMapIsNeeded(rotatedTileBox, drawSettings); } - - public void updateRendererMap(RotatedTileBox rotatedTileBox, OnMapLoadedListener mapLoadedListener){ + + public void updateRendererMap(RotatedTileBox rotatedTileBox, OnMapLoadedListener mapLoadedListener) { renderer.interruptLoadingMap(); asyncLoadingThread.requestToLoadMap(new MapLoadRequest(rotatedTileBox, mapLoadedListener)); } - - public void interruptRendering(){ + + public void interruptRendering() { renderer.interruptLoadingMap(); } - + public boolean isSearchAmenitiesInProgress() { return searchAmenitiesInProgress; } - + public MapRenderRepositories getRenderer() { return renderer; } - + ////////////////////////////////////////////// Closing methods //////////////////////////////////////////////// - + public void closeFile(String fileName) { amenityRepositories.remove(fileName); addressMap.remove(fileName); @@ -1067,12 +1069,12 @@ public class ResourceManager { indexFileNames.remove(fileName); renderer.closeConnection(fileName); BinaryMapReaderResource resource = fileReaders.remove(fileName); - if(resource != null) { + if (resource != null) { resource.close(); } - } + } - public synchronized void close(){ + public synchronized void close() { for (TilesCache tc : tilesCacheList) { tc.close(); } @@ -1082,13 +1084,13 @@ public class ResourceManager { transportRepositories.clear(); addressMap.clear(); amenityRepositories.clear(); - for(BinaryMapReaderResource res : fileReaders.values()) { + for (BinaryMapReaderResource res : fileReaders.values()) { res.close(); } fileReaders.clear(); } - - + + public BinaryMapIndexReader[] getRoutingMapFiles() { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); @@ -1107,7 +1109,7 @@ public class ResourceManager { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); for (BinaryMapReaderResource r : fileReaders) { - if (r.isUseForPublicTransport()) { + if (r.isUseForPublicTransport()) { BinaryMapIndexReader reader = r.getReader(BinaryMapReaderResourceType.TRANSPORT_ROUTING); if (reader != null) { readers.add(reader); @@ -1132,12 +1134,29 @@ public class ResourceManager { return readers.toArray(new BinaryMapIndexReader[0]); } + public BinaryMapIndexReader[] getTravelFiles() { + Collection fileReaders = getFileReaders(); + List readers = new ArrayList<>(fileReaders.size()); + for (BinaryMapReaderResource res : fileReaders) { + if (!res.filename.toString().toLowerCase().contains("wiki")) { + continue; + } + BinaryMapIndexReader index = res.getReader(BinaryMapReaderResourceType.POI); + for (BinaryIndexPart p : index.getIndexes()) { + if (p instanceof BinaryMapPoiReaderAdapter.PoiRegion) { + readers.add(index); + } + } + } + return readers.toArray(new BinaryMapIndexReader[0]); + } + public Map getIndexFileNames() { return new LinkedHashMap(indexFileNames); } - - - public boolean containsBasemap(){ + + + public boolean containsBasemap() { return !basemapFileNames.isEmpty(); } @@ -1171,13 +1190,13 @@ public class ResourceManager { } return map; } - + public synchronized void reloadTilesFromFS() { for (TilesCache tc : tilesCacheList) { tc.tilesOnFS.clear(); } } - + /// On low memory method /// public void onLowMemory() { log.info("On low memory"); @@ -1186,10 +1205,10 @@ public class ResourceManager { r.clearCache(); } renderer.clearCache(); - + System.gc(); } - + public GeoidAltitudeCorrection getGeoidAltitudeCorrection() { return geoidAltitudeCorrection; } @@ -1204,7 +1223,7 @@ public class ResourceManager { tc.clearTiles(); } } - + public IncrementalChangesManager getChangesManager() { return changesManager; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 9ccdc5f6c8..df3de7f14f 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -85,23 +85,23 @@ public class TravelObfHelper implements TravelHelper { * 2. check settings for default? */ public void initTravelBooks() { - List files = getPossibleFiles(); + BinaryMapIndexReader[] readers = application.getResourceManager().getTravelFiles(); String travelBook = application.getSettings().SELECTED_TRAVEL_BOOK.get(); existingTravelBooks.clear(); - if (files != null && !files.isEmpty()) { - for (File f : files) { + if (readers != null) { + for (BinaryMapIndexReader reader : readers) { + File f = reader.getFile(); existingTravelBooks.add(f); if (selectedTravelBook == null) { selectedTravelBook = f; } else if (Algorithms.objectEquals(travelBook, f.getName())) { selectedTravelBook = f; } + selectedTravelBook = reader.getFile(); } - selectedTravelBook = files.get(0); } else { selectedTravelBook = null; } - } /** @@ -147,6 +147,7 @@ public class TravelObfHelper implements TravelHelper { @NonNull @Override public List search(String searchQuery) { + List res = new ArrayList<>(); CollatorStringMatcher matcher = new CollatorStringMatcher(searchQuery, CollatorStringMatcher.StringMatcherMode.CHECK_STARTS_FROM_SPACE); From 6babf25c399fac50d560ed87a5a501519df1c0bb Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 9 Dec 2020 15:30:45 +0200 Subject: [PATCH 03/91] cleanup --- .../plus/wikivoyage/data/TravelObfHelper.java | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index df3de7f14f..eb7e3b3d09 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -104,26 +104,6 @@ public class TravelObfHelper implements TravelHelper { } } - /** - * 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(); From f31ad60d471870a66b70f90a1f4c8224dd29bf32 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 9 Dec 2020 16:29:59 +0200 Subject: [PATCH 04/91] travel constant fix --- OsmAnd/src/net/osmand/plus/resources/ResourceManager.java | 2 +- .../src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index c8b5bdec16..9dca53fe40 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -1138,7 +1138,7 @@ public class ResourceManager { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); for (BinaryMapReaderResource res : fileReaders) { - if (!res.filename.toString().toLowerCase().contains("wiki")) { + if (!res.filename.toString().toLowerCase().contains("travel.obf")) { continue; } BinaryMapIndexReader index = res.getReader(BinaryMapReaderResourceType.POI); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index eb7e3b3d09..b5952de7c7 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -1,7 +1,6 @@ package net.osmand.plus.wikivoyage.data; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import net.osmand.Collator; import net.osmand.CollatorStringMatcher; @@ -66,7 +65,7 @@ public class TravelObfHelper implements TravelHelper { 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) || f.getName().contains("travel.obf")) { return true; } } @@ -127,7 +126,6 @@ public class TravelObfHelper implements TravelHelper { @NonNull @Override public List search(String searchQuery) { - List res = new ArrayList<>(); CollatorStringMatcher matcher = new CollatorStringMatcher(searchQuery, CollatorStringMatcher.StringMatcherMode.CHECK_STARTS_FROM_SPACE); From 2aac3e5fd89002c27169a5b819a391542c7ac5d7 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 9 Dec 2020 17:15:48 +0200 Subject: [PATCH 05/91] formatting --- .../plus/resources/ResourceManager.java | 215 +++++++++--------- 1 file changed, 108 insertions(+), 107 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 9dca53fe40..0069699dbd 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -77,14 +77,15 @@ import java.util.Map.Entry; import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; + import static net.osmand.IndexConstants.VOICE_INDEX_DIR; /** - * Resource manager is responsible to work with all resources + * Resource manager is responsible to work with all resources * that could consume memory (especially with file resources). * Such as indexes, tiles. * Also it is responsible to create cache for that resources if they - * can't be loaded fully into memory & clear them on request. + * can't be loaded fully into memory & clear them on request. */ public class ResourceManager { @@ -92,10 +93,10 @@ public class ResourceManager { private static final String INDEXES_CACHE = "ind.cache"; private static final Log log = PlatformUtil.getLog(ResourceManager.class); - + protected static ResourceManager manager = null; - protected File dirWithTiles; + protected File dirWithTiles ; private List tilesCacheList = new ArrayList<>(); private BitmapTilesCache bitmapTilesCache; @@ -116,22 +117,21 @@ public class ResourceManager { STREET_LOOKUP, TRANSPORT, ADDRESS, - QUICK_SEARCH, + QUICK_SEARCH, ROUTING, TRANSPORT_ROUTING } - + public static class BinaryMapReaderResource { private BinaryMapIndexReader initialReader; private File filename; private List readers = new ArrayList<>(BinaryMapReaderResourceType.values().length); private boolean useForRouting; private boolean useForPublicTransport; - public BinaryMapReaderResource(File f, BinaryMapIndexReader initialReader) { this.filename = f; this.initialReader = initialReader; - while (readers.size() < BinaryMapReaderResourceType.values().length) { + while(readers.size() < BinaryMapReaderResourceType.values().length) { readers.add(null); } } @@ -175,7 +175,7 @@ public class ResourceManager { } initialReader = null; } - + public boolean isClosed() { return initialReader == null; } @@ -191,7 +191,7 @@ public class ResourceManager { public void setUseForRouting(boolean useForRouting) { this.useForRouting = useForRouting; } - + public boolean isUseForRouting() { return useForRouting; } @@ -204,34 +204,34 @@ public class ResourceManager { this.useForPublicTransport = useForPublicTransport; } } - + protected final Map fileReaders = new ConcurrentHashMap(); - - + + private final Map addressMap = new ConcurrentHashMap(); - protected final Map amenityRepositories = new ConcurrentHashMap(); - // protected final Map routingMapFiles = new ConcurrentHashMap(); + protected final Map amenityRepositories = new ConcurrentHashMap(); +// protected final Map routingMapFiles = new ConcurrentHashMap(); protected final Map transportRepositories = new ConcurrentHashMap(); - + protected final Map indexFileNames = new ConcurrentHashMap(); protected final Map basemapFileNames = new ConcurrentHashMap(); - - + + protected final IncrementalChangesManager changesManager = new IncrementalChangesManager(this); - + protected final MapRenderRepositories renderer; protected final MapTileDownloader tileDownloader; - + public final AsyncLoadingThread asyncLoadingThread = new AsyncLoadingThread(this); - + private HandlerThread renderingBufferImageThread; - + protected boolean internetIsNotAccessible = false; private boolean depthContours; - + public ResourceManager(OsmandApplication context) { - + this.context = context; this.renderer = new MapRenderRepositories(context); @@ -273,7 +273,7 @@ public class ResourceManager { public MapTileDownloader getMapTileDownloader() { return tileDownloader; } - + public HandlerThread getRenderingBufferImageThread() { return renderingBufferImageThread; } @@ -295,17 +295,17 @@ public class ResourceManager { // ".nomedia" indicates there are no pictures and no music to list in this dir for the Gallery app try { context.getAppPath(".nomedia").createNewFile(); //$NON-NLS-1$ - } catch (Exception e) { + } catch( Exception e ) { } for (TilesCache tilesCache : tilesCacheList) { tilesCache.setDirWithTiles(dirWithTiles); } } - + public java.text.DateFormat getDateFormat() { return DateFormat.getDateFormat(context); } - + public OsmandApplication getContext() { return context; } @@ -325,7 +325,7 @@ public class ResourceManager { return null; } - public synchronized void tileDownloaded(DownloadRequest request) { + public synchronized void tileDownloaded(DownloadRequest request){ if (request instanceof TileLoadDownloadRequest) { TileLoadDownloadRequest req = ((TileLoadDownloadRequest) request); TilesCache cache = getTilesCache(req.tileSource); @@ -334,13 +334,13 @@ public class ResourceManager { } } } - + public synchronized boolean tileExistOnFileSystem(String file, ITileSource map, int x, int y, int zoom) { TilesCache cache = getTilesCache(map); return cache != null && cache.tileExistOnFileSystem(file, map, x, y, zoom); } - - public void clearTileForMap(String file, ITileSource map, int x, int y, int zoom) { + + public void clearTileForMap(String file, ITileSource map, int x, int y, int zoom){ TilesCache cache = getTilesCache(map); if (cache != null) { cache.getTileForMap(file, map, x, y, zoom, true, false, true, true); @@ -378,7 +378,7 @@ public class ResourceManager { ////////////////////////////////////////////// Working with indexes //////////////////////////////////////////////// - public List reloadIndexesOnStart(AppInitializer progress, List warnings) { + public List reloadIndexesOnStart(AppInitializer progress, List warnings){ close(); // check we have some assets to copy to sdcard warnings.addAll(checkAssets(progress, false)); @@ -431,7 +431,7 @@ public class ResourceManager { return warnings; } - public List indexFontFiles(IProgress progress) { + public List indexFontFiles(IProgress progress){ File file = context.getAppPath(IndexConstants.FONT_INDEX_DIR); file.mkdirs(); List warnings = new ArrayList(); @@ -475,10 +475,10 @@ public class ResourceManager { log.error("Error while loading tts files from assets", e); } } - + public List checkAssets(IProgress progress, boolean forceUpdate) { String fv = Version.getFullVersion(context); - if (context.getAppInitializer().isAppVersionChanged()) { + if(context.getAppInitializer().isAppVersionChanged()) { copyMissingJSAssets(); } if (!fv.equalsIgnoreCase(context.getSettings().PREVIOUS_INSTALLED_VERSION.get()) || forceUpdate) { @@ -511,7 +511,7 @@ public class ResourceManager { } return Collections.emptyList(); } - + private void copyRegionsBoundaries() { try { File file = context.getAppPath("regions.ocbf"); @@ -524,7 +524,7 @@ public class ResourceManager { log.error(e.getMessage(), e); } } - + private void copyPoiTypes() { try { File file = context.getAppPath(IndexConstants.SETTINGS_DIR + "poi_types.xml"); @@ -542,7 +542,6 @@ public class ResourceManager { private final static String ASSET_COPY_MODE__overwriteOnlyIfExists = "overwriteOnlyIfExists"; private final static String ASSET_COPY_MODE__alwaysOverwriteOrCopy = "alwaysOverwriteOrCopy"; private final static String ASSET_COPY_MODE__copyOnlyIfDoesNotExist = "copyOnlyIfDoesNotExist"; - private void unpackBundledAssets(AssetManager assetManager, File appDataDir, IProgress progress, boolean isFirstInstall) throws IOException, XmlPullParserException { List assetEntries = DownloadOsmandIndexesHelper.getBundledAssets(assetManager); for (AssetEntry asset : assetEntries) { @@ -584,7 +583,7 @@ public class ResourceManager { } public static void copyAssets(AssetManager assetManager, String assetName, File file) throws IOException { - if (file.exists()) { + if(file.exists()){ Algorithms.removeAllFiles(file); } file.getParentFile().mkdirs(); @@ -596,9 +595,9 @@ public class ResourceManager { } private List collectFiles(File dir, String ext, List files) { - if (dir.exists() && dir.canRead()) { + if(dir.exists() && dir.canRead()) { File[] lf = dir.listFiles(); - if (lf == null || lf.length == 0) { + if(lf == null || lf.length == 0) { return files; } for (File f : lf) { @@ -609,11 +608,12 @@ public class ResourceManager { } return files; } - - + + + private void renameRoadsFiles(ArrayList files, File roadsPath) { Iterator it = files.iterator(); - while (it.hasNext()) { + while(it.hasNext()) { File f = it.next(); if (f.getName().endsWith("-roads" + IndexConstants.BINARY_MAP_INDEX_EXT)) { f.renameTo(new File(roadsPath, f.getName().replace("-roads" + IndexConstants.BINARY_MAP_INDEX_EXT, @@ -630,18 +630,17 @@ public class ResourceManager { File appPath = context.getAppPath(null); File roadsPath = context.getAppPath(IndexConstants.ROADS_INDEX_DIR); roadsPath.mkdirs(); - + collectFiles(appPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); renameRoadsFiles(files, roadsPath); collectFiles(roadsPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); if (Version.isPaidVersion(context)) { collectFiles(context.getAppPath(IndexConstants.WIKI_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); - collectFiles(context.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); } if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isSubscribedToLiveUpdates(context)) { collectFiles(context.getAppPath(IndexConstants.SRTM_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); } - + changesManager.collectChangesFiles(context.getAppPath(IndexConstants.LIVE_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); Collections.sort(files, Algorithms.getFileVersionComparator()); @@ -710,9 +709,9 @@ public class ResourceManager { if (dateCreated == 0) { dateCreated = f.lastModified(); } - if (f.getParentFile().getName().equals(liveDir.getName())) { + if(f.getParentFile().getName().equals(liveDir.getName())) { boolean toUse = changesManager.index(f, dateCreated, mapReader); - if (!toUse) { + if(!toUse) { try { mapReader.close(); } catch (IOException e) { @@ -720,7 +719,7 @@ public class ResourceManager { } continue; } - } else if (!wikiMap && !srtmMap) { + } else if(!wikiMap && !srtmMap) { changesManager.indexMainMap(f, dateCreated); } indexFileNames.put(f.getName(), dateFormat.format(dateCreated)); //$NON-NLS-1$ @@ -729,7 +728,7 @@ public class ResourceManager { } renderer.initializeNewResource(progress, f, mapReader); BinaryMapReaderResource resource = new BinaryMapReaderResource(f, mapReader); - + fileReaders.put(f.getName(), resource); if (!mapReader.getRegionNames().isEmpty()) { RegionAddressRepositoryBinary rarb = new RegionAddressRepositoryBinary(this, resource); @@ -739,7 +738,7 @@ public class ResourceManager { transportRepositories.put(f.getName(), resource); } // disable osmc for routing temporarily due to some bugs - if (mapReader.containsRouteData() && (!f.getParentFile().equals(liveDir) || + if (mapReader.containsRouteData() && (!f.getParentFile().equals(liveDir) || context.getSettings().USE_OSM_LIVE_FOR_ROUTING.get())) { resource.setUseForRouting(true); } @@ -782,7 +781,7 @@ public class ResourceManager { } } Iterator>> it = toAddPoiTypes.entrySet().iterator(); - while (it.hasNext()) { + while(it.hasNext()) { Entry> next = it.next(); PoiCategory category = next.getKey(); category.addExtraPoiTypes(next.getValue()); @@ -801,6 +800,7 @@ public class ResourceManager { return warnings; } + public void initMapBoundariesCacheNative() { File indCache = context.getAppPath(INDEXES_CACHE); @@ -811,7 +811,7 @@ public class ResourceManager { } } } - + ////////////////////////////////////////////// Working with amenities //////////////////////////////////////////////// public List getAmenityRepositories() { @@ -828,7 +828,7 @@ public class ResourceManager { } public List searchAmenities(SearchPoiTypeFilter filter, - double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, final ResultMatcher matcher) { + double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, final ResultMatcher matcher) { final List amenities = new ArrayList(); searchAmenitiesInProgress = true; try { @@ -857,8 +857,8 @@ public class ResourceManager { return amenities; } - public List searchAmenitiesOnThePath(List locations, double radius, SearchPoiTypeFilter filter, - ResultMatcher matcher) { + public List searchAmenitiesOnThePath(List locations, double radius, SearchPoiTypeFilter filter, + ResultMatcher matcher) { searchAmenitiesInProgress = true; final List amenities = new ArrayList(); try { @@ -877,9 +877,9 @@ public class ResourceManager { if (!filter.isEmpty()) { for (AmenityIndexRepository index : getAmenityRepositories()) { if (index.checkContainsInt( - MapUtils.get31TileNumberY(topLatitude), - MapUtils.get31TileNumberX(leftLongitude), - MapUtils.get31TileNumberY(bottomLatitude), + MapUtils.get31TileNumberY(topLatitude), + MapUtils.get31TileNumberX(leftLongitude), + MapUtils.get31TileNumberY(bottomLatitude), MapUtils.get31TileNumberX(rightLongitude))) { repos.add(index); } @@ -887,7 +887,7 @@ public class ResourceManager { if (!repos.isEmpty()) { for (AmenityIndexRepository r : repos) { List res = r.searchAmenitiesOnThePath(locations, radius, filter, matcher); - if (res != null) { + if(res != null) { amenities.addAll(res); } } @@ -899,12 +899,12 @@ public class ResourceManager { } return amenities; } - - - public boolean containsAmenityRepositoryToSearch(boolean searchByName) { + + + public boolean containsAmenityRepositoryToSearch(boolean searchByName){ for (AmenityIndexRepository index : getAmenityRepositories()) { - if (searchByName) { - if (index instanceof AmenityIndexRepositoryBinary) { + if(searchByName){ + if(index instanceof AmenityIndexRepositoryBinary){ return true; } } else { @@ -913,10 +913,10 @@ public class ResourceManager { } return false; } - + public List searchAmenitiesByName(String searchQuery, - double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, - double lat, double lon, ResultMatcher matcher) { + double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, + double lat, double lon, ResultMatcher matcher) { List amenities = new ArrayList(); List list = new ArrayList(); int left = MapUtils.get31TileNumberX(leftLongitude); @@ -929,16 +929,16 @@ public class ResourceManager { } if (index instanceof AmenityIndexRepositoryBinary) { if (index.checkContainsInt(top, left, bottom, right)) { - if (index.checkContains(lat, lon)) { + if(index.checkContains(lat, lon)){ list.add(0, (AmenityIndexRepositoryBinary) index); } else { list.add((AmenityIndexRepositoryBinary) index); } - + } } } - + // Not using boundares results in very slow initial search if user has many maps installed // int left = 0; // int top = 0; @@ -956,7 +956,7 @@ public class ResourceManager { return amenities; } - + public Map> searchAmenityCategoriesByName(String searchQuery, double lat, double lon) { Map> map = new LinkedHashMap>(); for (AmenityIndexRepository index : getAmenityRepositories()) { @@ -972,17 +972,17 @@ public class ResourceManager { public AmenityIndexRepositoryBinary getAmenityRepositoryByFileName(String filename) { return (AmenityIndexRepositoryBinary) amenityRepositories.get(filename); } - + ////////////////////////////////////////////// Working with address /////////////////////////////////////////// - - public RegionAddressRepository getRegionRepository(String name) { + + public RegionAddressRepository getRegionRepository(String name){ return addressMap.get(name); } - - public Collection getAddressRepositories() { + + public Collection getAddressRepositories(){ return addressMap.values(); } - + public Collection getFileReaders() { List fileNames = new ArrayList<>(fileReaders.keySet()); Collections.sort(fileNames, Algorithms.getStringVersionComparator()); @@ -995,8 +995,8 @@ public class ResourceManager { } return res; } - - + + ////////////////////////////////////////////// Working with transport //////////////////////////////////////////////// private List getTransportRepositories(double topLat, double leftLon, double bottomLat, double rightLon) { @@ -1015,7 +1015,7 @@ public class ResourceManager { public List searchTransportSync(double topLat, double leftLon, double bottomLat, double rightLon, - ResultMatcher matcher) throws IOException { + ResultMatcher matcher) throws IOException { TransportStopsRouteReader readers = new TransportStopsRouteReader(getTransportRepositories(topLat, leftLon, bottomLat, rightLon)); List stops = new ArrayList<>(); @@ -1032,7 +1032,7 @@ public class ResourceManager { public List getRoutesForStop(TransportStop stop) { List rts = stop.getRoutes(); - if (rts != null) { + if(rts != null) { return rts; } return Collections.emptyList(); @@ -1042,26 +1042,26 @@ public class ResourceManager { public boolean updateRenderedMapNeeded(RotatedTileBox rotatedTileBox, DrawSettings drawSettings) { return renderer.updateMapIsNeeded(rotatedTileBox, drawSettings); } - - public void updateRendererMap(RotatedTileBox rotatedTileBox, OnMapLoadedListener mapLoadedListener) { + + public void updateRendererMap(RotatedTileBox rotatedTileBox, OnMapLoadedListener mapLoadedListener){ renderer.interruptLoadingMap(); asyncLoadingThread.requestToLoadMap(new MapLoadRequest(rotatedTileBox, mapLoadedListener)); } - - public void interruptRendering() { + + public void interruptRendering(){ renderer.interruptLoadingMap(); } - + public boolean isSearchAmenitiesInProgress() { return searchAmenitiesInProgress; } - + public MapRenderRepositories getRenderer() { return renderer; } - + ////////////////////////////////////////////// Closing methods //////////////////////////////////////////////// - + public void closeFile(String fileName) { amenityRepositories.remove(fileName); addressMap.remove(fileName); @@ -1069,12 +1069,12 @@ public class ResourceManager { indexFileNames.remove(fileName); renderer.closeConnection(fileName); BinaryMapReaderResource resource = fileReaders.remove(fileName); - if (resource != null) { + if(resource != null) { resource.close(); } - } + } - public synchronized void close() { + public synchronized void close(){ for (TilesCache tc : tilesCacheList) { tc.close(); } @@ -1084,13 +1084,13 @@ public class ResourceManager { transportRepositories.clear(); addressMap.clear(); amenityRepositories.clear(); - for (BinaryMapReaderResource res : fileReaders.values()) { + for(BinaryMapReaderResource res : fileReaders.values()) { res.close(); } fileReaders.clear(); } - - + + public BinaryMapIndexReader[] getRoutingMapFiles() { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); @@ -1109,7 +1109,7 @@ public class ResourceManager { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); for (BinaryMapReaderResource r : fileReaders) { - if (r.isUseForPublicTransport()) { + if (r.isUseForPublicTransport()) { BinaryMapIndexReader reader = r.getReader(BinaryMapReaderResourceType.TRANSPORT_ROUTING); if (reader != null) { readers.add(reader); @@ -1151,12 +1151,13 @@ public class ResourceManager { return readers.toArray(new BinaryMapIndexReader[0]); } + public Map getIndexFileNames() { return new LinkedHashMap(indexFileNames); } - - - public boolean containsBasemap() { + + + public boolean containsBasemap(){ return !basemapFileNames.isEmpty(); } @@ -1190,13 +1191,13 @@ public class ResourceManager { } return map; } - + public synchronized void reloadTilesFromFS() { for (TilesCache tc : tilesCacheList) { tc.tilesOnFS.clear(); } } - + /// On low memory method /// public void onLowMemory() { log.info("On low memory"); @@ -1205,10 +1206,10 @@ public class ResourceManager { r.clearCache(); } renderer.clearCache(); - + System.gc(); } - + public GeoidAltitudeCorrection getGeoidAltitudeCorrection() { return geoidAltitudeCorrection; } @@ -1223,7 +1224,7 @@ public class ResourceManager { tc.clearTiles(); } } - + public IncrementalChangesManager getChangesManager() { return changesManager; } From 11aeaef2c5a2e80c734c20f62dce28d1765ddda5 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 10 Dec 2020 16:42:09 +0200 Subject: [PATCH 06/91] starting obf helper --- .../src/net/osmand/plus/AppInitializer.java | 3 +- .../plus/resources/ResourceManager.java | 5 +- .../plus/wikivoyage/data/TravelObfHelper.java | 211 ++++++++++++++++++ 3 files changed, 216 insertions(+), 3 deletions(-) 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 3a75558fe5..ecbd2293df 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -67,6 +67,7 @@ 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; @@ -459,7 +460,7 @@ public class AppInitializer implements IProgress { app.mapViewTrackingUtilities = startupInit(new MapViewTrackingUtilities(app), MapViewTrackingUtilities.class); // TODOTRAVEL_OBF_HELPER check ResourceManager and use TravelObfHelper - app.travelHelper = new TravelDbHelper(app); + app.travelHelper = new TravelObfHelper(app); //new TravelDbHelper(app); app.travelHelper.initializeDataOnAppStartup(); app.travelHelper = startupInit(app.travelHelper, TravelHelper.class); diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 0069699dbd..eb88b16e52 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -636,6 +636,7 @@ public class ResourceManager { collectFiles(roadsPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); if (Version.isPaidVersion(context)) { collectFiles(context.getAppPath(IndexConstants.WIKI_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); + collectFiles(context.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); } if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isSubscribedToLiveUpdates(context)) { collectFiles(context.getAppPath(IndexConstants.SRTM_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); @@ -1134,7 +1135,7 @@ public class ResourceManager { return readers.toArray(new BinaryMapIndexReader[0]); } - public BinaryMapIndexReader[] getTravelFiles() { + public List getTravelFiles() { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); for (BinaryMapReaderResource res : fileReaders) { @@ -1148,7 +1149,7 @@ public class ResourceManager { } } } - return readers.toArray(new BinaryMapIndexReader[0]); + return readers; } 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..205d2378c7 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -0,0 +1,211 @@ +package net.osmand.plus.wikivoyage.data; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import net.osmand.CollatorStringMatcher; +import net.osmand.GPXUtilities; +import net.osmand.IndexConstants; +import net.osmand.PlatformUtil; +import net.osmand.ResultMatcher; +import net.osmand.binary.BinaryMapIndexReader; +import net.osmand.data.Amenity; +import net.osmand.data.MapObject; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.R; +import net.osmand.plus.api.SQLiteAPI; +import net.osmand.util.Algorithms; + +import org.apache.commons.logging.Log; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public class TravelObfHelper implements TravelHelper { + + private static final Log LOG = PlatformUtil.getLog(TravelObfHelper.class); + + private static final int POPULAR_LIMIT = 25; + + private final OsmandApplication application; + + private TravelLocalDataHelper localDataHelper; + private SQLiteAPI.SQLiteConnection connection = null; + + private File selectedTravelBook = null; + private List files; + private List existingTravelBooks = new ArrayList<>(); + private List popularArticles = new ArrayList(); + + + public TravelObfHelper(OsmandApplication application) { + this.application = application; + localDataHelper = new TravelLocalDataHelper(application); + } + + public TravelLocalDataHelper getBookmarksHelper() { + return localDataHelper; + } + + @Override + public boolean isAnyTravelBookPresent() { + return selectedTravelBook != null; + } + + public void initializeDataOnAppStartup() { + 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; + } + } + } else { + selectedTravelBook = null; + } + } + + @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().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT)) { + res.add(file); + } + } + return res; + } + return null; + } + + public void initializeDataToDisplay() { + localDataHelper.refreshCachedData(); + loadPopularArticles(); + } + + + public String getSelectedTravelBookName() { + if (selectedTravelBook != null) { + return selectedTravelBook.getName(); + } + return null; + } + + public List getExistingTravelBooks() { + return existingTravelBooks; + } + + @NonNull + public List search(final String searchQuery) { + // TODO remove + this.files = application.getResourceManager().getTravelFiles(); + List res = new ArrayList<>(); + List searchObjects = new ArrayList<>(); + for (BinaryMapIndexReader reader : files) { + try { + BinaryMapIndexReader.SearchRequest searchRequest = BinaryMapIndexReader. + buildSearchPoiRequest(0, 0, searchQuery, + 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null); + + searchObjects = reader.searchPoiByName(searchRequest); + } catch (IOException e) { + LOG.error(e); + } + } + for (MapObject obj : searchObjects) { + //TODO map + WikivoyageSearchResult r = new WikivoyageSearchResult(); + r.articleTitles = Collections.singletonList(obj.getName()); + r.langs = Collections.singletonList(obj.getName()); + r.imageTitle = (obj.getName()); + r.isPartOf = Collections.singletonList(obj.getName()); + r.routeId = "routeid";//obj.getId(); + res.add(r); + } + return res; + } + + @NonNull + public List getPopularArticles() { + return popularArticles; + } + + @Override + public Map> getNavigationMap(TravelArticle article) { + return null; + } + + @Override + public TravelArticle getArticleById(String routeId, String lang) { + return null; + } + + @Override + public TravelArticle getArticleByTitle(String title, String lang) { + return null; + } + + @Override + public String getArticleId(String title, String lang) { + return null; + } + + @Override + public ArrayList getArticleLangs(String articleId) { + return null; + } + + @NonNull + public List loadPopularArticles() { + popularArticles = new ArrayList<>(); + return popularArticles; + } + + public String formatTravelBookName(File tb) { + if (tb == null) { + return application.getString(R.string.shared_string_none); + } + String nm = tb.getName(); + return nm.substring(0, nm.indexOf('.')).replace('_', ' '); + } + + public String getGPXName(TravelArticle article) { + return article.getTitle().replace('/', '_').replace('\'', '_') + .replace('\"', '_') + IndexConstants.GPX_FILE_EXT; + } + + public File createGpxFile(TravelArticle article) { + 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; + } + + // might use in future + protected static class PopularArticle { + String tripId; + String title; + String lang; + int popIndex; + int order; + double lat; + double lon; + + public boolean isLocationSpecified() { + return !Double.isNaN(lat) && !Double.isNaN(lon); + } + } +} From 2179e08e23fb0d549658f192e4063ada048a7656 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Thu, 10 Dec 2020 17:16:13 +0200 Subject: [PATCH 07/91] Motorcycle, Strings rename Motorcycle profile added Custom profile -> User profile Base profile -> OsmAnd profile --- OsmAnd/res/layout/preference_dropdown_list.xml | 2 +- .../res/layout/profile_preference_toolbar_big.xml | 2 +- OsmAnd/res/values/strings.xml | 2 ++ .../osmand/plus/activities/MapActivityActions.java | 8 ++++---- .../plus/profiles/RoutingProfileDataObject.java | 1 + .../routepreparationmenu/RoutingOptionsHelper.java | 3 +++ .../plus/settings/backend/ApplicationMode.java | 14 +++++++++----- .../plus/settings/backend/OsmandSettings.java | 7 ++++++- .../settings/fragments/BaseSettingsFragment.java | 4 ++-- .../settings/fragments/ExportItemsBottomSheet.java | 2 +- .../fragments/ProfileAppearanceFragment.java | 2 +- 11 files changed, 31 insertions(+), 16 deletions(-) diff --git a/OsmAnd/res/layout/preference_dropdown_list.xml b/OsmAnd/res/layout/preference_dropdown_list.xml index 6f247664fa..80e62be873 100644 --- a/OsmAnd/res/layout/preference_dropdown_list.xml +++ b/OsmAnd/res/layout/preference_dropdown_list.xml @@ -33,7 +33,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="60dp" - app:labelText="@string/profile_type_base_string" + app:labelText="@string/profile_type_osmand_string" app:primaryColor="@color/active_color_primary_dark" app:secondaryColor="?android:textColorSecondary"> diff --git a/OsmAnd/res/layout/profile_preference_toolbar_big.xml b/OsmAnd/res/layout/profile_preference_toolbar_big.xml index 6ee4c0d2a0..dd348c785b 100644 --- a/OsmAnd/res/layout/profile_preference_toolbar_big.xml +++ b/OsmAnd/res/layout/profile_preference_toolbar_big.xml @@ -99,7 +99,7 @@ android:textColor="?android:textColorPrimary" android:textSize="@dimen/default_list_text_size" osmand:typeface="@string/font_roboto_regular" - tools:text="@string/profile_type_base_string" /> + tools:text="@string/profile_type_osmand_string" /> + User profile + OsmAnd profile Add a new segment Split after Split before diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 0213268a05..b62ee46e20 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -740,9 +740,9 @@ public class MapActivityActions implements DialogProvider { Map profilesObjects = getRoutingProfiles(app); for (final ApplicationMode appMode : activeModes) { if (appMode.isCustomProfile()) { - modeDescription = getProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_custom_string)); + modeDescription = getProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_user_string)); } else { - modeDescription = getProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_base_string)); + modeDescription = getProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_osmand_string)); } int tag = currentMode.equals(appMode) ? PROFILES_CHOSEN_PROFILE_TAG : PROFILES_NORMAL_PROFILE_TAG; @@ -1048,9 +1048,9 @@ public class MapActivityActions implements DialogProvider { String modeDescription; Map profilesObjects = getRoutingProfiles(app); if (currentMode.isCustomProfile()) { - modeDescription = getProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_custom_string)); + modeDescription = getProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_user_string)); } else { - modeDescription = getProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_base_string)); + modeDescription = getProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_osmand_string)); } int icArrowResId = listExpanded ? R.drawable.ic_action_arrow_drop_up : R.drawable.ic_action_arrow_drop_down; diff --git a/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java b/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java index da6e370fde..5810d6f87d 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java +++ b/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java @@ -30,6 +30,7 @@ public class RoutingProfileDataObject extends ProfileDataObject { PUBLIC_TRANSPORT(R.string.app_mode_public_transport, R.drawable.ic_action_bus_dark), BOAT(R.string.app_mode_boat, R.drawable.ic_action_sail_boat_dark), TRUCK(R.string.app_mode_truck, R.drawable.ic_action_truck_dark), + MOTORCYCLE(R.string.app_mode_motorcycle, R.drawable.ic_action_motorcycle_dark), GEOCODING(R.string.routing_profile_geocoding, R.drawable.ic_action_world_globe); int stringRes; diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java index de3924fe0f..31487d2ba7 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java @@ -1051,6 +1051,7 @@ public class RoutingOptionsHelper { AIRCRAFT(MuteSoundRoutingParameter.KEY), SKI(MuteSoundRoutingParameter.KEY, DRIVING_STYLE, GeneralRouter.USE_HEIGHT_OBSTACLES), TRUCK(MuteSoundRoutingParameter.KEY, AvoidRoadsRoutingParameter.KEY), + MOTORCYCLE(MuteSoundRoutingParameter.KEY, AvoidRoadsRoutingParameter.KEY), OTHER(MuteSoundRoutingParameter.KEY); List routingParameters; @@ -1081,6 +1082,8 @@ public class RoutingOptionsHelper { return PermanentAppModeOptions.SKI.routingParameters; } else if (appMode.isDerivedRoutingFrom(ApplicationMode.TRUCK)) { return PermanentAppModeOptions.TRUCK.routingParameters; + } else if (appMode.isDerivedRoutingFrom(ApplicationMode.MOTORCYCLE)) { + return PermanentAppModeOptions.MOTORCYCLE.routingParameters; } else { return PermanentAppModeOptions.OTHER.routingParameters; } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java index b1b98e17f2..40b0c53016 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java @@ -108,10 +108,14 @@ public class ApplicationMode { .icon(R.drawable.ic_action_skiing) .description(R.string.base_profile_descr_ski).reg(); - public static final ApplicationMode TRUCK = createBase(R.string.app_mode_truck, "ic_action_truck_dark") + public static final ApplicationMode TRUCK = createBase(R.string.app_mode_truck, "truck") .icon(R.drawable.ic_action_truck_dark) .description(R.string.app_mode_truck).reg(); + public static final ApplicationMode MOTORCYCLE = createBase(R.string.app_mode_truck, "motorcycle") + .icon(R.drawable.ic_action_motorcycle_dark) + .description(R.string.app_mode_motorcycle).reg(); + public static List values(OsmandApplication app) { if (customizationListener == null) { customizationListener = new OsmAndAppCustomization.OsmAndAppCustomizationListener() { @@ -184,12 +188,12 @@ public class ApplicationMode { private static void initRegVisibility() { // DEFAULT, CAR, BICYCLE, PEDESTRIAN, PUBLIC_TRANSPORT, BOAT, AIRCRAFT, SKI, TRUCK - ApplicationMode[] exceptDefault = new ApplicationMode[] {CAR, BICYCLE, PEDESTRIAN, PUBLIC_TRANSPORT, BOAT, AIRCRAFT, SKI, TRUCK}; + ApplicationMode[] exceptDefault = new ApplicationMode[] {CAR, BICYCLE, PEDESTRIAN, PUBLIC_TRANSPORT, BOAT, AIRCRAFT, SKI, TRUCK, MOTORCYCLE}; ApplicationMode[] all = null; ApplicationMode[] none = new ApplicationMode[] {}; // left - ApplicationMode[] navigationSet1 = new ApplicationMode[] {CAR, BICYCLE, BOAT, SKI, TRUCK}; + ApplicationMode[] navigationSet1 = new ApplicationMode[] {CAR, BICYCLE, BOAT, SKI, TRUCK, MOTORCYCLE}; ApplicationMode[] navigationSet2 = new ApplicationMode[] {PEDESTRIAN, PUBLIC_TRANSPORT, AIRCRAFT}; regWidgetVisibility(WIDGET_NEXT_TURN, navigationSet1); @@ -204,8 +208,8 @@ public class ApplicationMode { regWidgetVisibility(WIDGET_DISTANCE, all); regWidgetVisibility(WIDGET_TIME, all); regWidgetVisibility(WIDGET_INTERMEDIATE_TIME, all); - regWidgetVisibility(WIDGET_SPEED, CAR, BICYCLE, BOAT, SKI, PUBLIC_TRANSPORT, AIRCRAFT, TRUCK); - regWidgetVisibility(WIDGET_MAX_SPEED, CAR, TRUCK); + regWidgetVisibility(WIDGET_SPEED, CAR, BICYCLE, BOAT, SKI, PUBLIC_TRANSPORT, AIRCRAFT, TRUCK, MOTORCYCLE); + regWidgetVisibility(WIDGET_MAX_SPEED, CAR, TRUCK, MOTORCYCLE); regWidgetVisibility(WIDGET_ALTITUDE, PEDESTRIAN, BICYCLE); regWidgetAvailability(WIDGET_INTERMEDIATE_DISTANCE, all); regWidgetAvailability(WIDGET_DISTANCE, all); diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index f5283854b6..602dd7ef3e 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -936,7 +936,8 @@ public class OsmandSettings { DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.BOAT, 1.38f); DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.AIRCRAFT, 40f); DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.SKI, 1.38f); - DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.TRUCK, 10.5f); + DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.TRUCK, 12.5f); + DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.MOTORCYCLE, 12.5f); } public final OsmandPreference MIN_SPEED = new FloatPreference(this, @@ -957,6 +958,7 @@ public class OsmandSettings { ICON_RES_NAME.setModeDefaultValue(ApplicationMode.AIRCRAFT, "ic_action_aircraft"); ICON_RES_NAME.setModeDefaultValue(ApplicationMode.SKI, "ic_action_skiing"); ICON_RES_NAME.setModeDefaultValue(ApplicationMode.TRUCK, "ic_action_truck_dark"); + ICON_RES_NAME.setModeDefaultValue(ApplicationMode.MOTORCYCLE, "ic_action_motorcycle_dark"); } public final CommonPreference ICON_COLOR = new EnumStringPreference<>(this, @@ -977,6 +979,7 @@ public class OsmandSettings { ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.AIRCRAFT, "STRAIGHT_LINE_MODE"); ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.SKI, "ski"); ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.TRUCK, "truck"); + ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.MOTORCYCLE, "motorcycle"); } public final CommonPreference ROUTE_SERVICE = new EnumStringPreference<>(this, "route_service", RouteService.OSMAND, RouteService.values()).makeProfile().cache(); @@ -996,6 +999,7 @@ public class OsmandSettings { NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.AIRCRAFT, NavigationIcon.DEFAULT); NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.SKI, NavigationIcon.DEFAULT); NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.TRUCK,NavigationIcon.DEFAULT); + NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.MOTORCYCLE,NavigationIcon.DEFAULT); } public final CommonPreference LOCATION_ICON = new EnumStringPreference<>(this, "location_icon", LocationIcon.DEFAULT, LocationIcon.values()).makeProfile().cache(); @@ -1008,6 +1012,7 @@ public class OsmandSettings { LOCATION_ICON.setModeDefaultValue(ApplicationMode.AIRCRAFT, LocationIcon.CAR); LOCATION_ICON.setModeDefaultValue(ApplicationMode.SKI, LocationIcon.BICYCLE); LOCATION_ICON.setModeDefaultValue(ApplicationMode.TRUCK, LocationIcon.CAR); + LOCATION_ICON.setModeDefaultValue(ApplicationMode.MOTORCYCLE, LocationIcon.CAR); } public final CommonPreference APP_MODE_ORDER = new IntPreference(this, "app_mode_order", 0).makeProfile().cache(); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsFragment.java index 3763987e38..daed043002 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsFragment.java @@ -886,9 +886,9 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl public static String getAppModeDescription(Context ctx, ApplicationMode mode) { String description; if (mode.isCustomProfile()) { - description = ctx.getString(R.string.profile_type_custom_string); + description = ctx.getString(R.string.profile_type_user_string); } else { - description = ctx.getString(R.string.profile_type_base_string); + description = ctx.getString(R.string.profile_type_osmand_string); } return description; diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java index f7d8c6ad6f..7bea6bf5f4 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java @@ -296,7 +296,7 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment { if (!Algorithms.isEmpty(routingProfile)) { builder.setDescription(getString(R.string.ltr_or_rtl_combine_via_colon, getString(R.string.nav_type_hint), routingProfile)); } else { - builder.setDescription(getString(R.string.profile_type_base_string)); + builder.setDescription(getString(R.string.profile_type_osmand_string)); } int profileIconRes = AndroidUtils.getDrawableId(app, modeBean.iconName); ProfileIconColors iconColor = modeBean.iconColor; diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java index 0374a4a42f..2a15433f26 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java @@ -393,7 +393,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment { ? changedProfile.parent.toHumanString() : getSelectedAppMode().toHumanString()); OsmandTextFieldBoxes baseProfileNameHint = (OsmandTextFieldBoxes) holder.findViewById(R.id.master_profile_otfb); - baseProfileNameHint.setLabelText(getString(R.string.profile_type_base_string)); + baseProfileNameHint.setLabelText(getString(R.string.profile_type_osmand_string)); FrameLayout selectNavTypeBtn = (FrameLayout) holder.findViewById(R.id.select_nav_type_btn); selectNavTypeBtn.setOnClickListener(new View.OnClickListener() { @Override From da3ebf3bbd1ce73b3316974633f3022b201bdb31 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Thu, 10 Dec 2020 17:48:29 +0200 Subject: [PATCH 08/91] ApplicationMode - CAR --- .../plus/profiles/RoutingProfileDataObject.java | 2 -- .../plus/settings/backend/ApplicationMode.java | 12 +++++++++--- .../osmand/plus/settings/backend/OsmandSettings.java | 2 -- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java b/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java index 5810d6f87d..3cd3c74293 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java +++ b/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java @@ -29,8 +29,6 @@ public class RoutingProfileDataObject extends ProfileDataObject { SKI(R.string.routing_profile_ski, R.drawable.ic_action_skiing), PUBLIC_TRANSPORT(R.string.app_mode_public_transport, R.drawable.ic_action_bus_dark), BOAT(R.string.app_mode_boat, R.drawable.ic_action_sail_boat_dark), - TRUCK(R.string.app_mode_truck, R.drawable.ic_action_truck_dark), - MOTORCYCLE(R.string.app_mode_motorcycle, R.drawable.ic_action_motorcycle_dark), GEOCODING(R.string.routing_profile_geocoding, R.drawable.ic_action_world_globe); int stringRes; diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java index 40b0c53016..10d45dfe60 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java @@ -58,7 +58,7 @@ public class ApplicationMode { private static StateChangedListener iconNameListener; private static OsmAndAppCustomization.OsmAndAppCustomizationListener customizationListener; - private OsmandApplication app; + private static OsmandApplication app; private final int keyName; private final String stringKey; @@ -108,11 +108,11 @@ public class ApplicationMode { .icon(R.drawable.ic_action_skiing) .description(R.string.base_profile_descr_ski).reg(); - public static final ApplicationMode TRUCK = createBase(R.string.app_mode_truck, "truck") + public static final ApplicationMode TRUCK = createCustomBase(ApplicationMode.CAR, R.string.app_mode_truck, "truck", app) .icon(R.drawable.ic_action_truck_dark) .description(R.string.app_mode_truck).reg(); - public static final ApplicationMode MOTORCYCLE = createBase(R.string.app_mode_truck, "motorcycle") + public static final ApplicationMode MOTORCYCLE = createCustomBase(ApplicationMode.CAR, R.string.app_mode_motorcycle, "truck", app) .icon(R.drawable.ic_action_motorcycle_dark) .description(R.string.app_mode_motorcycle).reg(); @@ -678,6 +678,12 @@ public class ApplicationMode { return builder; } + public static ApplicationModeBuilder createCustomBase(ApplicationMode parent, int key, String stringKey, OsmandApplication app) { + ApplicationModeBuilder builder = create(parent, key, stringKey); + builder.getApplicationMode().app = app; + return builder; + } + public static class ApplicationModeBuilder { private ApplicationMode applicationMode; diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index 602dd7ef3e..2893a2dae0 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -936,8 +936,6 @@ public class OsmandSettings { DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.BOAT, 1.38f); DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.AIRCRAFT, 40f); DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.SKI, 1.38f); - DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.TRUCK, 12.5f); - DEFAULT_SPEED.setModeDefaultValue(ApplicationMode.MOTORCYCLE, 12.5f); } public final OsmandPreference MIN_SPEED = new FloatPreference(this, From 42f86ba5b99b4bc1a955a6d58de79acc61e8c4fe Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Thu, 10 Dec 2020 17:49:24 +0200 Subject: [PATCH 09/91] Update ApplicationMode.java --- .../src/net/osmand/plus/settings/backend/ApplicationMode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java index 10d45dfe60..9a0a6920d9 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java @@ -112,7 +112,7 @@ public class ApplicationMode { .icon(R.drawable.ic_action_truck_dark) .description(R.string.app_mode_truck).reg(); - public static final ApplicationMode MOTORCYCLE = createCustomBase(ApplicationMode.CAR, R.string.app_mode_motorcycle, "truck", app) + public static final ApplicationMode MOTORCYCLE = createCustomBase(ApplicationMode.CAR, R.string.app_mode_motorcycle, "motorcycle", app) .icon(R.drawable.ic_action_motorcycle_dark) .description(R.string.app_mode_motorcycle).reg(); From 6d784b8129a33bfcec0eb5e6050646571caa3033 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Fri, 11 Dec 2020 21:59:41 +0200 Subject: [PATCH 10/91] Hide Dashboard by default in drawer --- .../plus/settings/backend/ContextMenuItemsSettings.java | 8 ++++++++ .../net/osmand/plus/settings/backend/OsmandSettings.java | 2 +- .../settings/fragments/ConfigureMenuItemsFragment.java | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsSettings.java index 2c51f2607d..54e64ba045 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsSettings.java @@ -15,6 +15,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_DASHBOARD_ID; + public class ContextMenuItemsSettings implements Serializable { private static final Log LOG = PlatformUtil.getLog(ContextMenuItemsSettings.class.getName()); @@ -99,4 +101,10 @@ public class ContextMenuItemsSettings implements Serializable { public List getOrderIds() { return Collections.unmodifiableList(orderIds); } + + public static ContextMenuItemsSettings getDefaultInstanceForDrawer() { + ArrayList hiddenByDefault = new ArrayList<>(); + hiddenByDefault.add(DRAWER_DASHBOARD_ID); + return new ContextMenuItemsSettings(hiddenByDefault, new ArrayList()); + } } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index 90c63d3334..c6ac142060 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -2518,7 +2518,7 @@ public class OsmandSettings { new ListStringPreference(this, "inactive_poi_filters", null, ",,").makeProfile().cache(); public final ContextMenuItemsPreference DRAWER_ITEMS = - (ContextMenuItemsPreference) new ContextMenuItemsPreference(this, "drawer_items", DRAWER_ITEM_ID_SCHEME, new ContextMenuItemsSettings()) + (ContextMenuItemsPreference) new ContextMenuItemsPreference(this, "drawer_items", DRAWER_ITEM_ID_SCHEME, ContextMenuItemsSettings.getDefaultInstanceForDrawer()) .makeProfile().cache(); public final ContextMenuItemsPreference CONFIGURE_MAP_ITEMS = diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureMenuItemsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureMenuItemsFragment.java index ee8e11b970..3ba64d544a 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureMenuItemsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureMenuItemsFragment.java @@ -506,6 +506,7 @@ public class ConfigureMenuItemsFragment extends BaseOsmAndFragment mainActionItems.clear(); } instantiateContextMenuAdapter(); + initSavedIds(appMode); initMainActionsIds(appMode); rearrangeAdapter.updateItems(getAdapterItems()); } From 04b5d6e5026546baa910bdc53b1201c7d8b31999 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Sat, 12 Dec 2020 00:17:31 +0200 Subject: [PATCH 11/91] =?UTF-8?q?Fix=20"Configure=20screen=20=E2=80=93=20m?= =?UTF-8?q?enu=20RTL"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OsmAnd/res/layout/popup_menu_item.xml | 3 +- OsmAnd/res/menu/widget_visibility_menu.xml | 28 ----- OsmAnd/src/net/osmand/plus/UiUtilities.java | 2 +- .../views/mapwidgets/MapWidgetRegistry.java | 115 +++++++++--------- 4 files changed, 60 insertions(+), 88 deletions(-) delete mode 100644 OsmAnd/res/menu/widget_visibility_menu.xml diff --git a/OsmAnd/res/layout/popup_menu_item.xml b/OsmAnd/res/layout/popup_menu_item.xml index 9e160fcc14..93786c652d 100644 --- a/OsmAnd/res/layout/popup_menu_item.xml +++ b/OsmAnd/res/layout/popup_menu_item.xml @@ -12,8 +12,7 @@ android:layout_gravity="center_vertical" android:layout_marginLeft="@dimen/content_padding_half" android:layout_marginStart="@dimen/content_padding_half" - tools:src="@drawable/ic_action_info_dark" - android:tint="?attr/primary_icon_color"/> + tools:src="@drawable/ic_action_info_dark" /> - - - - - - - - - \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/UiUtilities.java b/OsmAnd/src/net/osmand/plus/UiUtilities.java index f818716730..2a4e3804b3 100644 --- a/OsmAnd/src/net/osmand/plus/UiUtilities.java +++ b/OsmAnd/src/net/osmand/plus/UiUtilities.java @@ -809,7 +809,7 @@ public class UiUtilities { return listPopupWindow; } - public static void showPopUpMenu(View v, final List items) { + public static void showPopUpMenu(View v, final List items) { UiUtilities.createListPopupWindow( v.getContext(), v, v.getWidth(), items, new AdapterView.OnItemClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java index 2cf6d23d93..fc19f5ba3c 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java @@ -1,9 +1,7 @@ package net.osmand.plus.views.mapwidgets; import android.content.Context; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; +import android.graphics.drawable.Drawable; import android.view.View; import android.widget.ArrayAdapter; import android.widget.LinearLayout; @@ -12,6 +10,7 @@ import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; import androidx.annotation.StringRes; +import net.osmand.plus.SimplePopUpMenuItemAdapter.SimplePopUpMenuItem; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.ContextMenuItem; @@ -29,12 +28,13 @@ import net.osmand.plus.views.layers.MapQuickActionLayer; import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.plus.views.mapwidgets.widgets.TextInfoWidget; import net.osmand.plus.views.mapwidgets.widgetstates.WidgetState; -import net.osmand.plus.widgets.IconPopupMenu; +import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; @@ -530,14 +530,8 @@ public class MapWidgetRegistry { return false; } View textWrapper = view.findViewById(R.id.text_wrapper); - IconPopupMenu popup = new IconPopupMenu(view.getContext(), textWrapper); - MenuInflater inflater = popup.getMenuInflater(); - final Menu menu = popup.getMenu(); - inflater.inflate(R.menu.widget_visibility_menu, menu); + List items = new ArrayList<>(); UiUtilities ic = app.getUIUtilities(); - menu.findItem(R.id.action_show).setIcon(ic.getThemedIcon(R.drawable.ic_action_view)); - menu.findItem(R.id.action_hide).setIcon(ic.getThemedIcon(R.drawable.ic_action_hide)); - menu.findItem(R.id.action_collapse).setIcon(ic.getThemedIcon(R.drawable.ic_action_widget_collapse)); final int[] menuIconIds = r.getDrawableMenuIds(); final int[] menuTitleIds = r.getMessageIds(); @@ -549,57 +543,64 @@ public class MapWidgetRegistry { for (int i = 0; i < menuIconIds.length; i++) { int iconId = menuIconIds[i]; int titleId = menuTitleIds[i]; - int id = menuItemIds[i]; - MenuItem menuItem = menu.add(R.id.single_selection_group, id, i, titleId) - .setChecked(id == checkedId); - menuItem.setIcon(menuItem.isChecked() && selected - ? ic.getIcon(iconId, currentModeColorRes) : ic.getThemedIcon(iconId)); + final int id = menuItemIds[i]; + boolean isChecked = id == checkedId; + String title = app.getString(titleId); + Drawable icon = isChecked && selected ? ic.getIcon(iconId, currentModeColorRes) : ic.getThemedIcon(iconId); + items.add(new SimplePopUpMenuItem(title, icon, new View.OnClickListener() { + @Override + public void onClick(View v) { + r.changeState(id); + MapInfoLayer mil = mapActivity.getMapLayers().getMapInfoLayer(); + if (mil != null) { + mil.recreateControls(); + } + ContextMenuItem item = adapter.getItem(pos); + item.setIcon(r.getDrawableMenu()); + if (r.getMessage() != null) { + item.setTitle(r.getMessage()); + } else { + item.setTitle(mapActivity.getResources().getString(r.getMessageId())); + } + adapter.notifyDataSetChanged(); + } + }, isChecked)); } - menu.setGroupCheckable(R.id.single_selection_group, true, true); - menu.setGroupVisible(R.id.single_selection_group, true); } - popup.setOnMenuItemClickListener( - new IconPopupMenu.OnMenuItemClickListener() { + // show + items.add(new SimplePopUpMenuItem( + app.getString(R.string.shared_string_show), + ic.getThemedIcon(R.drawable.ic_action_view), + new View.OnClickListener() { @Override - public boolean onMenuItemClick(MenuItem menuItem) { - - int i = menuItem.getItemId(); - if (i == R.id.action_show) { - setVisibility(adapter, pos, true, false); - return true; - } else if (i == R.id.action_hide) { - setVisibility(adapter, pos, false, false); - return true; - } else if (i == R.id.action_collapse) { - setVisibility(adapter, pos, true, true); - return true; - } else { - if (menuItemIds != null) { - for (int menuItemId : menuItemIds) { - if (menuItem.getItemId() == menuItemId) { - r.changeState(menuItemId); - MapInfoLayer mil = mapActivity.getMapLayers().getMapInfoLayer(); - if (mil != null) { - mil.recreateControls(); - } - ContextMenuItem item = adapter.getItem(pos); - item.setIcon(r.getDrawableMenu()); - if (r.getMessage() != null) { - item.setTitle(r.getMessage()); - } else { - item.setTitle(mapActivity.getResources().getString(r.getMessageId())); - } - adapter.notifyDataSetChanged(); - return true; - } - } - } - } - return false; + public void onClick(View v) { + setVisibility(adapter, pos, true, false); } - }); - popup.show(); + })); + + // hide + items.add(new SimplePopUpMenuItem( + app.getString(R.string.shared_string_hide), + ic.getThemedIcon(R.drawable.ic_action_hide), + new View.OnClickListener() { + @Override + public void onClick(View v) { + setVisibility(adapter, pos, false, false); + } + })); + + // collapse + items.add(new SimplePopUpMenuItem( + app.getString(R.string.shared_string_collapse), + ic.getThemedIcon(R.drawable.ic_action_widget_collapse), + new View.OnClickListener() { + @Override + public void onClick(View v) { + setVisibility(adapter, pos, true, true); + } + })); + UiUtilities.showPopUpMenu(textWrapper, items); return false; } From b4f6d9853c603291860fea71187e6e94ae017675 Mon Sep 17 00:00:00 2001 From: Hardy Date: Sat, 12 Dec 2020 00:32:47 +0100 Subject: [PATCH 12/91] Update strings.xml --- OsmAnd/res/values/strings.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 1d9bb60dba..ba2c5db1ea 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -60,14 +60,14 @@ OsmAnd Live subscription is on hold OsmAnd Live subscription has been paused OsmAnd Live subscription has been expired - There is a problem with your subscription. Tap the button to go to the Google Play subscription settings to fix your payment method. + Tap the button to set up a payment method on Google Play to fix your subscription. Manage subscription Login Password Account Use login and password You need to login to upload new or modified changes. \n\nYou can log in using the safe OAuth method or use your login and password. - You can view all your not yet uploaded edits or OSM bugs in %1$s. Uploaded points don’t show in OsmAnd. + View all your not yet uploaded edits or OSM bugs in %1$s. Already uploaded changes will not show up any more. Sign in with OpenStreetMap Login to OpenStreetMap.org Login to OpenStreetMap @@ -102,8 +102,8 @@ Development Avoid footways Avoid footways - Payment will be charged to your AppGallery account at the confirmation of purchase.\n\nSubscription automatically renews unless it is canceled before the renewal date. Your account will be charged for renewal period (month/three month/year) only on the renewal date.\n\nYou can manage and cancel your subscriptions by going to your AppGallery settings. - Subscription charged per selected period. Cancel it on AppGallery at any time. + Your AppGallery account is charged upon purchase confirmation.\n\nThe subscription prolongates automatically unless canceled before the renewal date. Your account will be charged for the renewal period (month/three months/year) only on the renewal date.\n\nYou can manage and cancel your subscriptions in your AppGallery settings. + The subscription is charged per the period selected. Cancel it in your AppGallery at any time. Thank you for purchasing \'Contour lines\' Start and finish icons Name: A – Z @@ -132,7 +132,7 @@ Resume trip recording Pause trip recording Specify the logging interval for the general track recording (turned on via the \'Trip recording\' widget on the map). - Will pause track logging when the app is killed (via recent apps). (OsmAnd background indication disappears from the Android notification bar.) + Track logging will pause when the app is killed (via recent apps). (The OsmAnd background indication disappears from the Android notification bar.) REC %s track files selected Filename @@ -168,7 +168,7 @@ Add to a track file Save as new track file In case of reverse direction - Are you sure you want discard all changes in the planned route by closing it? + Are you sure you want to discard all changes in the planned route? Street-level imagery Select a track file to add the new segment to. Navigation profile @@ -206,9 +206,9 @@ Motor scooter Enduro motorcycle The added point will not be visible on the map, since the selected group is hidden, you can find it in \"%s\". - Get info about points of interest from Wikipedia. It is your pocket offline guide - just turn on the Wikipedia plugin and enjoy articles about objects around you. + Get info about points of interest from Wikipedia, a pocket offline guide featuring articles about places and destinations. Download Wikipedia maps - The current destination point on the route will be deleted. If it will be the Destination, navigation will stop. + Deletes the next destination on your route. If that is the final destination, the navigation will stop. Please provide a name for the point Volume buttons as zoom Control the map-zoom level using the volume buttons on the device. @@ -427,7 +427,7 @@ Transparency You can read more about Slopes in %1$s. Additional maps are needed to view Slopes on the map. - Additional maps are needed to view Hillshade on the map. + Additional maps are needed to view hillshade on the map. Set the minimum and maximum zoom levels at which the layer will be displayed. Slope uses colors to visualize terrain steepness. Hillshade map using dark shades to show slopes, peaks and lowlands. @@ -1138,7 +1138,7 @@ Wikivoyage offline Unlimited downloads Wikipedia offline - Contour lines & Hillshade maps + Contour lines & hillshade maps Unlock all OsmAnd features Choose plan Purchase one of the following to receive the offline travel guide functionality: @@ -1416,7 +1416,7 @@ Button to show or hide OSM notes on the map. Sorted by distance Search in Favorites - Download the \'Hillshade Overlay\' map to show vertical shading. + Download the \'Hillshade\' overlay map to show vertical shading. Install the \'Contour lines\' plugin to show graded vertical areas. Hide starting from zoom level Download the \'Contour line\' map for use in this region. From 7089e1b86969226d6f6bca6cc31116665eda3670 Mon Sep 17 00:00:00 2001 From: Hardy Date: Sat, 12 Dec 2020 00:43:12 +0100 Subject: [PATCH 13/91] Update strings.xml --- OsmAnd/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index ba2c5db1ea..aaa3e8010f 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -1696,7 +1696,7 @@ Indicate target point direction by vibration. Enable navigation for OsmAnd Live changes. OsmAnd Live navigation - Destination not set + Accessibility plugin: Destination not set Magnetic bearing Relative bearing No route recalculation after leaving it From 3fe1a6f372d744ff704ad70da134aa2c53b474e4 Mon Sep 17 00:00:00 2001 From: Hardy Date: Sat, 12 Dec 2020 00:45:05 +0100 Subject: [PATCH 14/91] Update strings.xml --- OsmAnd/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index aaa3e8010f..297710b345 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -1696,7 +1696,7 @@ Indicate target point direction by vibration. Enable navigation for OsmAnd Live changes. OsmAnd Live navigation - Accessibility plugin: Destination not set + Accessibility plugin: No destination set Magnetic bearing Relative bearing No route recalculation after leaving it From 4f381e82b6cb2a67c042529c58d186cab15b659c Mon Sep 17 00:00:00 2001 From: Sergiu Date: Fri, 11 Dec 2020 09:13:48 +0000 Subject: [PATCH 15/91] Translated using Weblate (Romanian) Currently translated at 62.8% (2251 of 3579 strings) --- OsmAnd/res/values-ro/strings.xml | 47 +++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/OsmAnd/res/values-ro/strings.xml b/OsmAnd/res/values-ro/strings.xml index cda3562c42..3dfeca684a 100644 --- a/OsmAnd/res/values-ro/strings.xml +++ b/OsmAnd/res/values-ro/strings.xml @@ -53,9 +53,27 @@ OsmAnd (OSM Automated Navigation Directions) OsmAnd este o aplicatie open source cu acces la o gamă variată de date de la OpenStreetMap (OSM). Harta în format vectorial sau raster se poate stoca în memoria telefonului (pe card) pentru uz offline. OsmAnd poate calcula ruta atât offline căt și online și oferă ghidare vocală. Câteva dintre funcții: - Poate funcționa offline - se pot stoca hărți vectoriale sau raster într-un director la alegere - Sunt disponibile hărți vectoriale în format compact - Se pot descărca harți ale țării sau regiunii direct din aplicație - Se pot folosi diverse straturi ale hărților precum rute si trasee GPX, POI, favorite, linii de contur, stații ale transportului public, hărți suplimentare cu grad de transparență selectabil - Căutare offline de adrese și POI - Rutare offline pe distanțe scurte (experimental) - Mod de deplasare cu mașina, bicicleta sau pieton opțional cu: * comutare automată zi/noapte * zoom dependent de viteză * aliniere hartă funcție de busolă și de direcția de deplasare * orientare pe benzile de circulație, afișare viteză, voce înregistrată sau TTS Restrângerile variantei gratuite al aplicației OsmAnd: - Numărul de hărți descărcate este limitat - Nu se pot accesa offline lista de POI de la Wikipedia OsmAnd este o aplicație în dezvoltare iar progresul său se bazează pe contribuții financiare pentru implementarea de noi funcționalități. Vă rugăm să aveți în vedere achiziționarea aplicației OsmAnd+, finanțarea unor anume funcționalități sau să faceți o donație la osmand.net. OsmAnd+ este o aplicație open source pentru navigare cu hărți offline și online - - OsmAnd+ (OSM Automated Navigation Directions) OsmAnd+ este o aplicație open source cu acces la o gamă variată de date de la OpenStreetMap (OSM). Harta în format vectorial sau raster se poate stoca în memoria telefonului (pe card) pentru uz offline. OsmAnd poate calcula ruta atât offline cât și online și oferă ghidare vocală. OsmAnd+ este versiunea comercială, prin achiziționarea ei susțineți proiectul, finanțați dezvoltarea de noi funcționalități și primiți cele mai recente versiuni. Câteva dintre funcții: - Poate funcționa offline - se pot stoca hărți vectoriale sau raster într-un director la alegere - Sunt disponibile hărți vectoriale în format compact - Se pot descărca hărți ale țării sau regiunii direct din aplicație - Se pot folosi diverse straturi ale hărților precum rute si trasee GPX, POI, favorite, linii de contur, stații ale transportului public, hărți suplimentare cu grad de transparență selectabil - Căutare offline de adrese și POI - Rutare offline pe distanțe scurte (experimental) - Mod de deplasare cu mașina, bicicleta sau pieton opțional cu: * comutare automată zi/noapte * zoom dependent de viteză * aliniere hartă funcție de busolă și de direcția de deplasare * orientare pe benzile de circulație, afișare viteză, voce înregistrată sau Text To Speech - + OsmAnd+ (OSM Automated Navigation Directions) +\n +\nOsmAnd+ este o aplicație open source cu acces la o gamă variată de date de la OpenStreetMap (OSM). Harta în format vectorial sau raster se poate stoca în memoria telefonului (pe card) pentru uz offline. OsmAnd poate calcula ruta atât offline cât și online și oferă ghidare vocală. +\n +\nOsmAnd+ este versiunea comercială, prin achiziționarea ei susțineți proiectul, finanțați dezvoltarea de noi funcționalități și primiți cele mai recente versiuni. +\n +\nCâteva dintre funcții: +\n - poate funcționa offline +\n - se pot stoca hărți vectoriale sau raster într-un director la alegere +\n - sunt disponibile hărți vectoriale în format compact +\n - se pot descărca hărți ale țării sau regiunii direct din aplicație +\n - se pot folosi diverse straturi ale hărților precum rute si trasee GPX, POI, favorite, linii de contur, stații ale transportului public, hărți suplimentare cu grad de transparență selectabil +\n +\n - căutare offline de adrese și POI +\n - rutare offline pe distanțe scurte (experimental) +\n - mod de deplasare cu mașina, bicicleta sau pieton opțional cu: +\n - comutare automată zi/noapte +\n - zoom dependent de viteză +\n - aliniere hartă funcție de busolă și de direcția de deplasare +\n - orientare pe benzile de circulație, afișare viteză, voce înregistrată sau Text To Speech +\n Creează filtru POI Mod de transport: Mod transport: @@ -304,7 +322,8 @@ Mod standby Folosit pentru ca OsmAnd să poată funcționa când telefonul este în standby Nu există spațiu suficient pentru descărcarea a %1$s MB (liber: %2$s). - Descarc {0} fișiere\? Necesită {1} MB permanent. (În prezent sunt {2} MB disponibili.) + "Descarc {0} fișiere\? +\n Necesită {1} MB (din {2} MB disponibili)." Temă transparentă Librăria nativă nu este suportată de acest dispozitiv. Se inițializează librăria nativă… @@ -762,8 +781,8 @@ Latitudine Longitudine DDD.DD - DDD MM.MM - DDD MM SS.SS + DDD MM.MMM + DDD MM SS.S Arată pe hartă Selecție adresa Regiune @@ -1515,9 +1534,11 @@ Alți marcatori Încarcă anonim Afișați bara de căutare transparentă - Spațiu insuficient! E nevoie de {3} MB temporar și {1} MB permanent. În prezent, sunt doar {2} MB disponibili. + "Spațiu insuficient! +\n E nevoie de {3} MB temporar și {1} MB permanent. +\n În prezent, sunt doar {2} MB disponibili." Descarc {0} fișier(e)\? Necesită {3} MB temporar și {1} MB permanent. (În prezent sunt {2} MB disponibili.) - Nu puteți încărca anonim notele d-voastră OSM dacă folosiți profilul d-voastră OpenStreetMap.org + Încărcați anonim notele d-voastră OSM sau prin folosirea profilului d-voastră OpenStreetMap.org. Încărcați note OSM Bara de instrumente Widget-uri (dispozitive mici) @@ -1792,7 +1813,7 @@ Sortat după distanță Caută Favorite Pentru a vedea relieful pe hartă, descărcați harta cu relieful 3D pentru această regiune. - Pentru a vedea relieful pe hartă, trebuie să cumparați si să instalați extensia \'Contour Lines\' + Pentru a vedea relieful pe hartă, trebuie să instalați extensia \'Contour Lines\'. Ascunde de la nivelul de zoom Extensie Schemă culori @@ -2362,7 +2383,7 @@ Poţi aplica aceasta modificare pe toate profilele sau doar pe cel selectat. Partajat Prefer drumurile nepavate - Prefer drumurile nepavate + Prefer drumurile nepavate. Editare OSM Comută pentru a afișa sau ascunde liniile de contur pe hartă. Afişează conturul liniilor @@ -2411,7 +2432,7 @@ Lipește calea către dosar cu datele OsmAnd Schimbați dosarul de date ale OsmAnd\? Mută la noua destinație - Stocare internă, ascunsă de utilizator și alte aplicații, accesibilă exclusiv pentru OsmAnd + Stocare internă pentru OsmAnd (ascunsă de utilizator și alte aplicații). Schimbați folderul de stocare Parc Sanie @@ -2658,7 +2679,7 @@ Pentru navigare nautică.Caracteristici de geamanduri, faruri, râuri, benzi și mărci de mare, porturi, servicii de marinari, și contururi de adâncime. Pentru schi. Dispune de pârtii, teleschiuri, piste de fond, etc. Stil de conducere simplu. Mod de noapte ,cu linii de contur, drumuri cu contrast portocaliu, obiecte intunecate in harta secundară. - Pentru drumeții, drumeții și ciclism natural. Citit în aer liber. Drumuri contrastante și obiecte naturale, diferite tipuri de traseu, opțiuni avansate de linie de contur, detalii suplimentare. Reglarea integrității suprafeței distinge calitatea drumului. Fără mod de noapte. + Pentru drumeții, drumeții montane și ciclism natural. Citit în aer liber. Drumuri contrastante și obiecte naturale, diferite tipuri de traseu, opțiuni avansate de linie de contur, detalii suplimentare. Reglarea integrității suprafeței distinge calitatea drumului. Fără mod de noapte. Vechiul stil \"Mapnik\".Culori similare cu \"Mapnik\". Stil turistic cu contrast ridicat și detalii maxime. Include toate opțiunile stilului implicit OsmAnd, afișând în același timp cât mai multe detalii posibile, în special drumuri, căi și alte modalități de călătorie. Distincția clară \"atlas turistic\" între tipurile de drum. Potrivit pentru zi, noapte și în aer liber. Pentru conducere off-road bazată pe stilul „Topo” și pentru utilizarea cu imagini de satelit verzi, ca strat subaltern. Grosimea drumului principal redus, grosimea crescută a pistelor, cărărilor, bicicletelor și altor rute. @@ -2732,7 +2753,7 @@ Recalculare rută Anunț Utilizator și parolă - Aceste setări se aplicp la toate profilurile. + Aceste setări se aplică la toate profilurile Editare OSM OSM E nevoie de permisiune pentru a utiliza această opțiune. From 97aa1cb3b5c064f4aec1516b56d774b8aab7be56 Mon Sep 17 00:00:00 2001 From: ssantos Date: Sat, 12 Dec 2020 15:59:29 +0000 Subject: [PATCH 16/91] Translated using Weblate (Portuguese) Currently translated at 100.0% (3579 of 3579 strings) --- OsmAnd/res/values-pt/strings.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml index 64de702a5d..c6a2cccf6b 100644 --- a/OsmAnd/res/values-pt/strings.xml +++ b/OsmAnd/res/values-pt/strings.xml @@ -2691,7 +2691,7 @@ Definir o tamanho da imagem da câmara Obter Recálculo de rota inteligente - Recalcula apenas a parte inicial da rota. Pode ser usado para viagens longas. + Recalcula apenas a parte inicial da rota, útil para viagens longas. Está a gostar do OsmAnd\? A sua opinião e o seu feedback são importantes. Avalie esta aplicação @@ -3923,7 +3923,7 @@ Roteamento complexo 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) + Mudar para o Cálculo de rotas de transporte público Java (seguro) Entre com o OAuth para usar os recursos do osmedit Fazer login via OAuth Limpar token do OpenStreetMap OAuth @@ -3932,9 +3932,9 @@ Usar algoritmo de roteamento de 2 fases A* Para a condução de motos de neve com estradas e pistas dedicadas. Gráfico - %1$s dados disponíveis apenas nas estradas, precisa calcular uma rota a usar \"Rota entre pontos\" para obtê-la. - Espere pelo recalculo da rota. -\nO gráfico estará disponível após o recalculo. + Dados de %1$s disponíveis apenas em estradas, calcule uma rota a usar \"Rota entre pontos\" para ver os gráficos. + Por favor, espere. +\nO gráfico estará disponível após o recalculo da rota. %1$s — %2$s Lacuna MGRS @@ -3949,9 +3949,9 @@ Desporto Emergência Viagem - Precisa de adicionar pelo menos dois pontos + Adicione pelo menos dois pontos Gerir a assinatura - Há um problema com a sua assinatura. Clique no botão para ir às definições de assinatura do Google Play para corrigir o seu método de pagamento. + Há um problema com a sua assinatura. Toque no botão para ir às definições de assinatura do Google Play para corrigir o seu método de pagamento. A assinatura do OsmAnd Live expirou A assinatura do OsmAnd Live foi pausada A assinatura do OsmAnd Live está em espera @@ -3969,7 +3969,7 @@ Insira etiquetas separadas por vírgula. \"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. + \"Identificável\" significa que o rastreamento será mostrado publicamente nos seus traços de GPS e nas 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 @@ -3994,7 +3994,7 @@ OsmAnd mostra fotos de várias fontes: \nOpenPlaceReviews - fotos de POI; \nMapillary - imagens ao nível da rua; -\nWeb / Wikimedia - fotos de POI especificadas nos dados do OpenStreetMap. +\nWeb / Wikimedia - fotos de POI como nos dados do OpenStreetMap. Seleccionar os grupos que serão importados. Seleccionar os objectos que serão importados. Utilizar dev.openstreetmap.org @@ -4003,12 +4003,12 @@ Mude para usar dev.openstreetmap.org ao invés de openstreetmap.org para testar enviar uma OSM Nota / POI / GPX. %1$s * %2$s Alemão (casual) - Pode usar os dados de elevação para considerar a ascensão / descida na sua viagem + Pode usar dados de elevação para representar a subida / descida da sua viagem Aeronaves ligeiras Unir segmentos Dividir antes Dividir após - Adicionar novo segmento + Adicionar um novo segmento • Opção de exportar e importar todos os dados adicionada, que inclui configurações, recursos, meus lugares \n \n• Planear rota: gráficos para segmentos com a rota, adicionado a capacidade de criar e editar trilhos de segmentos múltiplos From b1d2cba0e340702665d0c2acbc9ee97d2177884f Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 12 Dec 2020 11:41:52 +0000 Subject: [PATCH 17/91] Translated using Weblate (German) Currently translated at 100.0% (3579 of 3579 strings) --- OsmAnd/res/values-de/strings.xml | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index dfd4c218a6..f8133d7c17 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -1750,19 +1750,19 @@ Offline speichern Geänderter OSM-POI Gelöschter OSM-POI - OSM-Notiz erstellen - Wiedereröffnete OSM-Notiz - Kommentierte OSM-Notiz - Erstellte OSM-Notiz - OSM-Notiz - Notiz erstellen + OSM-Hinweis erstellen + Wiedereröffneter OSM-Hinweis + Kommentierter OSM-Hinweis + Erstellter OSM-Hinweis + OSM-Hinweis + Hinweis erstellen Kommentar hinzufügen - Notiz wieder öffnen - Notiz schließen - Notiz erstellt - Notiz konnte nicht erstellt werden. - Notiz geschlossen - Notiz konnte nicht geschlossen werden. + Hinweis wieder öffnen + Hinweis schließen + Hinweis erstellt + Hinweis konnte nicht erstellt werden. + Hinweis geschlossen + Hinweis konnte nicht geschlossen werden. GPX-Wegpunkt löschen? GPX-Wegpunkt bearbeiten Westfriesisch @@ -1888,8 +1888,8 @@ \n Es werden vorübergehend {3} MB und dauerhaft {1} MB benötigt. (Von {2} MB.) Kartenmarkierung auswählen Andere Markierungen - Laden Sie Ihre OSM-Notiz anonym oder über Ihr OpenStreetMap.org-Profil hoch. - OSM-Notiz hochladen + Laden Sie Ihren OSM-Hinweis anonym oder über Ihr OpenStreetMap.org-Profil hoch. + OSM-Hinweis hochladen Anonym hochladen Transparenz-Schieber anzeigen Route neu berechnen @@ -2103,8 +2103,8 @@ Kartendarstellung geändert zu „%s“. Neue Audio-Notiz Neue Video-Notiz - Neue Fotonotiz - OSM-Notiz hinzufügen + Neue Foto-Notiz + OSM-Hinweis hinzufügen Sprachausgabe ein/aus Sprachausgabe aktivieren Sprachausgabe stummschalten @@ -2154,7 +2154,7 @@ Wählen Sie eine beliebige Kategorie. Schnellaktion Eine Schaltfläche, um einen GPX-Wegpunkt in der Bildschirmmitte einzufügen. - Eine Schaltfläche, um eine OSM-Notiz in der Bildschirmmitte einzufügen. + Eine Schaltfläche, um einen OSM-Hinweis in der Bildschirmmitte einzufügen. Eine Schaltfläche, um einen POI in der Bildschirmmitte einzufügen. Umschalter, um die Sprachansagen während der Navigation ein- oder auszuschalten. Eine Schaltfläche, um eine Parkposition in der Bildschirmmitte einzufügen. @@ -2537,9 +2537,9 @@ Kartenausrichtungsgrenzwert Auswählen, bei welcher Geschwindigkeit die Kartenausrichtung von \'Nach Bewegungsrichtung\' auf \'Nach Kompass\' umschaltet. Kartenmarkierung in den Verlauf verschoben - Notiz konnte nicht geändert werden. - Notiz ändern - OSM-Notiz ändern + Hinweis konnte nicht geändert werden. + Hinweis ändern + OSM-Hinweis ändern Kopie des Startpunkts als Ziel hinzufügen. Rundreise erstellen Meine Position @@ -3808,7 +3808,7 @@ Motorroller Rollstuhl Go-Kart - Geschlossene OSM-Notiz + Geschlossener OSM-Hinweis Rollstuhl vorwärts Zum Fortfahren bitte Arbeitstage auswählen Route zwischen Punkten @@ -3973,8 +3973,8 @@ \"Identifizierbar\" bedeutet, dass der Track in Ihren GPS-Tracks und in öffentlichen GPS-Track Verzeichnissen angezeigt wird, d.h. andere Benutzer können den Track herunterladen und mit Ihrem Benutzernamen verknüpfen. Öffentliche, mit Zeitstempel versehene Trackpunkt-Daten von der GPS API, die über die Trackpunkt API bereitgestellt werden, verweisen auf Ihre ursprüngliche Trackseite. \"Privat\" bedeutet, dass der Track nicht in öffentlichen Verzeichnissen auftaucht, aber seine Trackpunkte in nicht chronologischer Reihenfolge über die öffentliche GPS API ohne Zeitstempel verfügbar sind. \"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 + OSM-Hinweis schließen + OSM-Hinweis kommentieren Sie können sich mit der sicheren OAuth-Methode anmelden oder Ihren Benutzernamen und Ihr Passwort verwenden. Foto hinzufügen Registrieren bei From b4927706695db4c8bcba7570075f6d03feab8342 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 10 Dec 2020 16:12:11 +0000 Subject: [PATCH 18/91] Translated using Weblate (Russian) Currently translated at 99.4% (3560 of 3579 strings) --- OsmAnd/res/values-ru/strings.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 4b760b500b..3396ca32d1 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -1255,7 +1255,7 @@ Закончить редактирование Очистить все точки Полная версия - Отменить маршрут + Отменить маршрут\? Очистить пункт назначения Искать улицу в ближайших населённых пунктах Расположить в оптимальном порядке @@ -2680,7 +2680,7 @@ Выберите тип файла Экспортировать в виде POI, заметок OSM или обоих вариантов. Все данные - OSM-заметки + Заметки OSM Впереди туннель Туннели Сделать пунктом отправления @@ -3994,4 +3994,6 @@ Каяк %1$s * %2$s Немецкий (повседневный) + Легкий самолет + Добавить новый сегмент \ No newline at end of file From f7e7c95aae31f76c57ba7fbfcda858ba62a815a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Babos=20G=C3=A1bor?= Date: Thu, 10 Dec 2020 16:48:10 +0000 Subject: [PATCH 19/91] Translated using Weblate (Hungarian) Currently translated at 99.9% (3578 of 3579 strings) --- OsmAnd/res/values-hu/strings.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index e431f5ba01..875d3ad0d0 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -1534,7 +1534,7 @@ Magasságkorlátozás Adja meg az útvonalakon a járművekre vonatkozó magasságkorlátozást. Intelligens útvonal újraszámítás - Csak az útvonal kezdeti részét számítja újra. Hosszú utakhoz használható. + Csak az útvonal kezdeti részét számítja újra; hosszú utaknál hasznos. Naplózás ki Letiltva Színezés hálózathoz tartozás szerint @@ -3923,9 +3923,9 @@ %1$s - %2$s Motorosszánutakhoz kifejezetten motoros szán számára kijelölt utakon. Grafikon - %1$s adatok csak az utakról állnak rendelkezésre. Használja az „Útvonal tervezése pontok között” funkciót. - Várja meg az útvonal újraszámítását. -\nAz ábra az újraszámítás után lesz látható. + %1$s adatok csak utakról állnak rendelkezésre. Az ábrák megtekintéséhez az „Útvonal tervezése pontok között” funkcióval számítsa ki az útvonalat. + Kérjük, várjon. +\nAz ábra azútvonal újraszámítása után lesz látható. Helyi térképek Hasznos és fontos létesítmény Különleges @@ -3938,7 +3938,7 @@ MGRS MGRS Az OsmAnd a NATO által is használt MGRS (Military Grid Reference System) koordinátákat alkamazza, amely hasonlít az UTM-formátumhoz. - Legalább két pontot kell hozzáadnia + Legalább két pontot adjon hozzá Előfizetés kezelése A követhető azt jelenti, hogy a nyomvonal egyetlen nyilvános listában sem jelenik meg, de a belőle származó, időbélyeggel ellátott, feldolgozott nyomvonalpontok (amelyek közvetlenül nem kapcsolhatók Önhöz) igen, mégpedig a nyilvános GPS API-ról történő letöltések révén. Az azonosítható azt jelenti, hogy a nyomvonal nyilvánosan megjelenik az Ön GPS-nyomvonalai között és a GPS-nyomvonalak nyilvános listáin, vagyis más felhasználók letölthetik a nyers nyomvonalat, és társíthatják azt a felhasználónévvel. A nyomvonalpont-API-n keresztül kiszolgált GPS API-ból származó nyilvános időbélyegzővel ellátott nyomvonalpont-adatok hivatkoznak az Ön eredeti nyomvonaloldalára. @@ -3950,7 +3950,7 @@ Az OsmAnd-előfizetés fel van függesztve Az OsmAnd Live-előfizetés szünetel Az OsmAnd Live-előfizetés lejárt - Probléma van az előfizetésével. A fizetési mód kijavítása érdekében kattintson a gombra a Google Play előfizetési beállításaihoz történő ugráshoz. + Probléma van az előfizetésével. A fizetési mód kijavítása érdekében koppintson a gombra a Google Play előfizetési beállításaihoz történő ugráshoz. Bejelentkezés Fiók Bejelentkezés felhasználónévvel és jelszóval @@ -3966,7 +3966,7 @@ Fénykép hozzáadása Regisztráció az \nOpenPlaceReviews.org oldalon - A fényképeket a OpenPlaceReviews.org nyíltadat-projekt biztosítja. Saját fényképei feltöltéséhez be kell jelentkeznie a weboldalon. + A fényképeket a OpenPlaceReviews.org nyíltadat-projekt biztosítja. Saját fényképei feltöltéséhez be kell jelentkeznie a weboldalukon. Új fiók létrehozása Már van fiókom Motorcsónak @@ -3978,7 +3978,7 @@ Az OsmAnd több forrásból jelenít meg fényképeket: \nOpenPlaceReviews – POI-fotók; \nMapillary – utcaszintű képek; -\nWeb / Wikimedia – az OpenStreetMap-adatokban meghatározott POI-fotók. +\nWeb / Wikimedia – POI-fotók az OpenStreetMap-adatoknak megfelelően. Hozzávetőleges fájlméret Jelölje ki a fájlba exportálandó adatokat. Szükséges az importáláshoz @@ -3992,19 +3992,19 @@ Kép kijelölése német (tegeződő) %1$s * %2$s - A magassági adatokat az utazás során előforduló emelkedés/lejtés megfontolásához használhatja + A magassági adatok felhasználásával figyelembe veheti az utazás során az emelkedést / lejtést Könnyű légi jármű Elvágás előtte Elvágás utána Szakaszok egyesítése Új szakasz hozzáadása - "• Lehetőség az összes adat – többek között beállítások, erőforrások és helyek – exportálására és importálására + "• Lehetőség az összes adat exportálására és importálására, beleértve a beállításokat, erőforrásokat és a saját helyeket is \n -\n • Útvonaltervezés: grafikonok az útvonalat tartalmazó szegmensekhez, útszakasznyomvonalak létrehozása és szerkesztése +\n • Útvonaltervezés: grafikonok a nyomvonalszakaszokhoz útvonallal, valamint lehetőség több nyomvonalszakasz létrehozására és szerkesztésére \n -\n • OAuth hitelesítési módszer az OpenStreetMap-hez, javított felhasználói felület az OSM-párbeszédpanelekhez +\n • OAuth hitelesítési módszer az OpenStreetMap-hez, az OSM párbeszédpanelek felhasználói felületének javítása \n -\n • Egyéni színek a kedvencekhez és az útvonalak útpontjaihoz +\n • Egyéni színek támogatása a kedvenceknél és a nyomvonalak útpontjainál \n \n" \ No newline at end of file From 82d9d2d508a8d92bb71665123ea993b59c801867 Mon Sep 17 00:00:00 2001 From: mircozorzo73b8633855fa4d8c Date: Sat, 12 Dec 2020 22:53:42 +0000 Subject: [PATCH 20/91] Translated using Weblate (Italian) Currently translated at 89.2% (3196 of 3579 strings) --- OsmAnd/res/values-it/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index b54a25fdfb..bdf8af6956 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -4012,4 +4012,6 @@ \n • Supporto alla personalizzazione dei colori per i preferiti e i punti intermedi delle tracce \n \n" + Unisci segmenti + Spezza \ No newline at end of file From db11bf3a7258d18dac59ff52446b4930f1b4ce58 Mon Sep 17 00:00:00 2001 From: Franco Date: Fri, 11 Dec 2020 12:05:20 +0000 Subject: [PATCH 21/91] Translated using Weblate (Spanish) Currently translated at 97.2% (3482 of 3579 strings) --- OsmAnd/res/values-es/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml index 60e24e9b00..e8bec4e6ef 100644 --- a/OsmAnd/res/values-es/strings.xml +++ b/OsmAnd/res/values-es/strings.xml @@ -3941,13 +3941,13 @@ Seleccione los datos para exportar al fichero. Necesario para importar No hay espacio suficiente - "• Se ha añadido la opción de exportar e importar todos los datos, incluyendo los ajustes, los recursos y «Mis sitios» + • Se ha añadido la opción de exportar e importar todos los datos, incluyendo los ajustes, los recursos y «Mis sitios» \n -\n • Planificar ruta: se añadieron gráficos para los segmentos de traza con la ruta y capacidad de crear o editar segmentos de traza múltiples +\n • Planificar ruta: se añadieron gráficos para los segmentos de trazas con la ruta y capacidad de crear o editar trazas de segmentos múltiples \n \n • Se ha añadido el método de autenticación OAuth para OpenStreetMap y se ha mejorado la interfaz de usuario de los diálogos de OSM \n \n • Se añadieron colores personalizados para los favoritos y los puntos de referencia de la traza \n -\n" +\n \ No newline at end of file From 93203bff9f954bb9a6118d66aed3130751a1165c Mon Sep 17 00:00:00 2001 From: WaldiS Date: Fri, 11 Dec 2020 16:10:00 +0000 Subject: [PATCH 22/91] Translated using Weblate (Polish) Currently translated at 99.6% (3566 of 3579 strings) --- OsmAnd/res/values-pl/strings.xml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index b572932d6a..9e18f5c096 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -1541,7 +1541,7 @@ Ograniczenie wysokości Określa dozwoloną wysokość pojazdu na trasach. Inteligentne przeliczanie trasy - Ponownie oblicza tylko początkową część trasy. Może być stosowany do długich podróży. + Przelicza tylko początkową część trasy, która jest przydatna podczas długich podróży. Wyloguj się Linia w kolorze oznakowania OSMC Wyłączenie @@ -3938,8 +3938,8 @@ Użyj 2-fazowego algorytmu routingu A * Wykres %1$s dane dostępne tylko na drogach, aby je uzyskać, musisz obliczyć trasę za pomocą opcji „Trasa między punktami”. - Poczekaj na ponowne obliczenie trasy. -\nWykres będzie dostępny po ponownym obliczeniu. + Proszę czekać. +\nWykres będzie dostępny po ponownym obliczeniu trasy. Mapy lokalne Przerwa Udogodnienie @@ -3955,8 +3955,8 @@ Subskrypcja OsmAnd Live wygasła Subskrypcja OsmAnd Live została wstrzymana Do jazdy skuterem śnieżnym z wyznaczonymi drogami i torami. - Musisz dodać co najmniej dwa punkty - Wystąpił problem z Twoją subskrypcją. Kliknij przycisk, aby przejść do ustawień subskrypcji Google Play i naprawić metodę płatności. + Dodaj co najmniej dwa punkty + Wystąpił problem z Twoją subskrypcją. Naciśnij przycisk, aby przejść do ustawień subskrypcji Google Play i naprawić metodę płatności. Subskrypcja OsmAnd Live jest wstrzymana Login Zaloguj się do OpenStreetMap @@ -3986,7 +3986,7 @@ OsmAnd pokazuje zdjęcia z kilku źródeł: \nOpenPlaceReviews - zdjęcia punktów użyteczności; \nMapillary - zdjęcia z poziomu ulicy; -\nWeb / Wikimedia - zdjęcia określonych punktów użyteczności w danych OpenStreetMap. +\nWeb / Wikimedia - zdjęcia punktów POI zgodnie z danymi OpenStreetMap. Zasoby Przybliżony rozmiar pliku Wybierz dane do wyeksportowania do pliku. @@ -4007,4 +4007,18 @@ Niemiecki (styl potoczny) \"Publiczny\" oznacza, że ślad jest pokazywany publicznie w śladach GPS i na publicznych listach śladów GPS oraz na publicznej liście śladów z surowymi znacznikami czasowymi. Dane obsługiwane przez API nie odnoszą się do strony śladów. Znaczniki czasu punktów śladowych nie są dostępne za pośrednictwem publicznego API GPS, a punkty śladowe nie są uporządkowane chronologicznie. Lekki samolot + Możesz użyć danych wysokości, aby uwzględnić wzniesienie / zejście podczas podróży + Połącz segmenty + Podziel przed + Podziel po + Dodaj nowy segment + • Dodano opcję eksportowania i importowania wszystkich danych, w tym ustawień, zasobów, miejsc +\n +\n• Planowanie trasy: wykresy dla segmentów toru z trasą oraz dodano możliwość tworzenia i edycji wielu segmentów toru +\n +\n• Dodano metodę uwierzytelniania OAuth dla OpenStreetMap, ulepszony interfejs użytkownika okien dialogowych OSM +\n +\n• Obsługa niestandardowych kolorów dla ulubionych i śledzenia punktów trasy +\n +\n \ No newline at end of file From 8aae2da425d7b98cc11ba673a79f83aad43bbce3 Mon Sep 17 00:00:00 2001 From: Softmap Date: Fri, 11 Dec 2020 21:17:53 +0000 Subject: [PATCH 23/91] Translated using Weblate (Arabic) Currently translated at 100.0% (3579 of 3579 strings) --- OsmAnd/res/values-ar/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index 939a798640..efabca7144 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3996,11 +3996,11 @@ إضافة شريحة جديدة • خيار مضاف لتصدير واستيراد جميع البيانات بما في ذلك الإعدادات والموارد والأماكن الخاصة بي \n -\n • مخطط الطريق: الرسوم البيانية للأجزاء مع المسار ، إضافة القدرة على إنشاء وتحرير مسارات مقطع مضاعفة +\n • مخطط الطريق: الرسوم البيانية لأجزاء المسار مع الطريق ، إضافة القدرة على إنشاء وتحرير مقاطع مسارات متعددة \n -\n • تمت إضافة طريقة مصادقة آلية لـ OpenStreetMap ، واجهة مستخدم محسنة لمربعات حوار OSM +\n • تمت إضافة طريقة مصادقة آلية OAuth ل OpenStreetMap ، وواجهة مستخدم محسنة لمربعات حوار OSM \n -\n • ألوان مخصصة للمفضلة والمسارات نقاط الطريق +\n • دعم ألوان مخصصة للمفضلة ونقاط لمسار الطريق \n \n \ No newline at end of file From 077d8eb85a68c5b06f342c3e261078cf5dc70973 Mon Sep 17 00:00:00 2001 From: ovl-1 Date: Fri, 11 Dec 2020 15:46:53 +0000 Subject: [PATCH 24/91] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 54.6% (1956 of 3579 strings) --- OsmAnd/res/values-nb/strings.xml | 65 +++++++++++++++++--------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 584299e186..43ca608125 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -979,7 +979,7 @@ Fotgjengeroverganger Amerikansk veiatlas Hyperfokal fokus - %1$s trenger denne tillatelsen til å slå av skjermen (Strømsparingsfunksjon). + %1$s trenger denne tillatelsen til å slå av skjermen for strømsparingsfunksjonen. Vis alle Fotgjengeroverganger Gatebelysning @@ -1381,7 +1381,7 @@ Status Lagre endringer E-postadresse - Data er ikke tilgjengelig + Data ikke tilgjengelig Les mer Bytt om på startpunkt og reisemål Topplinje @@ -1409,7 +1409,7 @@ Ingen adresse funnet Nær Ser etter adresse - Forkast rute + Vil du forkaste ruten\? Ulovlig tegn i filnavn Tynn Middels @@ -1506,9 +1506,9 @@ Programmet har nå lov til å skrive til ekstern lagring, men programomstart kreves. Angre alle Lagringsstørrelse - Innvilg tilgang til posisjon. - Innvilg kameratilgang. - Innvilgt mikrofontilgang. + Gi tilgang til posisjonsdata. + Gi kameratilgang. + Gi mikrofontilgang. Skjul Laveste kvalitet Høyeste kvalitet @@ -1769,7 +1769,7 @@ Sporsegmenter Sporpunkter Del notat - Notater + Lyd/video-notater For å vise sjøkart, må det spesielle frakoblede kartet lastes ned. Starte navigering langs spor\? Utløs en alternativ rute ved å velge veier å unngå @@ -1988,7 +1988,7 @@ Slå på tale Slå av tale Sortert etter avstand - Søk blandt favoritter + Søk i favoritter Hurtighandling Legg til handling Legg til handling @@ -2000,7 +2000,7 @@ Analyser på kartet Helning Rutehøydeprofil - Fall + Nedstigning Stigning Høydeintervall Gjennomsnittshøyde @@ -2089,7 +2089,7 @@ Nettbaserte bilder Legg til bilder Ingen bilder her. - Del ditt gatenivå-åsyn via Mapillary. + Del dine bilder på gatenivå via Mapillary. Mapillary-miniprogram Gir mulighet for raske bidrag til Mapillary. Nettbaserte bilder på gatenivå for alle. Oppdag steder, samarbeid, fang inn verden. @@ -2121,8 +2121,8 @@ Bruk systemets tastatur Velg format for koordinatinntasting. Du kan alltid endre det ved å trykke \'Alternativer\'. Rask koordinatinntasting - Ingen isete veier eller vadesteder - Unngår isete veier og vadesteder. + Ingen veier på is eller vadesteder + Unngår veier på is og vadesteder. Bruk posisjon Legg til din posisjon som startpunkt for å planlegge den perfekte ruten. Min posisjon @@ -2156,7 +2156,7 @@ \n- Synkronisere grupper og enheter med tjeneren; \n- Behandle grupper og enheter i et personlig dashbord på nettstedet. Simuler første programstart - Lag audio/foto/video-notater på en tur, enten ved bruk av en knapp på kartet eller posisjon-kontekstmeny. + Lag lyd/foto/video-notater på en tur, enten ved bruk av en knapp på kartet eller posisjon-lokalmeny. Gjennomsnitt %1$d av %2$d Stigning/nedstigning @@ -2166,7 +2166,7 @@ OSM-notater (på nett) Flytt til historikk Gruppen vil være borte neste gang du starter programmet. - Vis hjelpelinjer + Vis retningslinjer Vis piler på kartet Vis passerte Skjul passerte @@ -2290,7 +2290,7 @@ Importer som GPX-fil Importer som favoritt Importer fil - Velg hvordan avstand og retning til kartmarkører på kartskjermen angis: + Velg hvordan du skal indikere avstand og retning til kartmarkører på kartet: kan importeres som favoritt eller en GPX-fil. Fullskjermmodus Utseende på kartet @@ -2314,10 +2314,10 @@ Opprett eller endre OSM-objekter Lagt til Markøren %s er aktivert. - Trykk en markør på kartet for å flytte den til toppen av de aktive markørene uten å åpne kontekstmenyen. + Trykk en markør på kartet for å flytte den til toppen av de aktive markørene uten å åpne lokalmenyen. «Ett-trykk» aktiv Ta notater! - Legg til lyd-, video- eller bildenotat til hvert punkt på kartet, ved bruk av modul eller kontekstmeny. + Legg til lyd-, video- eller bildenotater til et hvilket som helst punkt på kartet ved bruk av modul eller lokalmeny. Notater etter dato Etter dato Etter type @@ -2437,7 +2437,7 @@ Trykk \'Bruk posisjon…\' for å legge til et notat til stedet. Legg til rutepunkt i innspilt GPX-spor Taleveiledning er ikke tilgjengelig, gå til \'Innstillinger\' → \'Navigeringsinnstillinger\' , velg profilen → \'Taleveiledning\' og velg eller last ned en talemeldingspakke. - Beregner på nytt bare den første delen av ruten. Kan brukes for lange turer. + Beregner på nytt bare den første delen av ruten, nyttig for lange turer. Maritimt stengt (fridag) Kopier sted/interessepunkt-navn @@ -2521,7 +2521,7 @@ \n Gjør alle landarealelementer på kartet gjennomsiktige. ft - Ingenting funnet innen radiusen: + Kunne ikke finne noe: Legg til alle sporets rutepunkter, eller velg separate kategorier. Elvesport Info om knutepunktet ble ikke lastet inn @@ -3499,7 +3499,7 @@ Elementer lagt til Gjenopprett alle profilinnstillinger\? En knapp for å vise eller skjule terrenglag på kartet. - Handlinger i bindeleddsmeny + Handlinger i lokalmeny Skjult Har kun fire knapper. Hovedhandlinger @@ -3547,7 +3547,7 @@ Sporingsintervall Tidsmellomlager Kameralukker-lyd - Fortsett + Gjenoppta %1$s — %2$s — %3$s Standard kantonesisk Sørlig min @@ -3583,7 +3583,7 @@ Er du sikker på at du vil tømme lagret data\? Anvis ny rute ved avvik Løyper - Skuffeelementer, bindeleddsmeny + Skuffeelementer, lokalmeny Grensesnittstilpasning Skuff OsmAnd-sporer @@ -3623,9 +3623,9 @@ \n \nDette programtillegget vil forbli på enheten etter fjerning av OsmAnd. Importerte elementer vil bli lagt til med fortegnelse - Tilpass mengden elementer i \"Skuff\", \"Sett opp kart\", og \"Bindeleddsmeny\". + Tilpass antallet elementer i \"Skuff\", \"Kartinnstilling\" og \"Lokalmeny\". \n -\nSkru av ubrukte programtillegg for å skjule alle deres styringskontroller. %1$s. +\nSlå av ubrukte programtillegg for å skjule alle deres styringskontroller. %1$s. Disse elementene er skjult fra menyen, men de representerte valgene eller programtilleggene vil fortsette å virke. Velg språkene Wikipedia-artikler skal vises på i kartet. Du kan bytte mellom alle tilgjengelige språk mens du leser artikkelen. Veiledning til kartets symbolbruk. @@ -3869,8 +3869,8 @@ Utlogget Bruk 2-stegs A*-rutingsalgoritme Filen er allerede importert i OsmAnd - Vent på omberegning av ruten. -\nGraf vil være tilgjengelig etter omberegning. + Vent. +\nGraf vil være tilgjengelig etter omberegning av ruten. %1$s — %2$s Graf %1$s-data er tilgjengelig kun på veiene, du må beregne en rute med “Rut mellom punkter”. @@ -3887,7 +3887,7 @@ Sport Nødsfall Reise - Du må legge til minst to punkter. + Legg til minst to punkter \"Sporbar\" betyr at sporet ikke vil vises i offentlige lister, men bearbeidede sporpunkter med tidsstempel (som ikke direkte kan knyttes til deg) vil være tilgjengelig gjennom nedlastinger fra det offentlige GPS-API-et. Logg inn med OpenStreetMap Bruk innlogging og passord @@ -3900,7 +3900,7 @@ Lukk OSM-notat Kommenter OSM-notat Skriv inn etiketter inndelt med komma. - Det har oppstått et problem med abonnementet ditt. Klikk på knappen for å gå til Google Play-abonnementsinnstillingene for å fikse din betalingsmetode. + Det er et problem med abonnementet ditt. Trykk på knappen for å gå til Google Play-abonnementsinnstillingene for å fikse betalingsmåten din. OsmAnd-Live-abonnement utløpt OsmAnd-Live-abonnement har blitt satt på vent OsmAnd-Live-abonnement på vent @@ -3927,8 +3927,13 @@ OsmAnd viser bilder fra flere kilder: \nOpenPlaceReviews - interessepunktbilder; \nMapillary - bilder på gatenivå; -\nWeb / Wikimedia - interessepunktbilder spesifisert i OpenStreetMap-data. - Du kan bruke høydedata for å ta i betraktning stigning/nedstigning på turen din +\nWeb / Wikimedia - interessepunktbilder i henhold til OpenStreetMap-data. + Du kan bruke høydedata for å ta hensyn til stigning/nedstigning på turen din Småfly %1$s * %2$s + Tysk (uformell) + Slå sammen segmenter + Del før + Del etter + Legg til et nytt segment \ No newline at end of file From f8e135eeb9496cb9d8e063e16b6d150f8f3d02a6 Mon Sep 17 00:00:00 2001 From: Gontzal Manuel Pujana Onaindia Date: Sun, 13 Dec 2020 13:56:11 +0000 Subject: [PATCH 25/91] Translated using Weblate (Basque) Currently translated at 99.3% (3554 of 3579 strings) --- OsmAnd/res/values-eu/strings.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OsmAnd/res/values-eu/strings.xml b/OsmAnd/res/values-eu/strings.xml index 3a3565a83b..4b641200f9 100644 --- a/OsmAnd/res/values-eu/strings.xml +++ b/OsmAnd/res/values-eu/strings.xml @@ -4000,4 +4000,12 @@ Area honi dagokio: %1$s x %2$s Egin iruzkina OSM oharrean Hautatu argazkia Erabili dev.openstreetmap.org + Hautatu inportatuko diren taldeak. + Hautatu inportatuko diren elementuak. + %1$s * %2$s + Hegazkin arina + Elkartu segmentuak + Zatitu aurretik + Zatitu ondoren + Gehitu segmentu berria \ No newline at end of file From 7a6b53d6e81a8b6f13edd2d4e788707bde110f58 Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Thu, 10 Dec 2020 13:42:43 +0000 Subject: [PATCH 26/91] Translated using Weblate (Sardinian) Currently translated at 99.7% (3571 of 3579 strings) --- OsmAnd/res/values-sc/strings.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 0e153179b1..b91b31f4f3 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -1540,7 +1540,7 @@ Dislinda s’artària de su veìculu permìtida pro sos caminos. Non faghet rugrare sas fronteras intre sos istados Recàrculu intelligente de s’àndala - Torra a carculare petzi su cantu initziale de s’àndala. Podet èssere impreadu pro biàgios longos. + Torra a carculare petzi su cantu initziale de s’àndala. Podet èssere ùtile pro biàgios longos. Disabilitadu Essi Coloratzione a segunda de sa casta (afiliatzione) de àndala @@ -3927,10 +3927,10 @@ Su documentu est giai importadu in OsmAnd Imprea un\'algoritmu de càrculu de s\'àndala A* a duas fases Pro sa ghia de motoislitas cun caminos e rastas dedicados. - Datos %1$s a disponimentu in sos caminos ebbia. Depes carculare un\'àndala impreende \"Àndala intre puntos\" pro los otènnere. + Datos %1$s a disponimentu in sos caminos ebbia. Depes carculare un\'àndala impreende \"Àndala intre puntos\" pro bìdere sos gràficos. Gràficu - Iseta su càrculu nou de s\'àndala. -\nSu gràficu at a èssere a disponimentu a pustis de su càrculu. + Pro praghere iseta. +\nSu gràficu at a èssere a disponimentu a pustis de su càrculu nou de s\'àndala. %1$s — %2$s Apretu/Emergèntzia Ispetziales @@ -3944,7 +3944,7 @@ OsmAnd impreat su MGRS, chi assimìgiat a su formadu UTM NATO. Mapas locales Servìtziu - Depes annànghere a su mancu duos puntos + Annanghe a su mancu duos puntos Intra in OpenStreetMap Intra in OpenStreetMap.org Intra cun OpenStreetMap @@ -3972,7 +3972,7 @@ Annanghe una fotografia Registra·ti in \nOpenPlaceReviews.org - Sas fotografias benint frunidas dae su progetu a datos abertos OpenPlaceReviews.org. Pro carrigare sas fotografias tuas ti depes registrare a su situ. + Sas fotografias benint frunidas dae su progetu a datos abertos OpenPlaceReviews.org. Pro carrigare sas fotografias tuas ti depes registrare a su situ issoro. Crea unu contu nou Tèngio giai unu contu Cronologia de chirca @@ -3983,7 +3983,7 @@ OsmAnd ammustrat fotografias dae fontes medas: \nOpenPlaceReviews - fotografias de sos PDI; \nMapillary - immàgines a livellu de su caminu; -\nWeb / Wikimedia - fotografias de sos PDI dillindadas in sos datos de OpenStreetMap. +\nWeb / Wikimedia - fotografias de sos PDI ligadas a sos datos de OpenStreetMap. Risursas Mannària aprossimativa de su documentu Ischerta sos datos de esportare in su documentu. @@ -4006,11 +4006,11 @@ Annanghe unu segmentu nou • Annanghidura de un\'optzione pro esportare e importare totu sos datos incluende sas impostatziones, sas risursas, e sos \"logos meos\" \n -\n • Pranificatzione de s\'àndala: gràficos pro segmentos cun s\'àndala e annanghidura de s\'abilidade de creare e modificare segmentos de rastas mùltiplos +\n • Pranificatzione de s\'àndala: gràficos pro segmentos de sa rasta cun s\'àndala e annanghidura de s\'abilidade de creare e modificare segmentos de rastas mùltiplos \n \n • Annanghidura de su mètodu de autenticatzione OAuth pro OpenStreetMap, IU de sas ventaneddas de diàlogu de OSM megiorada \n -\n • Colores personalizados pro sos preferidos e sos puntos de coladòrgiu de sas rastas +\n • Suportu pro colores personalizados pro sos preferidos e sos puntos de coladòrgiu de sas rastas \n \n \ No newline at end of file From 85ffbc609c818e916fd2aeb7e4d5b4d3c94a6149 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 12 Dec 2020 10:45:35 +0000 Subject: [PATCH 27/91] Translated using Weblate (German) Currently translated at 100.0% (3866 of 3866 strings) --- OsmAnd/res/values-de/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index 70508e72b4..9bbaf6eae9 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -3887,4 +3887,6 @@ Krankenpfleger/in Mobiler Geldvermittler Rettungsschwimmerbasis + Impfung: COVID19 + Impfung \ No newline at end of file From 21315741696a9538b74f847a333adc5b02205e88 Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Thu, 10 Dec 2020 18:23:19 +0000 Subject: [PATCH 28/91] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3866 of 3866 strings) --- OsmAnd/res/values-uk/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-uk/phrases.xml b/OsmAnd/res/values-uk/phrases.xml index a43fb6fdd1..0d1d73499a 100644 --- a/OsmAnd/res/values-uk/phrases.xml +++ b/OsmAnd/res/values-uk/phrases.xml @@ -3872,4 +3872,6 @@ Медсестра Мобільний грошовий агент Рятувальна станція + Щеплення: COVID19 + Щеплення \ No newline at end of file From d3af890eb9d378dd21b21779573ff44d8907d6b6 Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Thu, 10 Dec 2020 13:38:20 +0000 Subject: [PATCH 29/91] Translated using Weblate (Sardinian) Currently translated at 99.6% (3854 of 3866 strings) --- OsmAnd/res/values-sc/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-sc/phrases.xml b/OsmAnd/res/values-sc/phrases.xml index c8132230a7..b1f59330b8 100644 --- a/OsmAnd/res/values-sc/phrases.xml +++ b/OsmAnd/res/values-sc/phrases.xml @@ -3880,4 +3880,6 @@ Infermieri Agente de denaru mòbile Base de sos bagninos + Vatzinamentu: COVID19 + Vatzinamentu \ No newline at end of file From ac09833bbe13548b5c284d916980b6120dffcdf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Babos=20G=C3=A1bor?= Date: Thu, 10 Dec 2020 14:06:55 +0000 Subject: [PATCH 30/91] Translated using Weblate (Hungarian) Currently translated at 99.9% (3864 of 3866 strings) --- OsmAnd/res/values-hu/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-hu/phrases.xml b/OsmAnd/res/values-hu/phrases.xml index 06fec48153..89af6ff3b7 100644 --- a/OsmAnd/res/values-hu/phrases.xml +++ b/OsmAnd/res/values-hu/phrases.xml @@ -3876,4 +3876,6 @@ Sziréna Mobilpénzfizetési iroda Vízimentő-támaszpont + Oltóközpont: Covid19 + Oltóközpont \ No newline at end of file From 2fe12a7d9038b8be060add662c19991d822ebbc5 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Fri, 11 Dec 2020 20:34:35 +0000 Subject: [PATCH 31/91] Translated using Weblate (Slovak) Currently translated at 95.0% (3675 of 3866 strings) --- OsmAnd/res/values-sk/phrases.xml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-sk/phrases.xml b/OsmAnd/res/values-sk/phrases.xml index 15b02dfcb2..bb727870bc 100644 --- a/OsmAnd/res/values-sk/phrases.xml +++ b/OsmAnd/res/values-sk/phrases.xml @@ -1933,7 +1933,7 @@ Pumpa Typ Typ - Typ + Diplomatická inštitúcia Hlavné mesto Výdaj na predpis Špecializácia @@ -3664,4 +3664,34 @@ Zdravotná špecializácia: pôrodníctvo (postnatálne): nie Rašelinisko Slatina + Podnárodná úroveň + Reprezentačná kancelária + Kancelária + Honorárny konzul + Generálny konzulát + Kancelária konzula + Konzulárne zastupiteľstvo + Vedená konzulom + Rezidencia + Nunciatúra + Misia + Záujmová sekcia + Vysoký komisár + Delegácia + Pobočka + Vedená veľvyslancom + Nie + Áno + Nie + Áno + Nie + Áno + Neveľvyslanecký prostredník + Veľvyslanectvo + Neveľvyslanecký prostredník + Konzulát + Veľvyslanectvo + Služby občanom + Imigračné víza + Neimigračné víza \ No newline at end of file From 75aae71d77de81c9f2c50ff5155ff4c646ef269b Mon Sep 17 00:00:00 2001 From: Franco Date: Thu, 10 Dec 2020 21:49:59 +0000 Subject: [PATCH 32/91] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3579 of 3579 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index a06faa2b1f..0047cec907 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -1541,7 +1541,7 @@ Límite de altura Indica la altura permitida del vehículo en rutas. Recálculo inteligente de ruta - Recalcula sólo la parte inicial de la ruta. Puede usarse para viajes largos. + Recalcula sólo la parte inicial de la ruta, útil para viajes largos. Cerrar sesión Desactivado Color por red de afiliación @@ -3935,9 +3935,9 @@ El archivo ya fue importado en OsmAnd Usar el algoritmo de navegación A* bifásica Gráfico - Hay %1$s datos disponibles sólo en los caminos, debes calcular una ruta usando «Ruta entre puntos» para obtenerla. - Espera el recálculo de la ruta. -\nEl gráfico estará disponible después del recálculo. + Hay %1$s datos disponibles sólo en los caminos, calcular una ruta usando «Ruta entre puntos» para ver los gráficos. + Ten paciencia. +\nEl gráfico estará disponible al recalcular la ruta. %1$s — %2$s Mapas locales Comodidad @@ -3951,7 +3951,7 @@ MGRS MGRS OsmAnd usa MGRS, similar al formato UTM de la OTAN. - Debes añadir al menos dos puntos + Añadir al menos dos puntos Gestionar suscripción Hay un problema con la suscripción. Pulsa el botón para ir a los ajustes de la suscripción de Google Play y corregir el método de pago. La suscripción a OsmAnd Live ha caducado @@ -3996,7 +3996,7 @@ OsmAnd muestra fotos de varios repositorios: \nOpenPlaceReviews (fotos de PDI); \nMapillary (imágenes a nivel de calle); -\nWeb / Wikimedia (fotos de PDI incluidas en los datos de OpenStreetMap). +\nWeb / Wikimedia (fotos de PDI según datos de OpenStreetMap). Separador Marca los grupos que serán importados. Marca los elementos que serán importados. @@ -4006,7 +4006,7 @@ Elegir imagen Alemán (casual) %1$s * %2$s - Puedes usar los datos de elevación para considerar el ascenso o descenso de su viaje + Puedes usar los datos de elevación para tener en cuenta el ascenso y descenso del viaje Avión ligero Unir segmentos Dividir antes @@ -4014,7 +4014,7 @@ Añadir nuevo segmento • Se ha añadido la opción de exportar e importar todos los datos, incluyendo los ajustes, los recursos y «Mis sitios» \n -\n • Planificar ruta: se añadieron gráficos para los segmentos con la ruta y capacidad de crear o editar trazas de segmentos múltiples +\n • Planificar ruta: se añadieron gráficos para los segmentos de trazas con la ruta y capacidad de crear o editar trazas de segmentos múltiples \n \n • Se ha añadido el método de autenticación OAuth para OpenStreetMap y se ha mejorado la interfaz de usuario de los diálogos de OSM \n From 07ae1dced07ebdd9501322dac95b380f924d9e75 Mon Sep 17 00:00:00 2001 From: Franco Date: Thu, 10 Dec 2020 21:50:41 +0000 Subject: [PATCH 33/91] Translated using Weblate (Spanish (Argentina)) Currently translated at 99.9% (3865 of 3866 strings) --- OsmAnd/res/values-es-rAR/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml index 8bac002d00..674ae0bbfe 100644 --- a/OsmAnd/res/values-es-rAR/phrases.xml +++ b/OsmAnd/res/values-es-rAR/phrases.xml @@ -3891,4 +3891,6 @@ Enfermera Agente de dinero móvil Base de salvavidas + Vacunación: COVID19 + Vacunación \ No newline at end of file From 65be69ba9ffb13c00f31a7717a42d590e989cf56 Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Sat, 12 Dec 2020 00:41:24 +0000 Subject: [PATCH 34/91] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3866 of 3866 strings) --- OsmAnd/res/values-pt-rBR/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-pt-rBR/phrases.xml b/OsmAnd/res/values-pt-rBR/phrases.xml index 5797b56235..a39656c8b1 100644 --- a/OsmAnd/res/values-pt-rBR/phrases.xml +++ b/OsmAnd/res/values-pt-rBR/phrases.xml @@ -3884,4 +3884,6 @@ Enfermaria Agente de dinheiro móvel Base do salva-vidas + Vacinação: COVID19 + Vacinação \ No newline at end of file From 76100abd9b23f3979fc90eed1aebd514ed97e360 Mon Sep 17 00:00:00 2001 From: Franco Date: Thu, 10 Dec 2020 21:56:54 +0000 Subject: [PATCH 35/91] Translated using Weblate (Spanish (American)) Currently translated at 100.0% (3579 of 3579 strings) --- OsmAnd/res/values-es-rUS/strings.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OsmAnd/res/values-es-rUS/strings.xml b/OsmAnd/res/values-es-rUS/strings.xml index d8cadef2b0..e5909587a9 100644 --- a/OsmAnd/res/values-es-rUS/strings.xml +++ b/OsmAnd/res/values-es-rUS/strings.xml @@ -1541,7 +1541,7 @@ Límite de altura Indica la altura permitida del vehículo en rutas. Recálculo inteligente de ruta - Recalcula sólo la parte inicial de la ruta. Puede usarse para viajes largos. + Recalcula sólo la parte inicial de la ruta, útil para viajes largos. Cerrar sesión Desactivado Color por red de afiliación @@ -3935,9 +3935,9 @@ MGRS MGRS OsmAnd usa MGRS, similar al formato UTM de la OTAN. - Hay %1$s datos disponibles sólo en los caminos, debes calcular una ruta usando «Ruta entre puntos» para obtenerla. - Espera el recálculo de la ruta. -\nEl gráfico estará disponible después del recálculo. + Hay %1$s datos disponibles sólo en los caminos, calcular una ruta usando «Ruta entre puntos» para ver los gráficos. + Ten paciencia +\nEl gráfico estará disponible al recalcular la ruta. %1$s — %2$s Viaje Transporte @@ -3959,7 +3959,7 @@ Debes iniciar sesión para subir los cambios nuevos o modificados. \n \nPuedes ingresar usando el método seguro de OAuth o con nombre de usuario y contraseña. - Debes añadir al menos dos puntos + Añadir al menos dos puntos Historial de marcadores Gestionar suscripción Ingresar en OpenStreetMap.org @@ -3993,7 +3993,7 @@ OsmAnd muestra fotos de varios repositorios: \nOpenPlaceReviews (fotos de PDI); \nMapillary (imágenes a nivel de calle); -\nWeb / Wikimedia (fotos de PDI incluidas en los datos de OpenStreetMap). +\nWeb / Wikimedia (fotos de PDI según datos de OpenStreetMap). Cambia a la versión para desarrolladores «dev.openstreetmap.org» en lugar de openstreetmap.org para probar la carga de PDI, notas de OSM y archivos GPX. Usar dev.openstreetmap.org Elegir imagen @@ -4003,7 +4003,7 @@ Separador • Se ha añadido la opción de exportar e importar todos los datos, incluyendo los ajustes, los recursos y «Mis sitios» \n -\n • Planificar ruta: se añadieron gráficos para los segmentos con la ruta y capacidad de crear o editar trazas de segmentos múltiples +\n • Planificar ruta: se añadieron gráficos para los segmentos de trazas con la ruta y capacidad de crear o editar trazas de segmentos múltiples \n \n • Se ha añadido el método de autenticación OAuth para OpenStreetMap y se ha mejorado la interfaz de usuario de los diálogos de OSM \n @@ -4016,6 +4016,6 @@ Añadir nuevo segmento %1$s * %2$s Alemán (casual) - Puedes usar los datos de elevación para considerar el ascenso o descenso del viaje + Puedes usar los datos de elevación para tener en cuenta el ascenso y descenso del viaje Avión ligero \ No newline at end of file From 4ded080c549dabade8536e4576e0a01ae3b05000 Mon Sep 17 00:00:00 2001 From: Franco Date: Thu, 10 Dec 2020 22:01:14 +0000 Subject: [PATCH 36/91] Translated using Weblate (Spanish (American)) Currently translated at 100.0% (3866 of 3866 strings) --- OsmAnd/res/values-es-rUS/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-es-rUS/phrases.xml b/OsmAnd/res/values-es-rUS/phrases.xml index 0438edd1c5..c32df43468 100644 --- a/OsmAnd/res/values-es-rUS/phrases.xml +++ b/OsmAnd/res/values-es-rUS/phrases.xml @@ -3891,4 +3891,6 @@ Sirena Enfermera Agente de dinero móvil + Vacunación: COVID19 + Vacunación \ No newline at end of file From d88767e49c9aefe103511a9f225f53862b20df44 Mon Sep 17 00:00:00 2001 From: Verdulo Date: Thu, 10 Dec 2020 20:59:37 +0000 Subject: [PATCH 37/91] Translated using Weblate (Esperanto) Currently translated at 100.0% (3579 of 3579 strings) --- OsmAnd/res/values-eo/strings.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index 217c78aa25..2994035820 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -1853,7 +1853,7 @@ Erara formo: %s Vi devas esti konektita al la interreto por instali tiun ĉi kromprogramon. Inteligenta rekalkulado de kurso - Rekalkuli nur komencan parton de kurso. Uzebla por longaj kursoj. + Rekalkuli nur komencan parton de kurso, utila por longaj kursoj. Taksi tiun ĉi aplikaĵon Via opinio estas grava por ni. Bonvolu taksi OsmAnd ĉe Google Play @@ -3929,9 +3929,9 @@ Dosiero jam estas enportita al OsmAnd Uzi 2-fazan A* algoritmon de navigo Diagramo - Datumoj de %1$s estas disponeblaj nur por vojoj, vi devas kalkuli la kurson uzante “kalkuli kurson inter punktoj” por akiri ĝin. - Atendado ĝis la kurso estos rekalkulita. -\nDiagramo estos videbla post rekalkulado. + Datumoj de %1$s estas disponeblaj nur por vojoj, kalkulu la kurson uzante “kalkuli kurson inter punktoj” por montri diagramon. + Bonvolu atendi. +\nDiagramo estos videbla post rekalkuli kurson. %1$s — %2$s Manko Lokaj mapoj @@ -3948,7 +3948,7 @@ OsmAnd uzas MGRS, kiu estas simila al la formo UTM NATO. Aldonu almenaŭ du punktojn Administri abonon - Okazis problemo pri via abono. Premu la butonon por iri al agordoj pri abonoj ĉe Google Play por korekti vian pagmanieron. + Okazis problemo pri via abono. Frapetu la butonon por iri al agordoj pri abonoj ĉe Google Play por korekti vian pagmanieron. Abono OsmAnd Live senvalidiĝis Abono OsmAnd Live estas paŭziigita Abono OsmAnd Live estas ĉesigita @@ -3983,7 +3983,7 @@ OsmAnd montras fotojn el diversaj fontoj: \nOpenPlaceReviews – fotoj de interesejoj; \nMapillary – strat‑nivela fotaro; -\ninterreto, Vikimedio – fotoj de interesejoj difinitaj en OpenStreetMap-datumoj. +\ninterreto, Vikimedio – fotoj de interesejoj difinitaj en OSM-datumoj. Rimedoj Proksimuma dosiergrando Elektu datumojn por elporti al dosiero. From b8e22e88ffd6359c5e9327944dea6589291bf946 Mon Sep 17 00:00:00 2001 From: ssantos Date: Sat, 12 Dec 2020 15:44:15 +0000 Subject: [PATCH 38/91] Translated using Weblate (Portuguese) Currently translated at 100.0% (3866 of 3866 strings) --- OsmAnd/res/values-pt/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-pt/phrases.xml b/OsmAnd/res/values-pt/phrases.xml index 900b1b946f..0d76425e2b 100644 --- a/OsmAnd/res/values-pt/phrases.xml +++ b/OsmAnd/res/values-pt/phrases.xml @@ -3869,4 +3869,6 @@ Enfermeira Agente de dinheiro móvel Base de salva-vidas + Vacinação: COVID19 + Vacinação \ No newline at end of file From b580bff984d23bd9c61996285d5ad27ba9826720 Mon Sep 17 00:00:00 2001 From: Verdulo Date: Thu, 10 Dec 2020 21:04:36 +0000 Subject: [PATCH 39/91] Translated using Weblate (Esperanto) Currently translated at 100.0% (3866 of 3866 strings) --- OsmAnd/res/values-eo/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-eo/phrases.xml b/OsmAnd/res/values-eo/phrases.xml index 54cb470b7e..af5be65c53 100644 --- a/OsmAnd/res/values-eo/phrases.xml +++ b/OsmAnd/res/values-eo/phrases.xml @@ -3877,4 +3877,6 @@ Flegist(in)o Agentejo de poŝtelefonaj pagoj Bazo de akvaj savistoj + vakcinado: KOVIM-19 + vakcinado \ No newline at end of file From 5072af9918889ce6a00e16be70ae4aa70ba53366 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Fri, 11 Dec 2020 02:45:40 +0000 Subject: [PATCH 40/91] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3866 of 3866 strings) --- OsmAnd/res/values-zh-rTW/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-zh-rTW/phrases.xml b/OsmAnd/res/values-zh-rTW/phrases.xml index 49c4923944..b43a3cf343 100644 --- a/OsmAnd/res/values-zh-rTW/phrases.xml +++ b/OsmAnd/res/values-zh-rTW/phrases.xml @@ -3883,4 +3883,6 @@ 護理師 行動貨幣代理商 救生員基地 + 預防接種:COVID-19 + 預防接種 \ No newline at end of file From b78022397fbdeef5af0b931e7dbeec589fef5b76 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 10 Dec 2020 15:50:18 +0000 Subject: [PATCH 41/91] Translated using Weblate (Russian) Currently translated at 99.9% (3865 of 3866 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 0bfeda0e63..b73ecf1b52 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3869,4 +3869,8 @@ Раздел интересов Консульство Сирена + Вакцинация: COVID19 + Вакцинация + База спасателей + Медсестра \ No newline at end of file From d6dccf83641a626683eb5b481f9527aa13a7f4b6 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Sun, 13 Dec 2020 20:51:41 +0200 Subject: [PATCH 42/91] Refactor PopUpMenuWindow --- OsmAnd/res/layout/popup_menu_item.xml | 13 +- .../plus/SimplePopUpMenuItemAdapter.java | 103 ------------- OsmAnd/src/net/osmand/plus/UiUtilities.java | 62 -------- .../other/TrackDetailsMenu.java | 60 ++++---- .../SelectFileBottomSheet.java | 22 +-- .../plus/myplaces/AvailableGPXFragment.java | 131 +++++++++-------- .../FollowTrackFragment.java | 20 ++- .../views/mapwidgets/MapWidgetRegistry.java | 89 ++++++----- .../widgets/popup/PopUpMenuArrayAdapter.java | 83 +++++++++++ .../plus/widgets/popup/PopUpMenuHelper.java | 138 ++++++++++++++++++ .../plus/widgets/popup/PopUpMenuItem.java | 100 +++++++++++++ 11 files changed, 508 insertions(+), 313 deletions(-) delete mode 100644 OsmAnd/src/net/osmand/plus/SimplePopUpMenuItemAdapter.java create mode 100644 OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuArrayAdapter.java create mode 100644 OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuHelper.java create mode 100644 OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuItem.java diff --git a/OsmAnd/res/layout/popup_menu_item.xml b/OsmAnd/res/layout/popup_menu_item.xml index 93786c652d..fe26c4828e 100644 --- a/OsmAnd/res/layout/popup_menu_item.xml +++ b/OsmAnd/res/layout/popup_menu_item.xml @@ -16,8 +16,9 @@ + + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/SimplePopUpMenuItemAdapter.java b/OsmAnd/src/net/osmand/plus/SimplePopUpMenuItemAdapter.java deleted file mode 100644 index a646b7a416..0000000000 --- a/OsmAnd/src/net/osmand/plus/SimplePopUpMenuItemAdapter.java +++ /dev/null @@ -1,103 +0,0 @@ -package net.osmand.plus; - -import android.content.Context; -import android.graphics.drawable.Drawable; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ArrayAdapter; -import android.widget.ImageView; -import android.widget.TextView; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -import net.osmand.AndroidUtils; - -import static net.osmand.plus.SimplePopUpMenuItemAdapter.SimplePopUpMenuItem; - -import java.util.List; - -public class SimplePopUpMenuItemAdapter - extends ArrayAdapter { - - private List items; - - public SimplePopUpMenuItemAdapter(@NonNull Context context, int resource, - List items) { - super(context, resource); - this.items = items; - } - - @Override - public int getCount() { - return items.size(); - } - - @NonNull - @Override - public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { - LayoutInflater inflater = LayoutInflater.from(getContext()); - if (convertView == null) { - convertView = inflater.inflate(R.layout.popup_menu_item, parent, false); - } - SimplePopUpMenuItem item = getItem(position); - if (item != null) { - TextView tvTitle = convertView.findViewById(R.id.title); - tvTitle.setText(item.title); - ImageView ivIcon = convertView.findViewById(R.id.icon); - Drawable icon = item.icon; - if (icon != null) { - ivIcon.setImageDrawable(icon); - } else { - ivIcon.setVisibility(View.GONE); - } - if (item.selected) { - convertView.setBackgroundColor(UiUtilities.getColorWithAlpha( - AndroidUtils.getColorFromAttr(getContext(), R.attr.active_color_basic), 0.1f)); - } - } - return convertView; - } - - @Nullable - @Override - public SimplePopUpMenuItem getItem(int position) { - return items.get(position); - } - - public static class SimplePopUpMenuItem { - private CharSequence title; - private Drawable icon; - private View.OnClickListener onClickListener; - boolean selected; - - public SimplePopUpMenuItem(CharSequence title, Drawable icon) { - this.title = title; - this.icon = icon; - } - - public SimplePopUpMenuItem(CharSequence title, Drawable icon, View.OnClickListener onClickListener) { - this(title, icon); - this.onClickListener = onClickListener; - } - - public SimplePopUpMenuItem(CharSequence title, Drawable icon, View.OnClickListener onClickListener, - boolean selected) { - this(title, icon, onClickListener); - this.selected = selected; - } - - public CharSequence getTitle() { - return title; - } - - public Drawable getIcon() { - return icon; - } - - public View.OnClickListener getOnClickListener() { - return onClickListener; - } - } -} diff --git a/OsmAnd/src/net/osmand/plus/UiUtilities.java b/OsmAnd/src/net/osmand/plus/UiUtilities.java index 2a4e3804b3..94bd3c4bcb 100644 --- a/OsmAnd/src/net/osmand/plus/UiUtilities.java +++ b/OsmAnd/src/net/osmand/plus/UiUtilities.java @@ -21,7 +21,6 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import android.view.WindowManager; -import android.widget.AdapterView; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.LinearLayout; @@ -34,7 +33,6 @@ import androidx.annotation.NonNull; import androidx.annotation.StringRes; import androidx.appcompat.content.res.AppCompatResources; import androidx.appcompat.view.ContextThemeWrapper; -import androidx.appcompat.widget.ListPopupWindow; import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.Toolbar; import androidx.core.content.ContextCompat; @@ -60,13 +58,8 @@ import net.osmand.plus.widgets.style.CustomTypefaceSpan; import org.apache.commons.logging.Log; -import java.util.ArrayList; -import java.util.List; - import gnu.trove.map.hash.TLongObjectHashMap; -import static net.osmand.plus.SimplePopUpMenuItemAdapter.SimplePopUpMenuItem; - public class UiUtilities { private static final Log LOG = PlatformUtil.getLog(UiUtilities.class); @@ -768,59 +761,4 @@ public class UiUtilities { } return spannable; } - - public static ListPopupWindow createListPopupWindow(Context themedCtx, - View v, int minWidth, - List items, - final AdapterView.OnItemClickListener listener) { - int contentPadding = themedCtx.getResources().getDimensionPixelSize(R.dimen.content_padding); - int contentPaddingHalf = themedCtx.getResources().getDimensionPixelSize(R.dimen.content_padding_half); - int defaultListTextSize = themedCtx.getResources().getDimensionPixelSize(R.dimen.default_list_text_size); - int standardIconSize = themedCtx.getResources().getDimensionPixelSize(R.dimen.standard_icon_size); - boolean hasIcon = false; - - List titles = new ArrayList<>(); - for (SimplePopUpMenuItem item : items) { - titles.add(String.valueOf(item.getTitle())); - hasIcon = hasIcon || item.getIcon() != null; - } - float itemWidth = AndroidUtils.getTextMaxWidth(defaultListTextSize, titles) + contentPadding * 2; - float iconPartWidth = hasIcon ? standardIconSize + contentPaddingHalf : 0; - int totalWidth = (int) (Math.max(itemWidth, minWidth) + iconPartWidth); - - SimplePopUpMenuItemAdapter adapter = - new SimplePopUpMenuItemAdapter(themedCtx, R.layout.popup_menu_item, items); - final ListPopupWindow listPopupWindow = new ListPopupWindow(themedCtx); - listPopupWindow.setAnchorView(v); - listPopupWindow.setContentWidth((int) (totalWidth)); - listPopupWindow.setDropDownGravity(Gravity.END | Gravity.TOP); - listPopupWindow.setVerticalOffset(-v.getHeight() + contentPaddingHalf); - listPopupWindow.setModal(true); - listPopupWindow.setAdapter(adapter); - listPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - if (listener != null) { - listener.onItemClick(parent, view, position, id); - } - listPopupWindow.dismiss(); - } - }); - return listPopupWindow; - } - - public static void showPopUpMenu(View v, final List items) { - UiUtilities.createListPopupWindow( - v.getContext(), v, v.getWidth(), items, new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - if (position < items.size()) { - View.OnClickListener listener = items.get(position).getOnClickListener(); - if (listener != null) { - listener.onClick(view); - } - } - } - }).show(); - } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java index 94811ff241..edec4eeb2f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java @@ -4,6 +4,7 @@ import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Matrix; import android.graphics.PointF; +import android.graphics.drawable.Drawable; import android.util.Pair; import android.view.MotionEvent; import android.view.View; @@ -47,6 +48,8 @@ import net.osmand.plus.helpers.GpxUiHelper.OrderedLineDataSet; import net.osmand.plus.views.layers.GPXLayer; import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory; import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarController; +import net.osmand.plus.widgets.popup.PopUpMenuHelper; +import net.osmand.plus.widgets.popup.PopUpMenuItem; import net.osmand.util.MapUtils; import java.util.ArrayList; @@ -54,8 +57,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; -import static net.osmand.plus.SimplePopUpMenuItemAdapter.SimplePopUpMenuItem; - public class TrackDetailsMenu { private static final int MAX_DISTANCE_LOCATION_PROJECTION = 20; // in meters @@ -773,22 +774,26 @@ public class TrackDetailsMenu { yAxis.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Context themedContext = UiUtilities.getThemedContext(v.getContext(), nightMode); - List items = new ArrayList<>(); + List items = new ArrayList<>(); for (GPXDataSetType[] types : availableTypes) { - items.add(new SimplePopUpMenuItem( - GPXDataSetType.getName(app, types), - GPXDataSetType.getImageDrawable(app, types))); + String title = GPXDataSetType.getName(app, types); + Drawable icon = GPXDataSetType.getImageDrawable(app, types); + items.add(new PopUpMenuItem.Builder(app) + .setTitle(title) + .setIcon(icon) + .create()); } - UiUtilities.createListPopupWindow( - themedContext, v, v.getWidth(), items, new AdapterView.OnItemClickListener() { + AdapterView.OnItemClickListener listener = new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { GpxDisplayItem gpxItem = getGpxItem(); gpxItem.chartTypes = availableTypes.get(position); update(); } - }).show(); + }; + new PopUpMenuHelper.Builder(v, items, nightMode) + .setListener(listener) + .show(); } }); yAxisArrow.setVisibility(View.VISIBLE); @@ -816,25 +821,26 @@ public class TrackDetailsMenu { xAxis.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Context themedContext = UiUtilities.getThemedContext(v.getContext(), nightMode); - List items = new ArrayList<>(); + List items = new ArrayList<>(); for (GPXDataSetAxisType type : GPXDataSetAxisType.values()) { - items.add(new SimplePopUpMenuItem( - app.getString(type.getStringId()), type.getImageDrawable(app))); + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(type.getStringId()) + .setIcon(type.getImageDrawable(app)) + .create()); } - UiUtilities.createListPopupWindow(themedContext, - v, v.getWidth(), items, new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - GpxDisplayItem gpxItem = getGpxItem(); - if (gpxItem != null) { - gpxItem.chartAxisType = GPXDataSetAxisType.values()[position]; - gpxItem.chartHighlightPos = -1; - gpxItem.chartMatrix = null; - update(); - } - } - }).show(); + new PopUpMenuHelper.Builder(v, items, nightMode) + .setListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + GpxDisplayItem gpxItem = getGpxItem(); + if (gpxItem != null) { + gpxItem.chartAxisType = GPXDataSetAxisType.values()[position]; + gpxItem.chartHighlightPos = -1; + gpxItem.chartMatrix = null; + update(); + } + } + }).show(); } }); xAxisArrow.setVisibility(View.VISIBLE); diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/SelectFileBottomSheet.java b/OsmAnd/src/net/osmand/plus/measurementtool/SelectFileBottomSheet.java index 43037f1398..379e5a9dbf 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/SelectFileBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/SelectFileBottomSheet.java @@ -20,7 +20,6 @@ import net.osmand.IndexConstants; import net.osmand.OsmAndCollator; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; -import net.osmand.plus.UiUtilities; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; import net.osmand.plus.helpers.GpxTrackAdapter; @@ -30,6 +29,8 @@ import net.osmand.plus.helpers.enums.TracksSortByMode; import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter; import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter.HorizontalSelectionAdapterListener; import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter.HorizontalSelectionItem; +import net.osmand.plus.widgets.popup.PopUpMenuHelper; +import net.osmand.plus.widgets.popup.PopUpMenuItem; import java.io.File; import java.util.ArrayList; @@ -39,7 +40,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static net.osmand.plus.SimplePopUpMenuItemAdapter.SimplePopUpMenuItem; import static net.osmand.plus.helpers.GpxUiHelper.getSortedGPXFilesInfo; import static net.osmand.util.Algorithms.collectDirs; @@ -118,12 +118,12 @@ public class SelectFileBottomSheet extends MenuBottomSheetDialogFragment { sortButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - final List items = new ArrayList<>(); + final List items = new ArrayList<>(); for (final TracksSortByMode mode : TracksSortByMode.values()) { - items.add(new SimplePopUpMenuItem( - getString(mode.getNameId()), - app.getUIUtilities().getThemedIcon(mode.getIconId()), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(mode.getNameId()) + .setIcon(app.getUIUtilities().getThemedIcon(mode.getIconId())) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sortByMode = mode; @@ -135,10 +135,12 @@ public class SelectFileBottomSheet extends MenuBottomSheetDialogFragment { sortFileList(); adapter.notifyDataSetChanged(); } - }, sortByMode == mode - )); + }) + .setSelected(sortByMode == mode) + .create()); } - UiUtilities.showPopUpMenu(v, items); + new PopUpMenuHelper.Builder(v, items, nightMode) + .show(); } }); diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 48c1dca711..9e4ac656a4 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -23,7 +23,6 @@ import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; import android.widget.AbsListView; -import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CheckBox; @@ -71,7 +70,6 @@ import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; -import net.osmand.plus.SimplePopUpMenuItemAdapter.SimplePopUpMenuItem; import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.OsmandBaseExpandableListAdapter; @@ -86,6 +84,8 @@ import net.osmand.plus.monitoring.OsmandMonitoringPlugin; import net.osmand.plus.osmedit.OsmEditingPlugin; import net.osmand.plus.osmedit.oauth.OsmOAuthHelper.OsmAuthorizationListener; import net.osmand.plus.settings.backend.OsmandSettings; +import net.osmand.plus.widgets.popup.PopUpMenuItem; +import net.osmand.plus.widgets.popup.PopUpMenuHelper; import java.io.File; import java.text.DateFormat; @@ -576,13 +576,14 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement if (itemId == R.id.action_sort) { Activity activity = getActivity(); if (activity != null) { + boolean nightMode = app.getSettings().isLightContent(); View menuSortItemView = getActivity().findViewById(R.id.action_sort); - final List items = new ArrayList<>(); + final List items = new ArrayList<>(); for (final TracksSortByMode mode : TracksSortByMode.values()) { - items.add(new SimplePopUpMenuItem( - getString(mode.getNameId()), - app.getUIUtilities().getThemedIcon(mode.getIconId()), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(mode.getNameId()) + .setIcon(app.getUIUtilities().getThemedIcon(mode.getIconId())) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { updateTracksSort(mode); @@ -590,10 +591,12 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement : R.color.active_buttons_and_links_text_dark; item.setIcon(getIcon(mode.getIconId(), iconColorId)); } - }, sortByMode == mode - )); + }) + .setSelected(sortByMode == mode) + .create() + ); } - UiUtilities.showPopUpMenu(menuSortItemView, items); + new PopUpMenuHelper.Builder(menuSortItemView, items, nightMode).show(); } } return super.onOptionsItemSelected(item); @@ -1489,51 +1492,55 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement } private void openPopUpMenu(View v, final GpxInfo gpxInfo) { - final List items = new ArrayList<>(); + boolean nightMode = app.getSettings().isLightContent(); + final List items = new ArrayList<>(); UiUtilities iconsCache = getMyApplication().getUIUtilities(); - items.add(new SimplePopUpMenuItem( - getString(R.string.shared_string_show_on_map), - iconsCache.getThemedIcon(R.drawable.ic_show_on_map), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(R.string.shared_string_show_on_map) + .setIcon(iconsCache.getThemedIcon(R.drawable.ic_show_on_map)) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showGpxOnMap(gpxInfo); } - } - )); + }) + .create() + ); GPXTrackAnalysis analysis; if ((analysis = getGpxTrackAnalysis(gpxInfo, app, null)) != null) { if (analysis.totalDistance != 0 && !gpxInfo.currentlyRecordingTrack) { - items.add(new SimplePopUpMenuItem( - getString(R.string.analyze_on_map), - iconsCache.getThemedIcon(R.drawable.ic_action_info_dark), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(R.string.analyze_on_map) + .setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_info_dark)) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { new OpenGpxDetailsTask(gpxInfo).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } - } - )); + }) + .create() + ); } } - items.add(new SimplePopUpMenuItem( - getString(R.string.shared_string_move), - iconsCache.getThemedIcon(R.drawable.ic_action_folder_stroke), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(R.string.shared_string_move) + .setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_folder_stroke)) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { moveGpx(gpxInfo); } - } - )); + }) + .create() + ); - items.add(new SimplePopUpMenuItem( - getString(R.string.shared_string_rename), - iconsCache.getThemedIcon(R.drawable.ic_action_edit_dark), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(R.string.shared_string_rename) + .setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_edit_dark)) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { FileUtils.renameFile(getActivity(), gpxInfo.file, new RenameCallback() { @@ -1544,14 +1551,15 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement } }); } - } - )); + }) + .create() + ); Drawable shareIcon = iconsCache.getThemedIcon((R.drawable.ic_action_gshare_dark)); - items.add(new SimplePopUpMenuItem( - getString(R.string.shared_string_share), - AndroidUtils.getDrawableForDirection(app, shareIcon), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(R.string.shared_string_share) + .setIcon(AndroidUtils.getDrawableForDirection(app, shareIcon)) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final Uri fileUri = AndroidUtils.getUriForFile(getMyApplication(), gpxInfo.file); @@ -1561,27 +1569,29 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); startActivity(sendIntent); } - } - )); + }) + .create() + ); final OsmEditingPlugin osmEditingPlugin = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class); if (osmEditingPlugin != null && osmEditingPlugin.isActive()) { - items.add(new SimplePopUpMenuItem( - getString(R.string.shared_string_export), - iconsCache.getThemedIcon(R.drawable.ic_action_export), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(R.string.shared_string_export) + .setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_export)) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { osmEditingPlugin.sendGPXFiles(getActivity(), AvailableGPXFragment.this, gpxInfo); } - } - )); + }) + .create() + ); } - items.add(new SimplePopUpMenuItem( - getString(R.string.shared_string_delete), - iconsCache.getThemedIcon(R.drawable.ic_action_delete_dark), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(R.string.shared_string_delete) + .setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_delete_dark)) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); @@ -1596,21 +1606,10 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement builder.setNegativeButton(R.string.shared_string_cancel, null); builder.show(); } - } - )); - - UiUtilities.createListPopupWindow( - getContext(), v, v.getWidth(), items, new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - if (position < items.size()) { - View.OnClickListener listener = items.get(position).getOnClickListener(); - if (listener != null) { - listener.onClick(view); - } - } - } - }).show(); + }) + .create() + ); + new PopUpMenuHelper.Builder(v, items, nightMode).show(); } public class DeleteGpxTask extends AsyncTask { diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java index 7730010808..f20b9f9350 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java @@ -33,7 +33,6 @@ import net.osmand.data.RotatedTileBox; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; -import net.osmand.plus.SimplePopUpMenuItemAdapter.SimplePopUpMenuItem; import net.osmand.plus.UiUtilities; import net.osmand.plus.UiUtilities.DialogButtonType; import net.osmand.plus.activities.MapActivity; @@ -64,6 +63,8 @@ import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder; import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.views.layers.MapControlsLayer; +import net.osmand.plus.widgets.popup.PopUpMenuHelper; +import net.osmand.plus.widgets.popup.PopUpMenuItem; import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -613,11 +614,12 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca sortButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List items = new ArrayList<>(); + List items = new ArrayList<>(); for (final TracksSortByMode mode : TracksSortByMode.values()) { - items.add(new SimplePopUpMenuItem(getString(mode.getNameId()), - app.getUIUtilities().getThemedIcon(mode.getIconId()), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(mode.getNameId()) + .setIcon(app.getUIUtilities().getThemedIcon(mode.getIconId())) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sortByMode = mode; @@ -626,10 +628,12 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca tracksCard.setSortByMode(mode); } } - }, sortByMode == mode - )); + }) + .setSelected(sortByMode == mode) + .create() + ); } - UiUtilities.showPopUpMenu(v, items); + new PopUpMenuHelper.Builder(v, items, isNightMode()).show(); } }); } diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java index fc19f5ba3c..cfb1b2af37 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java @@ -9,8 +9,8 @@ import android.widget.LinearLayout; import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; -import net.osmand.plus.SimplePopUpMenuItemAdapter.SimplePopUpMenuItem; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.ContextMenuItem; @@ -28,6 +28,9 @@ import net.osmand.plus.views.layers.MapQuickActionLayer; import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.plus.views.mapwidgets.widgets.TextInfoWidget; import net.osmand.plus.views.mapwidgets.widgetstates.WidgetState; +import net.osmand.plus.widgets.popup.PopUpMenuItem; +import net.osmand.plus.widgets.popup.PopUpMenuHelper; +import net.osmand.plus.widgets.popup.PopUpMenuHelper.PopUpMenuWidthType; import java.util.ArrayList; import java.util.Collections; @@ -513,6 +516,7 @@ public class MapWidgetRegistry { final String desc = mapActivity.getString(R.string.shared_string_collapse); final boolean nightMode = app.getDaynightHelper().isNightModeForMapControls(); final int currentModeColorRes = mode.getIconColorInfo().getColor(nightMode); + final int currentModeColor = ContextCompat.getColor(app, currentModeColorRes); ContextMenuItem.ItemBuilder itemBuilder = new ContextMenuItem.ItemBuilder() .setIcon(r.getDrawableMenu()) .setSelected(selected) @@ -530,7 +534,7 @@ public class MapWidgetRegistry { return false; } View textWrapper = view.findViewById(R.id.text_wrapper); - List items = new ArrayList<>(); + List items = new ArrayList<>(); UiUtilities ic = app.getUIUtilities(); final int[] menuIconIds = r.getDrawableMenuIds(); @@ -547,60 +551,73 @@ public class MapWidgetRegistry { boolean isChecked = id == checkedId; String title = app.getString(titleId); Drawable icon = isChecked && selected ? ic.getIcon(iconId, currentModeColorRes) : ic.getThemedIcon(iconId); - items.add(new SimplePopUpMenuItem(title, icon, new View.OnClickListener() { - @Override - public void onClick(View v) { - r.changeState(id); - MapInfoLayer mil = mapActivity.getMapLayers().getMapInfoLayer(); - if (mil != null) { - mil.recreateControls(); - } - ContextMenuItem item = adapter.getItem(pos); - item.setIcon(r.getDrawableMenu()); - if (r.getMessage() != null) { - item.setTitle(r.getMessage()); - } else { - item.setTitle(mapActivity.getResources().getString(r.getMessageId())); - } - adapter.notifyDataSetChanged(); - } - }, isChecked)); + items.add(new PopUpMenuItem.Builder(app) + .setTitle(title) + .setIcon(icon) + .setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + r.changeState(id); + MapInfoLayer mil = mapActivity.getMapLayers().getMapInfoLayer(); + if (mil != null) { + mil.recreateControls(); + } + ContextMenuItem item = adapter.getItem(pos); + item.setIcon(r.getDrawableMenu()); + if (r.getMessage() != null) { + item.setTitle(r.getMessage()); + } else { + item.setTitle(mapActivity.getResources().getString(r.getMessageId())); + } + adapter.notifyDataSetChanged(); + } + }) + .showCompoundBtn(currentModeColor) + .setSelected(isChecked) + .create()); } } // show - items.add(new SimplePopUpMenuItem( - app.getString(R.string.shared_string_show), - ic.getThemedIcon(R.drawable.ic_action_view), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(R.string.shared_string_show) + .setIcon(ic.getThemedIcon(R.drawable.ic_action_view)) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setVisibility(adapter, pos, true, false); } - })); + }) + .create()); // hide - items.add(new SimplePopUpMenuItem( - app.getString(R.string.shared_string_hide), - ic.getThemedIcon(R.drawable.ic_action_hide), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(R.string.shared_string_hide) + .setIcon(ic.getThemedIcon(R.drawable.ic_action_hide)) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setVisibility(adapter, pos, false, false); } - })); + }) + .create()); // collapse - items.add(new SimplePopUpMenuItem( - app.getString(R.string.shared_string_collapse), - ic.getThemedIcon(R.drawable.ic_action_widget_collapse), - new View.OnClickListener() { + items.add(new PopUpMenuItem.Builder(app) + .setTitleId(R.string.shared_string_collapse) + .setIcon(ic.getThemedIcon(R.drawable.ic_action_widget_collapse)) + .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setVisibility(adapter, pos, true, true); } - })); - UiUtilities.showPopUpMenu(textWrapper, items); + }) + .create()); + + new PopUpMenuHelper.Builder(textWrapper, items, nightMode) + .setWidthType(PopUpMenuWidthType.STANDARD) + .show(); + return false; } diff --git a/OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuArrayAdapter.java b/OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuArrayAdapter.java new file mode 100644 index 0000000000..f383c5b9ad --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuArrayAdapter.java @@ -0,0 +1,83 @@ +package net.osmand.plus.widgets.popup; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.CompoundButton; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import net.osmand.AndroidUtils; +import net.osmand.plus.R; +import net.osmand.plus.UiUtilities; + +import java.util.List; + +public class PopUpMenuArrayAdapter extends ArrayAdapter { + + private List items; + private boolean nightMode; + + public PopUpMenuArrayAdapter(@NonNull Context context, + int resource, + List items, + boolean nightMode) { + super(context, resource); + this.items = items; + this.nightMode = nightMode; + } + + @Override + public int getCount() { + return items.size(); + } + + @NonNull + @Override + public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { + LayoutInflater inflater = LayoutInflater.from(getContext()); + if (convertView == null) { + convertView = inflater.inflate(R.layout.popup_menu_item, parent, false); + } + PopUpMenuItem item = getItem(position); + if (item != null) { + TextView tvTitle = convertView.findViewById(R.id.title); + tvTitle.setText(item.getTitle()); + ImageView ivIcon = convertView.findViewById(R.id.icon); + Drawable icon = item.getIcon(); + if (icon != null) { + ivIcon.setImageDrawable(icon); + } else { + ivIcon.setVisibility(View.GONE); + } + CompoundButton radio = convertView.findViewById(R.id.radio); + if (item.isShowCompoundBtn()) { + UiUtilities.setupCompoundButton(nightMode, item.getCompoundBtnColor(), radio); + radio.setVisibility(View.VISIBLE); + } else { + radio.setVisibility(View.GONE); + } + if (item.isSelected()) { + if (item.isShowCompoundBtn()) { + radio.setChecked(true); + } else { + convertView.setBackgroundColor(UiUtilities.getColorWithAlpha( + AndroidUtils.getColorFromAttr(getContext(), R.attr.active_color_basic), 0.1f)); + } + } + } + return convertView; + } + + @Nullable + @Override + public PopUpMenuItem getItem(int position) { + return items.get(position); + } +} diff --git a/OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuHelper.java b/OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuHelper.java new file mode 100644 index 0000000000..45d01e9142 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuHelper.java @@ -0,0 +1,138 @@ +package net.osmand.plus.widgets.popup; + +import android.content.Context; +import android.view.Gravity; +import android.view.View; +import android.widget.AdapterView; + +import androidx.annotation.NonNull; +import androidx.appcompat.widget.ListPopupWindow; + +import net.osmand.AndroidUtils; +import net.osmand.plus.R; +import net.osmand.plus.UiUtilities; + +import java.util.ArrayList; +import java.util.List; + +public class PopUpMenuHelper { + + private View anchorView; + private List items; + private PopUpMenuWidthType widthType; + private AdapterView.OnItemClickListener listener; + private boolean nightMode; + + private PopUpMenuHelper(@NonNull View anchorView, + @NonNull List items, + PopUpMenuWidthType widthType, + AdapterView.OnItemClickListener listener, + boolean nightMode) { + this.anchorView = anchorView; + this.items = items; + this.widthType = widthType; + this.listener = listener; + this.nightMode = nightMode; + } + + private void show() { + ListPopupWindow listPopupWindow = createPopUpWindow(); + listPopupWindow.show(); + } + + private ListPopupWindow createPopUpWindow() { + Context ctx = UiUtilities.getThemedContext(anchorView.getContext(), nightMode); + int contentPadding = getDimensionPixelSize(ctx, R.dimen.content_padding); + int contentPaddingHalf = getDimensionPixelSize(ctx, R.dimen.content_padding_half); + int defaultListTextSize = getDimensionPixelSize(ctx, R.dimen.default_list_text_size); + int standardIconSize = getDimensionPixelSize(ctx, R.dimen.standard_icon_size); + boolean hasIcon = false; + + List titles = new ArrayList<>(); + for (PopUpMenuItem item : items) { + titles.add(String.valueOf(item.getTitle())); + hasIcon = hasIcon || item.getIcon() != null; + } + float itemWidth = AndroidUtils.getTextMaxWidth(defaultListTextSize, titles) + contentPadding * 2; + float iconPartWidth = hasIcon ? standardIconSize + contentPaddingHalf : 0; + float compoundBtnWidth = contentPadding * 3; + int minWidth = widthType == PopUpMenuWidthType.AS_ANCHOR_VIEW ? anchorView.getWidth() : 0; + float additional; + if (widthType == PopUpMenuWidthType.STANDARD) { + additional = iconPartWidth + compoundBtnWidth; + } else { + additional = iconPartWidth; + } + int totalWidth =(int) (Math.max(itemWidth, minWidth) + additional); + + PopUpMenuArrayAdapter adapter = + new PopUpMenuArrayAdapter(ctx, R.layout.popup_menu_item, items, nightMode); + final ListPopupWindow listPopupWindow = new ListPopupWindow(ctx); + listPopupWindow.setAnchorView(anchorView); + listPopupWindow.setContentWidth((int) (totalWidth)); + listPopupWindow.setDropDownGravity(Gravity.START | Gravity.TOP); + listPopupWindow.setVerticalOffset(-anchorView.getHeight() + contentPaddingHalf); + listPopupWindow.setModal(true); + listPopupWindow.setAdapter(adapter); + listPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + if (listener != null) { + listener.onItemClick(parent, view, position, id); + } + listPopupWindow.dismiss(); + } + }); + return listPopupWindow; + } + + private int getDimensionPixelSize(Context ctx, int dimensionResId) { + return ctx.getResources().getDimensionPixelSize(dimensionResId); + } + + public enum PopUpMenuWidthType { + STANDARD, + AS_ANCHOR_VIEW + } + + public static class Builder { + private View anchorView; + private List items; + private AdapterView.OnItemClickListener listener; + private PopUpMenuWidthType widthType = PopUpMenuWidthType.AS_ANCHOR_VIEW; + private boolean nightMode; + + public Builder(View anchorView, List items, boolean nightMode) { + this.anchorView = anchorView; + this.items = items; + this.nightMode = nightMode; + } + + public Builder setListener(AdapterView.OnItemClickListener listener) { + this.listener = listener; + return this; + } + + public Builder setWidthType(@NonNull PopUpMenuWidthType widthType) { + this.widthType = widthType; + return this; + } + + public void show() { + if (listener == null) { + listener = new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + if (position < items.size()) { + View.OnClickListener listener = items.get(position).getOnClickListener(); + if (listener != null) { + listener.onClick(view); + } + } + } + }; + } + new PopUpMenuHelper(anchorView, items, widthType, listener, nightMode).show(); + } + } +} diff --git a/OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuItem.java b/OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuItem.java new file mode 100644 index 0000000000..4aa31c24fe --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/widgets/popup/PopUpMenuItem.java @@ -0,0 +1,100 @@ +package net.osmand.plus.widgets.popup; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.view.View; + +import androidx.annotation.ColorInt; + +public class PopUpMenuItem { + private CharSequence title; + private Drawable icon; + private View.OnClickListener onClickListener; + private boolean selected; + @ColorInt + private Integer compoundBtnColor; + + private PopUpMenuItem(CharSequence title, + Drawable icon, + View.OnClickListener onClickListener, + boolean selected, + Integer compoundBtnColor) { + this.title = title; + this.icon = icon; + this.onClickListener = onClickListener; + this.selected = selected; + this.compoundBtnColor = compoundBtnColor; + } + + public CharSequence getTitle() { + return title; + } + + public Drawable getIcon() { + return icon; + } + + public View.OnClickListener getOnClickListener() { + return onClickListener; + } + + public boolean isShowCompoundBtn() { + return compoundBtnColor != null; + } + + public Integer getCompoundBtnColor() { + return compoundBtnColor; + } + + public boolean isSelected() { + return selected; + } + + public static class Builder { + private Context ctx; + private CharSequence title; + private Drawable icon; + private View.OnClickListener onClickListener; + @ColorInt + private Integer compoundBtnColor; + private boolean selected; + + public Builder(Context ctx) { + this.ctx = ctx; + } + + public Builder setTitleId(int titleId) { + this.title = ctx.getString(titleId); + return this; + } + + public Builder setTitle(CharSequence title) { + this.title = title; + return this; + } + + public Builder setIcon(Drawable icon) { + this.icon = icon; + return this; + } + + public Builder setOnClickListener(View.OnClickListener onClickListener) { + this.onClickListener = onClickListener; + return this; + } + + public Builder showCompoundBtn(int compoundBtnColor) { + this.compoundBtnColor = compoundBtnColor; + return this; + } + + public Builder setSelected(boolean selected) { + this.selected = selected; + return this; + } + + public PopUpMenuItem create() { + return new PopUpMenuItem(title, icon, onClickListener, selected, compoundBtnColor); + } + } +} From c75e4e00a7f09020bf8889f51b70ddf7e8ff5cf4 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Sun, 13 Dec 2020 21:56:45 +0200 Subject: [PATCH 43/91] fix default ContextMenuItemsPreference --- .../plus/settings/backend/ContextMenuItemsPreference.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsPreference.java b/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsPreference.java index 12a83ea229..756142eaa8 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsPreference.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsPreference.java @@ -13,7 +13,7 @@ public class ContextMenuItemsPreference extends CommonPreference Date: Sun, 13 Dec 2020 23:17:47 +0200 Subject: [PATCH 44/91] UI Review: Import/Export items --- .../bottom_sheet_item_with_descr_and_checkbox_56dp.xml | 5 +++-- .../osmand/plus/settings/backend/ExportSettingsType.java | 4 ++-- .../settings/fragments/ImportedSettingsItemsAdapter.java | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) 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 65fc03610c..f4698e70dc 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 @@ -6,11 +6,12 @@ android:layout_height="wrap_content" android:background="?attr/selectableItemBackground" android:gravity="center_vertical" - android:minHeight="@dimen/bottom_sheet_selected_item_title_height" android:paddingLeft="@dimen/content_padding" android:paddingRight="@dimen/content_padding" android:paddingEnd="@dimen/content_padding" - android:paddingStart="@dimen/content_padding"> + android:paddingStart="@dimen/content_padding" + android:paddingTop="@dimen/context_menu_padding_margin_medium" + android:paddingBottom="@dimen/context_menu_padding_margin_medium"> Date: Sun, 13 Dec 2020 23:40:47 +0200 Subject: [PATCH 45/91] Base undeleted profile --- .../routepreparationmenu/RoutingOptionsHelper.java | 6 ------ .../plus/settings/backend/ApplicationMode.java | 14 ++++---------- .../plus/settings/backend/OsmandSettings.java | 6 ------ 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java index 31487d2ba7..d34144cbdc 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RoutingOptionsHelper.java @@ -1050,8 +1050,6 @@ public class RoutingOptionsHelper { BOAT(MuteSoundRoutingParameter.KEY), AIRCRAFT(MuteSoundRoutingParameter.KEY), SKI(MuteSoundRoutingParameter.KEY, DRIVING_STYLE, GeneralRouter.USE_HEIGHT_OBSTACLES), - TRUCK(MuteSoundRoutingParameter.KEY, AvoidRoadsRoutingParameter.KEY), - MOTORCYCLE(MuteSoundRoutingParameter.KEY, AvoidRoadsRoutingParameter.KEY), OTHER(MuteSoundRoutingParameter.KEY); List routingParameters; @@ -1080,10 +1078,6 @@ public class RoutingOptionsHelper { return PermanentAppModeOptions.AIRCRAFT.routingParameters; } else if (appMode.isDerivedRoutingFrom(ApplicationMode.SKI)) { return PermanentAppModeOptions.SKI.routingParameters; - } else if (appMode.isDerivedRoutingFrom(ApplicationMode.TRUCK)) { - return PermanentAppModeOptions.TRUCK.routingParameters; - } else if (appMode.isDerivedRoutingFrom(ApplicationMode.MOTORCYCLE)) { - return PermanentAppModeOptions.MOTORCYCLE.routingParameters; } else { return PermanentAppModeOptions.OTHER.routingParameters; } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java index 9a0a6920d9..923d7d6e26 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ApplicationMode.java @@ -58,7 +58,7 @@ public class ApplicationMode { private static StateChangedListener iconNameListener; private static OsmAndAppCustomization.OsmAndAppCustomizationListener customizationListener; - private static OsmandApplication app; + private OsmandApplication app; private final int keyName; private final String stringKey; @@ -108,11 +108,11 @@ public class ApplicationMode { .icon(R.drawable.ic_action_skiing) .description(R.string.base_profile_descr_ski).reg(); - public static final ApplicationMode TRUCK = createCustomBase(ApplicationMode.CAR, R.string.app_mode_truck, "truck", app) + public static final ApplicationMode TRUCK = create(ApplicationMode.CAR, R.string.app_mode_truck, "truck") .icon(R.drawable.ic_action_truck_dark) .description(R.string.app_mode_truck).reg(); - public static final ApplicationMode MOTORCYCLE = createCustomBase(ApplicationMode.CAR, R.string.app_mode_motorcycle, "motorcycle", app) + public static final ApplicationMode MOTORCYCLE = create(ApplicationMode.CAR, R.string.app_mode_motorcycle, "motorcycle") .icon(R.drawable.ic_action_motorcycle_dark) .description(R.string.app_mode_motorcycle).reg(); @@ -301,7 +301,7 @@ public class ApplicationMode { } public boolean isCustomProfile() { - return parentAppMode != null; + return !defaultValues.contains(this); } public boolean isDerivedRoutingFrom(ApplicationMode mode) { @@ -678,12 +678,6 @@ public class ApplicationMode { return builder; } - public static ApplicationModeBuilder createCustomBase(ApplicationMode parent, int key, String stringKey, OsmandApplication app) { - ApplicationModeBuilder builder = create(parent, key, stringKey); - builder.getApplicationMode().app = app; - return builder; - } - public static class ApplicationModeBuilder { private ApplicationMode applicationMode; diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index 2893a2dae0..af94a5a2d8 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -976,8 +976,6 @@ public class OsmandSettings { ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.BOAT, "boat"); ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.AIRCRAFT, "STRAIGHT_LINE_MODE"); ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.SKI, "ski"); - ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.TRUCK, "truck"); - ROUTING_PROFILE.setModeDefaultValue(ApplicationMode.MOTORCYCLE, "motorcycle"); } public final CommonPreference ROUTE_SERVICE = new EnumStringPreference<>(this, "route_service", RouteService.OSMAND, RouteService.values()).makeProfile().cache(); @@ -996,8 +994,6 @@ public class OsmandSettings { NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.BOAT, NavigationIcon.NAUTICAL); NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.AIRCRAFT, NavigationIcon.DEFAULT); NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.SKI, NavigationIcon.DEFAULT); - NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.TRUCK,NavigationIcon.DEFAULT); - NAVIGATION_ICON.setModeDefaultValue(ApplicationMode.MOTORCYCLE,NavigationIcon.DEFAULT); } public final CommonPreference LOCATION_ICON = new EnumStringPreference<>(this, "location_icon", LocationIcon.DEFAULT, LocationIcon.values()).makeProfile().cache(); @@ -1009,8 +1005,6 @@ public class OsmandSettings { LOCATION_ICON.setModeDefaultValue(ApplicationMode.BOAT, LocationIcon.DEFAULT); LOCATION_ICON.setModeDefaultValue(ApplicationMode.AIRCRAFT, LocationIcon.CAR); LOCATION_ICON.setModeDefaultValue(ApplicationMode.SKI, LocationIcon.BICYCLE); - LOCATION_ICON.setModeDefaultValue(ApplicationMode.TRUCK, LocationIcon.CAR); - LOCATION_ICON.setModeDefaultValue(ApplicationMode.MOTORCYCLE, LocationIcon.CAR); } public final CommonPreference APP_MODE_ORDER = new IntPreference(this, "app_mode_order", 0).makeProfile().cache(); From 0855c217179f9d027d19ee1cf4d4aec3ac8eeaa0 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Mon, 14 Dec 2020 00:14:33 +0200 Subject: [PATCH 46/91] Import: show quantity of items on the second line "None > 0/10" --- .../plus/settings/fragments/BaseSettingsListFragment.java | 2 +- .../plus/settings/fragments/ExportSettingsAdapter.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsListFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsListFragment.java index 86b7389f6e..70cc3e95e0 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsListFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/BaseSettingsListFragment.java @@ -126,7 +126,7 @@ public abstract class BaseSettingsListFragment extends BaseOsmAndFragment implem } }); - adapter = new ExportSettingsAdapter(app, this, nightMode); + adapter = new ExportSettingsAdapter(app, exportMode, this, nightMode); adapter.updateSettingsItems(dataList, selectedItemsMap); expandableList.setAdapter(adapter); updateAvailableSpace(); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java index 1eec036171..94816dbc1c 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java @@ -43,6 +43,7 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { private final OsmandApplication app; private final UiUtilities uiUtilities; + private final boolean exportMode; private List itemsTypes; private Map> selectedItemsMap; @@ -59,8 +60,9 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { private final int childViewHeight; private final int listBottomPadding; - ExportSettingsAdapter(OsmandApplication app, OnItemSelectedListener listener, boolean nightMode) { + ExportSettingsAdapter(OsmandApplication app, boolean exportMode, OnItemSelectedListener listener, boolean nightMode) { this.app = app; + this.exportMode = exportMode; this.listener = listener; this.nightMode = nightMode; uiUtilities = app.getUIUtilities(); @@ -279,7 +281,7 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { } } String description; - if (selectedTypes == 0) { + if (selectedTypes == 0 && exportMode) { description = app.getString(R.string.shared_string_none); } else if (selectedTypes == items.getTypes().size()) { description = app.getString(R.string.shared_string_all); From 064ee57ba8a9bdd170e48451b25677f43b1752d6 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Sun, 13 Dec 2020 21:57:27 +0000 Subject: [PATCH 47/91] Translated using Weblate (French) Currently translated at 99.8% (3573 of 3579 strings) --- OsmAnd/res/values-fr/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index bdefc1c27a..8f482cd140 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -1934,7 +1934,7 @@ Annoncer uniquement lorsque la direction de la destination est modifiée. Fréquence des annonces Durée minimum entre deux annonces. - Aucune destination définie + Greffon d\'accessibilité : Aucune destination n\'est définie Cap magnétique Cap relatif Ne pas recalculer l\'itinéraire après l\'avoir quitté @@ -3770,7 +3770,7 @@ Patins à roulettes en ligne Zoomer avec les boutons de volume Contrôler le niveau de zoom de la carte avec les boutons de réglage du volume sonore. - Le prochain point sur la route va être supprimé. S\'il s\'agit de la destination finale, la navigation s\'arrêtera. + Supprime la prochaine étape de votre route. S\'il s\'agit de la destination finale, la navigation s\'arrêtera. Indiquez la longueur de votre véhicule, certaines restrictions d\'itinéraire peuvent s\'appliquer aux véhicules longs. Supprimer le prochain point Merci de renseigner un nom pour le point From 53f5d655fd1f8cb4d3a212da1e16b4811aaf9df2 Mon Sep 17 00:00:00 2001 From: Michel GERDAY Date: Sun, 13 Dec 2020 17:30:13 +0000 Subject: [PATCH 48/91] Translated using Weblate (French) Currently translated at 99.8% (3573 of 3579 strings) --- OsmAnd/res/values-fr/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 8f482cd140..cc4f1eb7f8 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -3408,7 +3408,7 @@ Nom d\'utilisateur et mot de passe Les paramètres de ce greffon sont globaux et s\'appliquent à tous les profils Édition OSM - Vous pouvez consulter vos modifications et vos bugs OSM non envoyés dans %1$s. Les points téléversés ne sont plus affichés dans OsmAnd. + Consultez vos modifications et vos bugs OSM non encore envoyés dans %1$s. Les modifications téléversées ne seront plus affichées dans OsmAnd. OSM Icône affiché pendant la navigation ou en déplacement. Icône affiché à l\'arrêt. @@ -3940,7 +3940,7 @@ Historique des marqueurs Envoyer un fichier GPX vers OpenStreetMap Saisissez les étiquettes séparées par des virgules. - Il y a un problème avec votre abonnement. Tapez sur le bouton pour accéder aux paramètres de l\'abonnement Google Play et corriger votre mode de paiement. + Appuyez sur le bouton pour configurer un mode de paiement sur Google Play pour résoudre le problème de votre abonnement. Commenter la note OSM Fermer la note OSM Ajouter une photo From b504763c35e20177b2f19f56a282f4a3de760f12 Mon Sep 17 00:00:00 2001 From: Artem Date: Sun, 13 Dec 2020 22:29:02 +0000 Subject: [PATCH 49/91] Translated using Weblate (Russian) Currently translated at 99.2% (3552 of 3579 strings) --- OsmAnd/res/values-ru/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 3396ca32d1..8ca4200ddd 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3996,4 +3996,7 @@ Немецкий (повседневный) Легкий самолет Добавить новый сегмент + Объединить сегменты + Разделить до + Разделить после \ No newline at end of file From 03030377cb9169c07bfe5646f55370ef3bb35cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Sun, 13 Dec 2020 19:45:18 +0000 Subject: [PATCH 50/91] Translated using Weblate (Turkish) Currently translated at 100.0% (3579 of 3579 strings) --- OsmAnd/res/values-tr/strings.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index 5e32ddb818..861cfc3d9c 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -1920,7 +1920,7 @@ Üst menü Güzergahı yeniden hesapla Rapor - Hedef ayarlanmadı + Erişilebilirlik eklentisi: Hedef belirlenmedi Rota terkedildiğinde yeniden hesaplanmasın Rotadan çıkıldıktan sonra rota yeniden hesaplanmaz. Aksi yönde iken rota yeniden-hesaplanmasın @@ -1997,7 +1997,7 @@ Hiçbir şey bulunamadı Arama sorgusunu değiştir veya yarıçapını arttır. Sık Kullanılanlarda ara - Dikey gölgelendirmeyi göstermek için \'Hillshade Overlay\' haritasını indirin. + Dikey gölgelendirmeyi göstermek için \'Tepe gölgesi\' üst katman haritasını indirin. Kademeli dikey alanları göstermek için \'Eş yükselti eğrileri\' eklentisini yükleyin. Yakınlaştırma seviyesinden başlayarak gizle Bu bölgede kullanmak için \'Eş yükselti eğrisi\' haritasını indirin. @@ -2849,7 +2849,7 @@ Wikivoyage üzerindeki herhangi bir makaleyi düzenleyebilirsiniz. Bilgi, deneyim, yetenek ve dikkatinizi paylaşın. Düzenlemeye başla Açık betaya hoş geldiniz - Eş yükselti eğrileri ve Tepe gölgeleri haritaları + Eş yükselti eğrileri ve tepe gölgeleri haritaları Ücretli uygulama Ücretli eklenti Popüler yerler @@ -3384,7 +3384,7 @@ Kullanıcı adı ve parola Bu eklenti ayarları geneldir ve tüm profiller için geçerlidir OSM düzenleme - Henüz karşıya yüklenmemiş tüm düzenlemelerinizi veya OSM hatalarınızı %1$s\'de görüntüleyebilirsiniz. Karşıya yüklenen noktalar OsmAnd\'da gösterilmez. + Henüz karşıya yüklenmemiş tüm düzenlemelerinizi veya OSM hatalarınızı %1$s\'de görüntüleyin. Zaten yüklenen değişiklikler artık gösterilmeyecek. OSM Navigasyon sırasında veya harekete halindeyken gösterilen simge. Dinlenme anında gösterilen simge. @@ -3745,14 +3745,14 @@ Paten Rotalarda izin verilecek araç uzunluğunu belirtin. Uzunluk sınırı - Güzergahdaki geçerli hedef noktası silinecektir. Eğer bu varış noktası olacaksa, navigasyon duracaktır. + Güzergahınızdaki bir sonraki hedefi siler. Bu son hedefse, navigasyon duracaktır. Lütfen nokta için bir ad belirtin Aracınızın uzunluğunu belirtin, uzun araçlar için bazı güzergah kısıtlamaları geçerli olabilir. En yakın varış noktasını sil Harita yakınlaştırma seviyesini cihaz ses seviyesi düğmelerini kullanarak denetleyin. Yakınlaştırma için ses seviyesi düğmeleri Wikipedia haritalarını indir - Wikipedia\'dan ilgi çekici yerler hakkında bilgi alın. Bu sizin çevrim dışı cep rehberinizdir - sadece Wikipedia eklentisini etkinleştirin ve etrafınızdaki nesneler hakkında makalelerin tadını çıkarın. + Yerler ve varış noktaları hakkında makaleler içeren çevrim dışı cep kılavuzu Wikipedia\'dan ilgi çekici noktalar hakkında bilgi alın. Enduro motosiklet Küçük motosiklet Tekerlekli sandalye @@ -3790,7 +3790,7 @@ Navigasyon profili Kendisine yeni bir bölümün ekleneceği bir yol dosyası seçin. Sokak seviyesi görüntüleri - Planlanan güzergahtaki tüm değişiklikleri kapatarak atmak istediğinizden emin misiniz\? + Planlanan güzergahtaki tüm değişiklikleri atmak istediğinizden emin misiniz\? Ters yön durumunda REC Kaydedilen yolu aç @@ -3810,7 +3810,7 @@ Seyahat kaydetme Yol dosyası olarak kaydet %s yol dosyası seçildi - (Son uygulamalar aracılığıyla) uygulama kapatıldığında yol kaydını duraklatacaktır. (OsmAnd arka plan göstergesi Android bildirim çubuğundan kaybolur.) + Yol kaydı, uygulama (son uygulamalar aracılığıyla) kapatıldığında duraklatılacaktır. (OsmAnd arka plan göstergesi Android bildirim çubuğundan kaybolur.) Genel yol kaydı için kayıt aralığını belirtin (haritadaki \'Seyahat kaydetme\' widget\'ı aracılığıyla açıldı). Seyahat kaydetmeyi duraklat Seyahat kaydetmeyi devam ettir @@ -3862,11 +3862,11 @@ Başlangıç ve bitiş simgeleri \'Eş yükselti eğrileri\'ni satın aldığınız için teşekkürler Abonelik seçilen dönem başına ücretlendirilir. İstediğiniz zaman AppGallery\'den iptal edin. - Ödeme, satın alma onaylandığında AppGallery hesabınızdan alınacaktır. + Satın alma onayının ardından AppGallery hesabınızdan ücret alınır. \n -\nYenileme tarihinden önce iptal edilmedikçe abonelik otomatik olarak yenilenir. Hesabınızdan yenileme süresi (ay/üç ay/yıl) için yalnızca yenileme tarihinde ücret alınacaktır. +\nYenileme tarihinden önce iptal edilmediği sürece abonelik otomatik olarak uzatılır. Hesabınızdan yenileme süresi (ay/üç ay/yıl) için yalnızca yenileme tarihinde ücret alınacaktır. \n -\n AppGallery ayarlarınıza giderek aboneliklerinizi yönetebilir ve iptal edebilirsiniz. +\n AppGallery ayarlarınızda aboneliklerinizi yönetebilir ve iptal edebilirsiniz. Yaya yollarından kaçın Yaya yollarından kaçın Geliştirme @@ -3912,7 +3912,7 @@ Giriş bilgisi Hesap Aboneliği yönet - Aboneliğinizle ilgili bir sorun var. Ödeme yönteminizi düzeltmek üzere Google Play abonelik ayarlarına gitmek için düğmeye dokunun. + Aboneliğinizi düzeltmek üzere Google Play\'de bir ödeme yöntemi ayarlamak için düğmeye dokunun. OsmAnd Live aboneliğinin süresi doldu OsmAnd Live aboneliği duraklatıldı OsmAnd Live aboneliği beklemede From cb1c6af5758d0d099bdcf45a569ce10177f99ca9 Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Sun, 13 Dec 2020 19:32:02 +0000 Subject: [PATCH 51/91] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3579 of 3579 strings) --- OsmAnd/res/values-uk/strings.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index 4e6414e468..9ac26b675a 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -1897,7 +1897,7 @@ Звіт Увімкнути навігацію з урахуванням автооновлень OsmAnd Live. Навігація OsmAnd Live - Пункт призначення не заданий + Втулок доступності: призначення не встановлено Магнітний пеленг Курсовий кут Не перераховувати маршрут при сході з нього @@ -2230,7 +2230,7 @@ Натискання на кнопку дії покаже чи приховає OSM-нотатки на мапі. Відсортоване за відстанню Пошук у закладках - Для того, щоб відобразити затінення рельєфу, потрібно завантажити спеціальну мапу для цієї області. + Завантажте шар мапи «Пагорби», щоб показати вертикальне затінення. Щоб побачити рельєф місцевості на мапі, вам потрібно придбати та встановити втулок \'Горизонталі\' (\'Contour Lines\'). Приховати від рівня масштабування Завантажте мапу \'Горизонталі\' (\'Contour Line\') для використання у цій області. @@ -2750,7 +2750,7 @@ Вікімандри в автономному режимі Необмежені завантаження Вікіпедія в автономному режимі - Горизонталі і Мапи рельєфу місцевості + Горизонталі і мапи рельєфу місцевості Розблокувати усі можливості OsmAnd Оберіть план Придбайте одне з наведеного нижче, щоб отримати функціональність автономного туристичного путівника: @@ -3427,7 +3427,7 @@ Ім\'я користувача і пароль Ці налаштування втулка стосуються всіх профілів OSM-правлення - Ви можете переглянути всі ще не вивантажені зміни або вади OSM у %1$s. Вивантажені точки не показано в OsmAnd. + Перегляньте всі свої ще не завантажені зміни чи помилки OSM у %1$s. Вже завантажені зміни більше не показуватимуться. OSM Значок відображається під час навігації чи переміщення. Значок показано в спокої. @@ -3791,9 +3791,9 @@ Вкажіть довжину вашого автомобіля, для довгих транспортних засобів можуть застосовуватися деякі обмеження на маршрутах. Видалити найближчу точку призначення Вкажіть назву пункту - Поточну точку призначення на маршруті буде видалено. Якщо це буде місце призначення, навігація припиниться. + Видаляє наступний пункт призначення з маршруту. Якщо це кінцевий пункт призначення, навігація зупиниться. Завантажити мапи Вікіпедії - Отримайте відомості про визначні місця у Вікіпедії. Це ваш автономний кишеньковий посібник - просто ввімкніть втулок \"Вікіпедія\" і насолоджуйтеся статтями про об\'єкти довкола вас. + Отримайте відомості про визначні місця з Вікіпедії, кишенькового автономного путівника, що містить статті про місця та пункти призначення. Моторолер Спортивний мотоцикл Інвалідне крісло @@ -3831,7 +3831,7 @@ Лише наступний сегмент буде перераховано за допомогою обраного профілю. Виберіть спосіб з\'єднання точок: прямою лінією чи обчислити маршрут між ними за, як зазначено далі. Зображення вулиць - Ви дійсно бажаєте відхилити всі зміни у запланованому маршруті, закривши його\? + Ви дійсно бажаєте відхилити всі зміни у запланованому маршруті\? Для зворотного напрямку Зберегти як новий файл треку Додати у файл треку @@ -3903,12 +3903,12 @@ Піктограми початку та завершення Дякуємо за придбання «Горизонталей» Що нового - Передплата стягується за вибраний період. Скасуйте її в AppGallery у будь-який час. - Оплату буде стягнено з вашого рахунку AppGallery за підтвердження покупки. + Передплата стягується раз на вибраний період. Скасуйте її в AppGallery у будь-який час. + З вашого рахунку AppGallery буде стягнено плату за підтвердження покупки. \n -\nПередплата автоматично поновлюється, якщо її скасувати до дати поновлення. З вашого рахунку буде стягнено плату за період поновлення (місяць/три місяці/рік) лише на дату поновлення. +\nПередплата автоматично поновлюється, якщо її не скасувати до дати поновлення. З вашого рахунку буде стягнено плату за період поновлення (місяць/три місяці/рік) лише на дату поновлення. \n -\nВи можете керувати та скасовувати передплати, переходячи до налаштувань AppGallery. +\nВи можете керувати та скасовувати передплати у налаштуваннях AppGallery. OsmAnd дані в реальному часі Комплексна маршрутизація Двофазна маршрутизація для автомобільної навігації. @@ -3945,7 +3945,7 @@ OsmAnd використовує MGRS, який подібний формату UTM NATO. Додайте принаймні дві точки Керувати передплатою - Виникла проблема з передплатою. Торкнітся кнопки, щоб перейти до налаштувань передплати у Google Play, щоб виправити спосіб оплати. + Торкніться кнопки, щоб налаштувати спосіб оплати в Google Play для виправлення передплати. Термін дії передплати OsmAnd Live закінчився Передплату OsmAnd Live зупинено Передплата OsmAnd Live на утриманні From 7cf4618721028abb19e8f15b0b2e69efc2b9259d Mon Sep 17 00:00:00 2001 From: jan madsen Date: Sun, 13 Dec 2020 19:23:52 +0000 Subject: [PATCH 52/91] Translated using Weblate (Danish) Currently translated at 93.0% (3329 of 3579 strings) --- OsmAnd/res/values-da/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 15b39592a9..ae3dc5adaf 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -3869,4 +3869,8 @@ Til kørsel med snescooter med dedikerede veje og spor. MGRS OsmAnd bruger MGRS, som svarer til UTM NATO-formatet. + Forbind segmenter + Opdel før + Opdel efter + Tilføj et nyt segment \ No newline at end of file From 261b4d224d39b161e80c4486fc96695b2250bb70 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Sun, 13 Dec 2020 21:02:27 +0000 Subject: [PATCH 53/91] Translated using Weblate (Slovak) Currently translated at 100.0% (3579 of 3579 strings) --- OsmAnd/res/values-sk/strings.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 18be2fb0ec..3a606aac2e 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -1947,7 +1947,7 @@ Oznamovať len ak sa smer k cieľu zmení. Interval šikovného oznamovania Minimálny čas medzi oznamami. - Cieľ nie je určený + Modul uľahčenia prístupu: Cieľ nie je určený Magnetické smerovanie Povoliť navigácii použiť zmeny z OsmAnd Live. Navigácia OsmAnd Live @@ -2389,7 +2389,7 @@ Priblíženie zobrazenia: %1$s Pre veľké vzdialenosti: Ak sa nenájde výsledok do 10 minút, vložte prosím tranzitné ciele. Názov obsahuje príliš veľa veľkých písmen. Pokračovať? - Pre zobrazenie tieňovaných svahov si stiahnite prekrývaciu mapu tieňovaných svahov (Hillshade). + Pre zobrazenie tieňovaných svahov si stiahnite prekrývaciu mapu \"tieňovaných svahov\" (Hillshade). Pre zobrazenie výškových stupňov si musíte nainštalovať zásuvný modul \"Vrstevnice\". Skryť od úrovne priblíženia Zásuvný modul @@ -2755,7 +2755,7 @@ Wikivoyage offline Neobmedzené sťahovania Wikipédia offline - Vrstevnice & Tieňované svahy + Vrstevnice & tieňované svahy Odomknite všetky funkcie OsmAnd Stiahnite články Wikipédie pre %1$s pre ich čítanie offline. Stiahnuť údaje Wikipédie @@ -3427,7 +3427,7 @@ Prihlasovacie meno a heslo Tieto nastavenia sú globálne a platia pre všetky profily OSM upravovanie - Môžete zobraziť vaše ešte neodoslané zmeny alebo chyby v OSM cez %1$s. Odoslané body sa už v OsmAnd nezobrazujú. + Zobrazte vaše ešte neodoslané zmeny alebo chyby v OSM cez %1$s. Odoslané zmeny sa už v OsmAnd nezobrazujú. OSM Ikona zobrazená pri navigácii alebo pohybe. Ikona zobrazená v pokoji. @@ -3794,9 +3794,9 @@ Zadajte dĺžku vášho vozidla, pretože na trase môžu byť obmedzenia pre dlhé vozidlá. Vymazať najbližší cieľový bod Prosím zadajte názov pre bod - Aktuálny cieľový bod na trase bude vymazaný. Ak je to posledný cieľ, navigácia sa zastaví. + Vymaže nasledujúci cieľ vašej trasy. Ak je to posledný cieľ, navigácia sa zastaví. Stiahnuť mapy Wikipédia - Získajte informácie o bodoch záujmu z Wikipédie. Je to váš vreckový sprievodca - zapnite modul Wikipédia a užívajte si články o objektoch okolo vás. + Získajte informácie o bodoch záujmu z Wikipédie, vreckového sprievodcu obsahujúceho články o miestach a cieľoch. Enduro motorka Skúter Invalidný vozík @@ -3834,7 +3834,7 @@ Navigačný profil Zvoľte súbor stopy, pre ktorú bude pridaný nový úsek. Snímky z úrovne ulice - Naozaj chcete zahodiť všetky zmeny v plánovanej trasy jej zatvorením\? + Naozaj chcete zahodiť všetky zmeny v plánovanej trase\? V prípade opačného smeru Trasa zo stopy Pridať prechodný bod stopy @@ -3879,7 +3879,7 @@ Všetky predchádzajúce úseky budú prepočítané pomocou zvoleného profilu. Otvoriť uloženú stopu je uložený - Zastaví záznam stopy, keď je aplikácia ukončená (cez nedávne aplikácie). (Ikona režimu na pozadí zmizne z notifikačnej oblasti Androidu.) + Záznam stopy bude pozastavený, keď je aplikácia ukončená (cez nedávne aplikácie). (Ikona režimu na pozadí zmizne z notifikačnej oblasti Androidu.) %s vybraných súborov stôp Zadaj interval pre všeobecné zaznamenávanie výletu (zapínané cez tlačidlo Záznamu výletu na mape). Pozastaviť nahrávanie výletu @@ -3909,7 +3909,7 @@ Predplatné bude spoplatnené v zvolenom intervale. Predplatné zrušte kedykoľvek na AppGallery. Platba bude stiahnutá z vášho účtu AppGallery po potvrdení nákupu. \n -\nPredplatné sa automaticky obnovuje, ak nie je zrušené pred dátumom jeho obnovenia. Ďalšia platba za obdobie predplatného (mesiac/štvrťrok/rok) bude stiahnutá v deň obnovenia. +\nPredplatné sa automaticky predlžuje, pokiaľ ho nezrušíte pred dátumom jeho obnovenia. Ďalšia platba za obdobie predplatného (mesiac/štvrťrok/rok) bude stiahnutá v deň obnovenia. \n \n Vaše predplatné môžete spravovať a zrušiť v nastaveniach AppGallery. Vyhnúť sa chodníkom pre chodcov @@ -3949,7 +3949,7 @@ OsmAnd používa MGSR, ktorý je podobný ako formát UTM NATO. Musíte pridať aspoň dva body Spravovať predplatné - S vašim predplatným je problém. Stlačte tlačidlo pre prechod do nastavení predplatného v Google Play a opravte váš spôsob platby. + Pre opravu vášho predplatného stlačte tlačidlo pre nastavenie spôsobu platby v Google Play. Predplatné OsmAnd Live skončilo Predplatné OsmAnd Live je pozastavené Predplatné OsmAnd Live je zablokované From fbffd2ceb3dd80474e33b499651dc6b6d8753010 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Sun, 13 Dec 2020 18:49:36 +0000 Subject: [PATCH 54/91] Translated using Weblate (Hebrew) Currently translated at 99.7% (3569 of 3579 strings) --- OsmAnd/res/values-iw/strings.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml index 11e9b04250..fdcadfd9f0 100644 --- a/OsmAnd/res/values-iw/strings.xml +++ b/OsmAnd/res/values-iw/strings.xml @@ -1339,7 +1339,7 @@ הקבוצה תוסר לאחר ההפעלה הבאה של היישומון. הצגת קווי כיוון ניווט חי של OsmAnd - לא הוגדר יעד + תוסף נגישות: לא הוגדר יעד וידג׳טים להוסיף את כל הנקודות כסמני מפה? הוספת לסמני מפה @@ -1728,7 +1728,7 @@ הצגה על המפה לאחר השמירה עיון במפה והוספת נקודות מדידת מרחק - יש להוריד את מפת ‚שכבת ההצללות’ כדי להציג הצללה אנכית. + יש להוריד את מפת שכבת ‚הצללות’ כדי להציג הצללה אנכית. יש להתקין את התוסף ‚קווי מתאר’ (Contour lines) כדי להציג אזורים מדורגים אנכית. הסתרה החל מרמת תקריב נא להוריד את מפת ‚קווי המתאר’ של האזור הזה. @@ -3840,7 +3840,7 @@ נא לבחור כיצד לחבר את הנקודות, בקו ישר, או לחבר מסלול ביניהן כפי שצוין להלן. בשלב הבא עליך להצמיד את הדרך המורשית הקרובה ביותר לאחד מפרופילי הניווט שלך כדי להשתמש באפשרות הזו. תמונות ברמת רחוב - להתעלם מהשינויים במסלול המתוכנן על ידי סגירתו\? + להתעלם מכל השינויים במסלול המתוכנן על ידי סגירתו\? במקרה של כיוון הפוך שמירה כקובץ מסלול חדש הוספה לקובץ מסלול @@ -3934,10 +3934,10 @@ הקובץ כבר ייובא אל OsmAnd להשתמש באלגוריתם חישוב מסלול דו־שלבי A*‎ לנהיגה ברכבי שלג עם דרכים ומסלולים יעודיים. - הנתונים של %1$s זמינים בדרכים בלבד, עליך לחשב מסלול באמצעות „מסלול בין נקודות” כדי לקבל אותם. + הנתונים של %1$s זמינים על דרכים בלבד, ניתן לחשב מסלול באמצעות „מסלול בין נקודות” כדי לראות תרשימים. תרשים - "נא להמתין. -\nהתרשים יהיה זמין לאחר חישוב מחדש." + נא להמתין. +\nהתרשים יהיה זמין לאחר חישוב מחדש. %1$s ‏— %2$s מפות מקומיות שירות לציבור @@ -3964,7 +3964,7 @@ עליך להיכנס כדי להעלות שינויים חדשים או כאלו שנערכו. \n \nניתן להיכנס בשיטת OAuth המאובטחת או באמצעות שם הכניסה והססמה שלך. - יש בעיה עם המינוי שלך. יש לגעת כפתור כדי לגשת להגדרות המינוי של Google Play ולתקן את שיטת התשלום שלך. + יש לגעת בכפתור כדי להגדיר שיטת תשלום ב־Google Play ולתקן את המינוי שלך. המינוי ל־OsmAnd Live מוחזק היסטוריית סמנים שליחת קובץ GPX ל־OpenStreetMap From 2ce30a6f8778125b4044186b615bd8d4a16e80f3 Mon Sep 17 00:00:00 2001 From: Softmap Date: Sun, 13 Dec 2020 20:50:20 +0000 Subject: [PATCH 55/91] Translated using Weblate (Arabic) Currently translated at 99.7% (3571 of 3579 strings) --- OsmAnd/res/values-ar/strings.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index efabca7144..aca416ed50 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3419,7 +3419,7 @@ اعراض جانبية: سيفقد المسار الخاص بك جميع الأقسام التي لم يتحقق فيها معيار الحد الأدنى للسرعة (على سبيل المثال ، حيث تدفع دراجتك أعلى تل شديد الانحدار). أيضا ، لن تكون هناك معلومات حول فترات الراحة ، مثل الاستراحات. هذا له تأثيرات على أي تحليل أو مرحلة ما بعد المعالجة ، مثل عند محاولة تحديد المدة الإجمالية لرحلتك ، أو وقت الحركة ، أو متوسط سرعتك. المسارات المسجلة الخاصة بك هي في %1$s، أو مجلد أوسماند. ملاحظات OSM موجودة في%1$s. - يمكنك عرض جميع التعديلات التي لم يتم رفعها بعد أو أخطاء OSM في %1$s. النقاط التي تم رفعها لا تظهر في OsmAnd. + عرض كل التعديلات التي لم يتم تحميلها أو أخطاء OSM في %1$s. التغييرات التي تم رفعها فعلا لن تظهر بعد الآن. مرشح قطع سرعة منخفضة لعدم تسجيل نقاط أقل من سرعة معينة. وهذا قد يجعل المسارات المسجلة تبدو أكثر سلاسة عند عرضها على الخريطة. التوصية: حاول استخدام كشف الحركة عبر مرشح الحد الأدنى للإزاحة للتسجيل (B) أولاً ، فقد ينتج عنه نتائج أفضل ، ويستهلك بيانات أقل. إذا استمرت المسارات الخاصة بك مزعجة عند السرعات المنخفضة ، فجرب القيم غير الصفرية هنا. يرجى ملاحظة أن بعض القياسات قد لا تبلغ عن أي قيمة سرعة على الإطلاق (بعض الطرق المستندة إلى الشبكة) ، وفي هذه الحالة لن تسجل أي شيء. ملاحظة: سرعة > 0 الاختيار: معظم شرائح GPS تبلغ عن قيمة السرعة فقط إذا كانت الخوارزمية تحدد الحركة أوالسكون. وبالتالي باستخدام إعدادات> 0 في هذا المرشح يتم كشف عن الحركة من شرائح GPS. ولكن حتى لو لم تتم تصفيتها هنا في وقت التسجيل ، فإننا لا نزال نستخدم هذه الميزة في تحليل GPX لتحديد المسافة المصححة ، أي أن القيمة المعروضة في هذا الحقل هي المسافة المسجلة أثناء الحركة. @@ -3893,12 +3893,12 @@ الاسم: أ – ي أيقونات البدء والانتهاء شكرا لشرائك \"خطوط الكنتور\" - رسوم الاشتراك ستفرض كل شهر. يمكنك إلغاء اشتراكك متى أردت عبر Google play. - سيتم تحصيل المبلغ على حساب AppGallery الخاص بك عند تأكيد الشراء. + يتم احتساب الاشتراك للفترة المحددة. قم بإلغائه في AppGallery في أي وقت تريد. + يتم الخصم من حساب AppGallery الخاص بك عند تأكيد الشراء. \n -\nيتم تجديد الاشتراك تلقائيًا ما لم يتم إلغاؤه قبل تاريخ التجديد. سيتم خصم حسابك على فترة التجديد (شهر/ثلاثة أشهر/سنة) فقط في تاريخ التجديد. +\nيتم تمديد الاشتراك تلقائيًا ما لم يتم إلغاؤه قبل تاريخ التجديد. سيتم الخصم من الحساب على فترة التجديد (شهر/ ثلاثة أشهر/ سنة) فقط عند تاريخ التجديد. \n -\nيمكنك إدارة وإلغاء الاشتراكات الخاصة بك عن طريق الانتقال إلى إعدادات AppGallery. +\nيمكنك إدارة وإلغاء الاشتراكات الخاصة بك في إعدادات AppGallery. تجنب الممرات تجنب الممرات ما الجديد @@ -3936,7 +3936,7 @@ OsmAnd يستخدم MGRS، وهو مشابه لتنسيق UTM NATO . تحتاج إلى إضافة نقطتين على الأقل إدارة الاشتراك - هناك مشكلة في اشتراكك. انتقل إلى إعدادات اشتراك Google Play لإصلاح طريقة الدفع الخاصة بك. + اضغط على الزر لإعداد طريقة دفع على Google Play لإصلاح اشتراكك. انتهت صلاحية اشتراك OsmAnd Live تم إيقاف اشتراك OsmAnd Live مؤقتًا اشتراك OsmAnd Live معلق From 511cde1cf751ffcf89a7c7808737ba2e98f43127 Mon Sep 17 00:00:00 2001 From: ovl-1 Date: Sun, 13 Dec 2020 22:30:46 +0000 Subject: [PATCH 56/91] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 54.5% (1954 of 3579 strings) --- OsmAnd/res/values-nb/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 43ca608125..229c2c33d8 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -2272,7 +2272,7 @@ La stå tomt for å bruke adressen eller stedsnavnet. Denne meldingen inkluderes i kommentarfeltet. Bilder fra Mapillary er kun tilgjengelig når tilkoblet internett. - Last ned kart for \'Relieffskyggeoverlegg\' for å vise vertikal skyggelegging. + Last ned overleggskartet for \'Relieffskygge\' for å vise vertikal skyggelegging. Installer programtillegget \'Koter\' for å vise graderte vertikale områder. Oppfør nytt navn Tilbake @@ -3840,7 +3840,7 @@ Hvis «%1$s» er på, vil aktivitetstiden avhenge av den. Angi kjøretøylengde som tillates på rutene. Lengdebegrensning - Er du sikker på at du ønsker å forkaste alle endringer i planlagt rute ved å lukke den\? + Er du sikker på at du vil forkaste alle endringer i den planlagte ruten\? Naviger fra min posisjon til sporet Innebygd utvikling for offentlig transport Bytt til Java (sikker) ruteberegning for offentlig transport @@ -3895,7 +3895,7 @@ Send GPX-fil til OpenStreetMap Fasilitet Markørhistorikk - Pauser spor-logging når programmet drepes (via nylige programmer). (OsmAnd-bakgrunnsindikatoren forsvinner fra Android-merknadsfeltet.) + Sporlogging vil settes i pausemodus når appen blir avsluttet (via nylige apper). (OsmAnd-bakgrunnsindikasjonen forsvinner fra Android-varslingslinjen.) START Lukk OSM-notat Kommenter OSM-notat From 24cbec2edb807e9ac2d01b6909390d158b41b87b Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Sun, 13 Dec 2020 18:05:09 +0000 Subject: [PATCH 57/91] Translated using Weblate (Sardinian) Currently translated at 99.7% (3570 of 3579 strings) --- OsmAnd/res/values-sc/strings.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index b91b31f4f3..68e3956fb4 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -1944,7 +1944,7 @@ Sighi·nos Allughe sa navigatzione OsmAnd Live cun sas mòdìficas in tempus reale. Navigatzione OsmAnd Live - Destinatzione non definida + Estensione pro s\'atzessibilidade: Destinatzione non definida Bùssola magnètica Bùssola relativa Non torres a carculare s\'àndala si ses essidu dae su caminu @@ -3431,7 +3431,7 @@ Nùmene impreadore e crae Custas impostatziones de s\'estensione sunt globales, e s\'àplicant a totu sos profilos Modìfica de OSM - Podes pompiare totu sas modìficas o sas sinnalatziones de errores de OSM tuos galu non carrigados in %1$s. Sos puntos carrigados no ant a èssere ammustrados in OsmAnd. + Pòmpia totu sas modìficas o sas sinnalatziones de errores de OSM tuos galu non carrigados in %1$s. Sas modìficas giai carrigadas no ant a èssere prus ammustradas. OSM Icona ammustrada durante sa navigatzione o su movimentu ebbia. Icona ammustrada in pàusa. @@ -3794,9 +3794,9 @@ Inserta sa longària de su veìculu tuo. Bi diant pòdere èssere unas cantas restritziones de sas àndalas pro sos veìculos longos. Iscantzella su puntu de destinatzione prus a curtzu Fruni unu nùmene pro su puntu - Su puntu de destinatzione atuale in s\'àndala at a èssere iscantzelladu. Si at a èssere sa destinatzione, sa navigatzione s\'at a firmare. + Iscantzellat su puntu de destinatzione imbeniente in s\'àndala tua. Si est sa destinatzione, sa navigatzione s\'at a firmare. Iscàrriga sas mapas de Wikipedia - Otene informatziones a pitzu de puntos de interesse dae Wikipedia. Est sa ghia non in lìnia tua de mantènnere in butzaca - allughe s\'estensione Wikipedia e ispassia·ti cun sos artìculos a pitzu de sos ogetos a fùrriu de tie. + Otene informatziones a pitzu de puntos de interesse dae Wikipedia, una ghia non in lìnia de mantènnere in butzaca cun artìculos in subra de logos e destinatziones. Moto enduro Motorinu Cadira a rodas cara a in antis @@ -3834,7 +3834,7 @@ Profilu de navigatzione Ischerta unu documentu de rasta in ue annànghere su segmentu nou. Fotografias a livellu de sas carreras - Ses seguru de chèrrere serrare sa pianificatzione de s\'àndala e pèrdere totu sas modìficas\? + Ses seguru de chèrrere iscartare totu sas modìficas in s\'àndala pranificada\? In casu de diretzione furriada Rastas Càrriga sa rasta in unu documentu GPX @@ -3847,7 +3847,7 @@ Annanghe unu puntu de coladòrgiu a sa rasta Annanghe unu puntu de coladòrgiu a sa rasta Registratzione de su biàgiu - At a pònnere in pàusa sa registratzione de sa rasta cando OsmAnd at a èssere istudadu (pro mèdiu de sas aplicatziones reghentes). (S\'indicatore de sa modalidade OsmAnd de isfundu at a iscumpàrrere dae sa barra de notìfica de Android.) + Sa registratzione de sa rasta s\'at a pònnere in pàusa cando OsmAnd at a èssere istudadu (pro mèdiu de sas aplicatziones reghentes). (S\'indicatore de sa modalidade OsmAnd de isfundu at a iscumpàrrere dae sa barra de notìfica de Android.) Pone in pàusa sa registratzione de su biàgiu Sighi cun sa registratzione de su biàgiu Sarva comente documentu de rasta @@ -3905,12 +3905,12 @@ Nùmene: A – Z Iconas de incumintzu e fine Gràtzias pro àere comporadu \'Curvas de livellu\' - Costu periòdicu de s\'abbonamentu. Lu podes anullare in AppGallery cando boles. - Su pagamentu at a èssere addebitadu a su contu tuo de AppGallery cando sa còmpora at a èssere cunfirmada. -\n -\nS\'abbonamentu si rinnovat a sa sola automaticamente, francu chi siat istadu annulladu in antis de sa die de su rinnovu. Su contu tuo at a bènnere addebitadu pro su perìodu de rinnovu (mese/tres meses/annu) in sa die de rinnovu ebbia. -\n -\nPodes amministrare e annullare sos abbonamentos tuos intrende in sas impostatziones de AppGallery tuas. + S\'abbonamentu si pagat pro su perìodu ischertadu. Annulla·lu in AppGallery cando boles. + Su pagamentu at a èssere addebitadu a su contu tuo de AppGallery cando sa còmpora at a èssere cunfirmada. +\n +\nS\'abbonamentu si rinnovat a sa sola automaticamente, francu chi siat istadu annulladu in antis de sa die de su rinnovu. Su contu tuo at a bènnere addebitadu pro su perìodu de rinnovu (mese/tres meses/annu) in sa die de rinnovu ebbia. +\n +\nPodes amministrare e annullare sos abbonamentos tuos in sas impostatziones de AppGallery tuas. Èvita sos martzapiedis Èvita sos martzapiedis Ite b\'at de nou @@ -3955,7 +3955,7 @@ Contu Identificadore Amministra s\'abbonamentu - B\'at unu problema cun s\'abbonamentu tuo. Incarca su butone pro andare a sas impostatziones de sos abbonamentos de Google Play pro acontzare sa manera de pagamentu tua. + Incarca su butone pro andare a sas impostatziones de sos abbonamentos de Google Play pro acontzare sa manera de pagamentu tua. S\'abbonamentu de OsmAnd Live est iscadidu S\'abbonamentu de OsmAnd Live est istadu postu in pàusa S\'abbonamentu de OsmAnd Live est in isetu From 374eadf772344a22fa4cadcd04116aff4ca53ce2 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Sun, 13 Dec 2020 19:22:45 +0000 Subject: [PATCH 58/91] Translated using Weblate (Danish) Currently translated at 98.7% (3824 of 3873 strings) --- OsmAnd/res/values-da/phrases.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml index 1f12887e9d..8ae23f4061 100644 --- a/OsmAnd/res/values-da/phrases.xml +++ b/OsmAnd/res/values-da/phrases.xml @@ -3885,4 +3885,9 @@ LNG Sirene Sygeplejerske + + Flod + Vandtank + Vaccination: COVID19 + Vaccination \ No newline at end of file From a0dc649657b32b6e28fe13997b9bd206851e74b0 Mon Sep 17 00:00:00 2001 From: Michel GERDAY Date: Sun, 13 Dec 2020 17:27:26 +0000 Subject: [PATCH 59/91] Translated using Weblate (French) Currently translated at 100.0% (3873 of 3873 strings) --- OsmAnd/res/values-fr/phrases.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OsmAnd/res/values-fr/phrases.xml b/OsmAnd/res/values-fr/phrases.xml index ae3876eae4..5371880ddc 100644 --- a/OsmAnd/res/values-fr/phrases.xml +++ b/OsmAnd/res/values-fr/phrases.xml @@ -3885,4 +3885,14 @@ Visas pour immigrants Visas pour non-immigrants Liaison diplomatique + Lac + Puits tubulaire + Rivière + Puits + Pompe à eau + Ouvrages hydrauliques + Réservoir d\'eau + Robinet + Vaccination : covid19 + Vaccination \ No newline at end of file From d16fc57337f703710b20c48e06ac3c9fa92405b1 Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Sun, 13 Dec 2020 19:57:19 +0000 Subject: [PATCH 60/91] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3873 of 3873 strings) --- OsmAnd/res/values-uk/phrases.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OsmAnd/res/values-uk/phrases.xml b/OsmAnd/res/values-uk/phrases.xml index ad4f14121e..2454d78d33 100644 --- a/OsmAnd/res/values-uk/phrases.xml +++ b/OsmAnd/res/values-uk/phrases.xml @@ -3874,4 +3874,12 @@ Рятувальна станція Щеплення: COVID19 Щеплення + Привідний насос + Криниця + Трубна свердловина + Торкніться + Водозабір + Резервуар для води + Озеро + Річка \ No newline at end of file From cf6dce3702aa4abc848506b5099643c61d05471d Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Sun, 13 Dec 2020 18:16:01 +0000 Subject: [PATCH 61/91] Translated using Weblate (Sardinian) Currently translated at 99.6% (3861 of 3873 strings) --- OsmAnd/res/values-sc/phrases.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OsmAnd/res/values-sc/phrases.xml b/OsmAnd/res/values-sc/phrases.xml index d71ef1559b..0aeaf1f00b 100644 --- a/OsmAnd/res/values-sc/phrases.xml +++ b/OsmAnd/res/values-sc/phrases.xml @@ -3882,4 +3882,12 @@ Base de sos bagninos Vatzinamentu: COVID19 Vatzinamentu + Lagu + Riu + Putzu + Pompa alimentada + Depòsitu de abba + Isceta + Òperas idràulicas + Putzu a tubu \ No newline at end of file From da1be5e4fb2ccd13b914057d446a4baec04863fb Mon Sep 17 00:00:00 2001 From: ace shadow Date: Sun, 13 Dec 2020 21:27:59 +0000 Subject: [PATCH 62/91] Translated using Weblate (Slovak) Currently translated at 95.6% (3704 of 3873 strings) --- OsmAnd/res/values-sk/phrases.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/OsmAnd/res/values-sk/phrases.xml b/OsmAnd/res/values-sk/phrases.xml index f175d6a39f..980c0ca53a 100644 --- a/OsmAnd/res/values-sk/phrases.xml +++ b/OsmAnd/res/values-sk/phrases.xml @@ -3694,4 +3694,34 @@ Služby občanom Imigračné víza Neimigračné víza + Prístup na internet: zákazníci + Girocard + Banka Migros + Karty Postfinance + Skrinka záchranného materiálu + Lezecký park + Nízky + Stredný + Vysoký + Nízky + Stredný + Vysoký + Nízky + Stredný + Vysoký + Nízky + Stredný + Vysoký + Nízky + Stredný + Vysoký + Nízky + Stredný + Vysoký + Balka (ploché údolie v Rusku so suchým tokom) + Ordinácia podológa + Paliatívna medicína + Hlbinná psychológia + Chiropraxia + Pôrodníctvo (postnatálne) \ No newline at end of file From 6c802eff32e55fa1cf0fb7d382efbd81cc208aee Mon Sep 17 00:00:00 2001 From: Verdulo Date: Sun, 13 Dec 2020 22:28:34 +0000 Subject: [PATCH 63/91] Translated using Weblate (Esperanto) Currently translated at 99.8% (3573 of 3579 strings) --- OsmAnd/res/values-eo/strings.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index 2994035820..c653554cfe 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -3426,7 +3426,7 @@ Uzantnomo kaj pasvorto Tiuj ĉi agordoj pri kromprogramoj aplikos al ĉiuj profiloj OSM‑redaktilo - Vi povas vidigi ĉiujn viajn jam nepublikigitajn redaktojn aŭ rimarkojn ĉe %1$s. Punktoj alŝutitaj al OSM ne estos videblaj en OsmAnd. + Ĉiuj viaj jam nepublikigitaj redaktoj aŭ rimarkoj OSM estos videblaj ĉe %1$s. Punktoj alŝutitaj al OSM ne estos videblaj en OsmAnd. OSM Emblemo montrata dum navigi aŭ moviĝi. Montri emblemon dum restado. @@ -3833,7 +3833,7 @@ Profilo de navigo Elektu dosieron de spuro al kiu nova segmento estos aldonita. Strat-nivela fotaro - Ĉu vi certe volas forĵeti ĉiujn ŝanĝojn en la planita kurso per fermi ĝin\? + Ĉu vi certe volas forĵeti ĉiujn ŝanĝojn en la planita kurso\? Kiam en inversa direkto Aŭtomate registri spuron dum navigi Konservi kiel novan dosieron de spuro @@ -3895,7 +3895,7 @@ Nur la linio de kurso estos konservita, la navigadpunktoj estos forigitaj. Dosiernomo %s dosieroj de spuroj elektitaj - Paŭzigos registri spuron je halto de la aplikaĵo (per la menuo de lastaj aplikaĵoj). (Fona emblemo de OsmAnd malaperos de la androida sciiga zono.) + Paŭzigi registri spuron je halto de la aplikaĵo (per la menuo de lastaj aplikaĵoj). (La fona emblemo de OsmAnd malaperos de la androida sciiga zono.) Paŭzigi registri spuron Daŭrigi registri spuron Sistema @@ -3911,7 +3911,7 @@ \n Vi povas administri kaj rezigni viajn abonojn per la agordoj de AppGallery. Emblemoj de komenco kaj fino Dankon al vi por aĉeti la kromprogramon “nivelkurboj” - Abonpago prenita por la elektita periodo. VI ĉiam povas rezigni abonon ĉe AppGallery. + La abonpago estas prenita por la elektita periodo. VI ĉiam povas rezigni abonon ĉe AppGallery. Eviti irejojn Sen trotuaroj Programado @@ -3948,7 +3948,7 @@ OsmAnd uzas MGRS, kiu estas simila al la formo UTM NATO. Aldonu almenaŭ du punktojn Administri abonon - Okazis problemo pri via abono. Frapetu la butonon por iri al agordoj pri abonoj ĉe Google Play por korekti vian pagmanieron. + Frapetu la butonon por agordi pagmanieron ĉe Google Play por korekti vian abonon. Abono OsmAnd Live senvalidiĝis Abono OsmAnd Live estas paŭziigita Abono OsmAnd Live estas ĉesigita From 75fde5c2aaeab73f9841a4e396c96d2b7381e7ee Mon Sep 17 00:00:00 2001 From: Verdulo Date: Sun, 13 Dec 2020 21:54:45 +0000 Subject: [PATCH 64/91] Translated using Weblate (Esperanto) Currently translated at 100.0% (3873 of 3873 strings) --- OsmAnd/res/values-eo/phrases.xml | 156 ++++++++++++++++--------------- 1 file changed, 82 insertions(+), 74 deletions(-) diff --git a/OsmAnd/res/values-eo/phrases.xml b/OsmAnd/res/values-eo/phrases.xml index 27817738a4..f3ba290f90 100644 --- a/OsmAnd/res/values-eo/phrases.xml +++ b/OsmAnd/res/values-eo/phrases.xml @@ -2852,7 +2852,7 @@ Energifonto Medicina sistemo Vizitoj en hejmo - pico + picoj burgeroj kaftrinkaĵoj sandviĉoj @@ -2942,82 +2942,82 @@ burrito (meksika vianda manĝaĵo) terijakio (sojmielita viando) regiona - Itala - Ĉina - Meksika - Japana - Germana - Barata - Amerika - Azia - Franca - Greka - Taja + itala + ĉina + meksika + japana + germana + hinda + usona + azia + franca + greka + taja tutmonda - Turka - Hispana - Vjetnama - Korea - Mediteranea - Bavara - Libana - Rusa - Filipina - Portugala - Kartvela - Pola - Brazila - Araba - Dana - Indonezia - Afrika - Kariba - Argentina + turka + hispana + vjetnama + korea + mediteranea + bavara + libana + rusa + filipina + portugala + kartvela + pola + brazila + araba + dana + indonezia + afrika + kariba + argentina balkana - Perua - Kroata - Bolivia - Malagasa - Persa - Maroka - Aŭstra - Malajzia - Irlanda - Etiopa - Hungara - Laŭa - Eŭropa - Uzbeka - Ĉeĥa - Kuba - Brita - Latinamerika - Nepala - Mongola + perua + kroata + bolivia + malagasa + persa + maroka + aŭstra + malajzia + irlanda + etiopa + hungara + laŭa + eŭropa + uzbeka + ĉeĥa + kuba + brita + latinamerika + nepala + mongola Proksim-orienta - Ukrajna - Afgana - Belga - Eŭska - Svisa - Kantona - Sveda - Jamajka - Armena - Havaja - Angla - Pakistana - Tajvana - Teksas-meksika - Nederlanda - Siria - Aŭstralia - Kaĵuna - Egipta - Senegala - Juda - Bulgara - Tibeta + ukrajna + afgana + belga + eŭska + svisa + kantona + sveda + jamajka + armena + havaja + angla + pakistana + tajvana + teksas-meksika + nederlanda + siria + aŭstralia + kaĵuna + egipta + senegala + juda + bulgara + tibeta Pagmaniero (transporto) Socia servejo Alcela grupo @@ -3879,4 +3879,12 @@ Bazo de akvaj savistoj vakcinado: KOVIM-19 vakcinado + lago + rivero + puto + pumpo elektra + cisterno + krano + akvokondukilo + puto tuba (abisena) \ No newline at end of file From d1384f148be1156ae10b9b44b0ff08a191d805fb Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Mon, 14 Dec 2020 01:17:25 +0200 Subject: [PATCH 65/91] Audio/Video notes don't show up right after import, relaunch is needed? --- .../osmand/plus/importfiles/SettingsImportTask.java | 11 +++++++++++ .../settings/fragments/ImportSettingsFragment.java | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java b/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java index 34119b0bb5..0a5e0370af 100644 --- a/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java +++ b/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java @@ -13,8 +13,10 @@ import net.osmand.FileUtils; import net.osmand.IndexConstants; import net.osmand.plus.AppInitializer; import net.osmand.plus.CustomOsmandPlugin; +import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.audionotes.AudioVideoNotesPlugin; import net.osmand.plus.base.BaseLoadAsyncTask; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.backend.backup.PluginSettingsItem; @@ -138,6 +140,10 @@ class SettingsImportTask extends BaseLoadAsyncTask { app.getPoiFilters().loadSelectedPoiFilters(); AppInitializer.loadRoutingFiles(app, null); FragmentActivity activity = activityRef.get(); + AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class); + if (plugin != null) { + plugin.indexingFiles(null, true, true); + } if (activity instanceof MapActivity) { ((MapActivity) activity).getMapLayers().getMapWidgetRegistry().updateVisibleWidgets(); ((MapActivity) activity).updateApplicationModeSettings(); @@ -151,6 +157,7 @@ class SettingsImportTask extends BaseLoadAsyncTask { }; } + private void handlePluginImport(final PluginSettingsItem pluginItem, final File file) { FragmentActivity activity = activityRef.get(); final ProgressDialog progress; @@ -172,6 +179,10 @@ class SettingsImportTask extends BaseLoadAsyncTask { if (progress != null && AndroidUtils.isActivityNotDestroyed(activity)) { progress.dismiss(); } + AudioVideoNotesPlugin pluginAudioVideo = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class); + if (pluginAudioVideo != null) { + pluginAudioVideo.indexingFiles(null, true, true); + } CustomOsmandPlugin plugin = pluginItem.getPlugin(); plugin.loadResources(); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java index b3039831a3..2d7d50046d 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java @@ -24,10 +24,12 @@ import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager.TileSourceTemplate; import net.osmand.plus.AppInitializer; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; +import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; import net.osmand.plus.SQLiteTileSource; import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.audionotes.AudioVideoNotesPlugin; import net.osmand.plus.download.ReloadIndexesTask; import net.osmand.plus.download.ReloadIndexesTask.ReloadIndexesListener; import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; @@ -189,6 +191,10 @@ public class ImportSettingsFragment extends BaseSettingsListFragment { app.getRendererRegistry().updateExternalRenderers(); AppInitializer.loadRoutingFiles(app, null); reloadIndexes(items); + AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class); + if (plugin != null) { + plugin.indexingFiles(null, true, true); + } FragmentManager fm = getFragmentManager(); if (fm != null && file != null) { ImportCompleteFragment.showInstance(fm, items, file.getName()); From e17b8f1341b9b2561ecaa6bb9be215d590794566 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 14 Dec 2020 12:57:31 +0200 Subject: [PATCH 66/91] Add description about reset to default --- .../plus/settings/fragments/ConfigureProfileFragment.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java index ae1b2eba36..48ceba0a11 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java @@ -36,6 +36,7 @@ import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.development.OsmandDevelopmentPlugin; import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.FontCache; import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin; @@ -345,6 +346,12 @@ public class ConfigureProfileFragment extends BaseSettingsFragment implements Co if (mode.isCustomProfile() && !getBackupFileForCustomMode(app, mode.getStringKey()).exists()) { resetToDefault.setVisible(false); } else { + OsmandDevelopmentPlugin plugin = OsmandPlugin.getEnabledPlugin(OsmandDevelopmentPlugin.class); + if (plugin != null && mode.getParent() != null) { + String baseProfile = "(" + mode.getParent().toHumanString() + ")"; + String title = getString(R.string.ltr_or_rtl_combine_via_space, getString(R.string.reset_to_default), baseProfile); + resetToDefault.setTitle(title); + } resetToDefault.setIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_reset_to_default_dark, isNightMode() ? R.color.active_color_primary_dark : R.color.active_color_primary_light)); } From da6273d1264aefa6ffdf00812639464c503005b7 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Mon, 14 Dec 2020 18:32:09 +0200 Subject: [PATCH 67/91] Fix "Configure Profile" button in Plan Route --- .../layout/profile_with_config_btn_layout.xml | 43 +++---- .../MeasurementEditingContext.java | 16 +++ .../MeasurementToolFragment.java | 24 +++- .../MapRouteInfoMenu.java | 2 +- .../RouteOptionsBottomSheet.java | 113 +++++++++++++----- .../fragments/NavigationFragment.java | 31 ++++- 6 files changed, 166 insertions(+), 63 deletions(-) diff --git a/OsmAnd/res/layout/profile_with_config_btn_layout.xml b/OsmAnd/res/layout/profile_with_config_btn_layout.xml index 1b6a87561e..04e4d5384c 100644 --- a/OsmAnd/res/layout/profile_with_config_btn_layout.xml +++ b/OsmAnd/res/layout/profile_with_config_btn_layout.xml @@ -9,27 +9,30 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:elevation="2dp"> - - + + + + + - + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java index 9ce68686de..6d1522de1d 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java @@ -385,6 +385,22 @@ public class MeasurementEditingContext { return allSegments.size() > 0 ? allSegments : null; } + public void recalculateRouteSegmentsForAppMode() { + clearRouteSegmentsByAppMode(); + updateSegmentsForSnap(); + } + + public void clearRouteSegmentsByAppMode() { + for (Pair key : getOrderedRoadSegmentDataKeys()) { + if(key.first.getProfileType().equals(appMode.getStringKey())) { + RoadSegmentData data = roadSegmentData.get(key); + if (data != null) { + roadSegmentData.remove(key); + } + } + } + } + void splitSegments(int position) { List points = new ArrayList<>(); points.addAll(before.points); diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index f56eab9797..c54dd93a08 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -71,6 +71,7 @@ import net.osmand.plus.measurementtool.command.RemovePointCommand; import net.osmand.plus.measurementtool.command.ReorderPointCommand; import net.osmand.plus.measurementtool.command.ReversePointsCommand; import net.osmand.plus.routepreparationmenu.RouteOptionsBottomSheet; +import net.osmand.plus.routepreparationmenu.RouteOptionsBottomSheet.DialogMode; import net.osmand.plus.measurementtool.command.SplitPointsCommand; import net.osmand.plus.routepreparationmenu.cards.BaseCard; import net.osmand.plus.settings.backend.ApplicationMode; @@ -107,7 +108,8 @@ import static net.osmand.plus.measurementtool.command.ClearPointsCommand.ClearCo public class MeasurementToolFragment extends BaseOsmAndFragment implements RouteBetweenPointsFragmentListener, OptionsFragmentListener, GpxApproximationFragmentListener, SelectedPointFragmentListener, - SaveAsNewTrackFragmentListener, MapControlsLayer.MapControlsThemeInfoProvider { + SaveAsNewTrackFragmentListener, MapControlsLayer.MapControlsThemeInfoProvider, + RouteOptionsBottomSheet.OnAppModeConfiguredCallback{ public static final String TAG = MeasurementToolFragment.class.getSimpleName(); public static final String TAPS_DISABLED_KEY = "taps_disabled_key"; @@ -131,6 +133,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route private ImageView redoBtn; private ImageView mainIcon; private String fileName; + private OnBackPressedCallback onBackPressedCallback; private InfoType currentInfoType; @@ -218,11 +221,12 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - requireMyActivity().getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) { + onBackPressedCallback = new OnBackPressedCallback(true) { public void handleOnBackPressed() { quit(true); } - }); + }; + requireMyActivity().getOnBackPressedDispatcher().addCallback(this, onBackPressedCallback); } @Nullable @@ -531,7 +535,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route configBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - RouteOptionsBottomSheet.showInstance(mapActivity.getSupportFragmentManager(), + RouteOptionsBottomSheet.showInstance( + mapActivity, MeasurementToolFragment.this, DialogMode.PLAN_ROUTE, editingCtx.getAppMode().getStringKey()); } }); @@ -551,6 +556,10 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route return view; } + public OnBackPressedCallback getOnBackPressedCallback() { + return onBackPressedCallback; + } + private OnRadioItemClickListener getInfoTypeBtnListener(@NonNull final InfoType type) { return new OnRadioItemClickListener() { @Override @@ -687,6 +696,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route super.onResume(); MapActivity mapActivity = getMapActivity(); if (mapActivity != null) { + onBackPressedCallback.setEnabled(true); detailsMenu.setMapActivity(mapActivity); mapActivity.getMapLayers().getMapControlsLayer().addThemeInfoProviderTag(TAG); mapActivity.getMapLayers().getMapControlsLayer().showMapControlsIfHidden(); @@ -1091,6 +1101,12 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route updateDistancePointsText(); } + @Override + public void onAppModeConfigured() { + editingCtx.recalculateRouteSegmentsForAppMode(); + updateDistancePointsText(); + } + @Override public void onChangeRouteTypeBefore() { MapActivity mapActivity = getMapActivity(); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java index 99ad964bbc..c856a47426 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java @@ -1535,7 +1535,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener private void clickRouteParams() { MapActivity mapActivity = getMapActivity(); if (mapActivity != null) { - RouteOptionsBottomSheet.showInstance(mapActivity.getSupportFragmentManager()); + RouteOptionsBottomSheet.showInstance(mapActivity); } } diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java index cc983c9f77..1769f3c7bc 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java @@ -55,6 +55,7 @@ import net.osmand.plus.settings.backend.CommonPreference; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.settings.bottomsheets.ElevationDateBottomSheet; import net.osmand.plus.settings.fragments.BaseSettingsFragment; +import net.osmand.plus.settings.fragments.BaseSettingsFragment.SettingsScreenType; import net.osmand.router.GeneralRouter; import net.osmand.router.GeneralRouter.RoutingParameter; import net.osmand.util.Algorithms; @@ -67,8 +68,6 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import static net.osmand.plus.measurementtool.RouteBetweenPointsBottomSheetDialogFragment.RouteBetweenPointsDialogMode.ALL; -import static net.osmand.plus.measurementtool.RouteBetweenPointsBottomSheetDialogFragment.RouteBetweenPointsDialogType.WHOLE_ROUTE_CALCULATION; import static net.osmand.plus.routepreparationmenu.RoutingOptionsHelper.DRIVING_STYLE; import static net.osmand.plus.settings.fragments.RouteParametersFragment.RELIEF_SMOOTHNESS_FACTOR; import static net.osmand.plus.settings.fragments.RouteParametersFragment.getRoutingParameterTitle; @@ -80,7 +79,7 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { public static final String TAG = RouteOptionsBottomSheet.class.getSimpleName(); private static final Log LOG = PlatformUtil.getLog(RouteOptionsBottomSheet.class); public static final String APP_MODE_KEY = "APP_MODE_KEY"; - public static final String PLANE_ROUTE = "PLANE_ROUTE"; + public static final String DIALOG_MODE_KEY = "DIALOG_MODE_KEY"; private OsmandApplication app; private OsmandSettings settings; @@ -95,8 +94,38 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { private CommonPreference useHeightPref; private StateChangedListener voiceMuteChangeListener; private StateChangedListener useHeightChangeListener; - private boolean planRouteMode; private List reliefParameters = new ArrayList<>(); + private DialogMode dialogMode; + + public enum DialogMode { + DIRECTIONS(), + PLAN_ROUTE(MuteSoundRoutingParameter.class, + RouteSimulationItem.class, + GpxLocalRoutingParameter.class); + + private final Class[] excludeParameters; + + @SafeVarargs + DialogMode(Class ... excludeParameters) { + this.excludeParameters = excludeParameters; + } + + public boolean isAvailableParameter(LocalRoutingParameter parameter) { + for (Class c : excludeParameters) { + if (Algorithms.objectEquals(parameter.getClass(), c)) { + return false; + } + } + return true; + } + + public static DialogMode getModeByName(String modeName) { + if (modeName != null) { + return valueOf(modeName); + } + return DIRECTIONS; + } + } @Override public void onCreate(Bundle savedInstanceState) { @@ -106,8 +135,9 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { String appMode = args.getString(APP_MODE_KEY, null); if (appMode != null) { applicationMode = ApplicationMode.valueOfStringKey(appMode, null); - planRouteMode = true; } + String dialogModeName = args.getString(DIALOG_MODE_KEY, null); + dialogMode = DialogMode.getModeByName(dialogModeName); } app = requiredMyApplication(); settings = app.getSettings(); @@ -117,6 +147,9 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { if (applicationMode == null) { applicationMode = routingHelper.getAppMode(); } + if (dialogMode == null) { + dialogMode = DialogMode.DIRECTIONS; + } selectedModeColorId = applicationMode.getIconColorInfo().getColor(nightMode); voiceMuteChangeListener = new StateChangedListener() { @Override @@ -139,28 +172,27 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { items.add(new TitleItem(app.getString(R.string.shared_string_settings), nightMode ? R.color.active_color_primary_dark : R.color.active_color_primary_light)); List list = getRoutingParameters(applicationMode); - for (final LocalRoutingParameter optionsItem : list) { + if (!dialogMode.isAvailableParameter(optionsItem)) { + continue; + } + if (optionsItem instanceof DividerItem) { - items.add(new DividerStartItem(app)); - } else if (optionsItem instanceof MuteSoundRoutingParameter) { - if (!planRouteMode) { - items.add(createMuteSoundItem(optionsItem)); + if (isDividerRequired()) { + items.add(new DividerStartItem(app)); } + } else if (optionsItem instanceof MuteSoundRoutingParameter) { + items.add(createMuteSoundItem(optionsItem)); } else if (optionsItem instanceof ShowAlongTheRouteItem) { items.add(createShowAlongTheRouteItem(optionsItem)); } else if (optionsItem instanceof RouteSimulationItem) { - if (!planRouteMode) { - items.add(createRouteSimulationItem(optionsItem)); - } + items.add(createRouteSimulationItem(optionsItem)); } else if (optionsItem instanceof AvoidPTTypesRoutingParameter) { items.add(createAvoidPTTypesItem(optionsItem)); } else if (optionsItem instanceof AvoidRoadsRoutingParameter) { items.add(createAvoidRoadsItem(optionsItem)); } else if (optionsItem instanceof GpxLocalRoutingParameter) { - if (!planRouteMode) { - items.add(createGpxRoutingItem(optionsItem)); - } + items.add(createGpxRoutingItem(optionsItem)); } else if (optionsItem instanceof TimeConditionalRoutingItem) { items.add(createTimeConditionalRoutingItem(optionsItem)); } else if (optionsItem instanceof OtherSettingsRoutingParameter) { @@ -173,6 +205,11 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { } } + private boolean isDividerRequired() { + // do not show two dividers at once + return items.size() > 1 && !(items.get(items.size() - 1) instanceof DividerStartItem); + } + @Override public void onResume() { super.onResume(); @@ -282,8 +319,7 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { voicePromptsBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - BaseSettingsFragment.showInstance( - mapActivity, BaseSettingsFragment.SettingsScreenType.VOICE_ANNOUNCES); + BaseSettingsFragment.showInstance(mapActivity, SettingsScreenType.VOICE_ANNOUNCES); dismiss(); } }); @@ -508,10 +544,16 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { @Override public void onClick(View view) { dismiss(); + + Fragment fragment = getTargetFragment(); + if (fragment instanceof MeasurementToolFragment) { + ((MeasurementToolFragment) fragment).getOnBackPressedCallback().setEnabled(false); + } + Bundle args = new Bundle(); - args.putBoolean(PLANE_ROUTE, planRouteMode); - BaseSettingsFragment.showInstance(mapActivity, BaseSettingsFragment.SettingsScreenType.NAVIGATION, - applicationMode, args); + args.putString(DIALOG_MODE_KEY, dialogMode.name()); + BaseSettingsFragment.showInstance(mapActivity, + SettingsScreenType.NAVIGATION, applicationMode, args); } }) .create(); @@ -614,16 +656,13 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { @Override public void onDismiss(@NonNull DialogInterface dialog) { super.onDismiss(dialog); - updatePlanRoute(); + notifyAppModeConfigurationChanged(); } - private void updatePlanRoute() { - MapActivity mapActivity = getMapActivity(); - if (mapActivity != null) { - Fragment fragment = mapActivity.getSupportFragmentManager().findFragmentByTag(MeasurementToolFragment.TAG); - if (fragment != null) { - ((MeasurementToolFragment) fragment).onChangeApplicationMode(applicationMode, WHOLE_ROUTE_CALCULATION, ALL); - } + private void notifyAppModeConfigurationChanged() { + Fragment fragment = getTargetFragment(); + if (fragment instanceof OnAppModeConfiguredCallback) { + ((OnAppModeConfiguredCallback) fragment).onAppModeConfigured(); } } @@ -658,17 +697,23 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { return (MapActivity) getActivity(); } - public static void showInstance(FragmentManager fragmentManager) { - showInstance(fragmentManager, null); + public static void showInstance(MapActivity mapActivity) { + showInstance(mapActivity, null, DialogMode.DIRECTIONS, null); } - public static void showInstance(FragmentManager fm, String appModeKey) { + public static void showInstance(MapActivity mapActivity, + Fragment targetFragment, + DialogMode dialogMode, + String appModeKey) { try { + FragmentManager fm = mapActivity.getSupportFragmentManager(); if (!fm.isStateSaved()) { RouteOptionsBottomSheet fragment = new RouteOptionsBottomSheet(); Bundle args = new Bundle(); args.putString(APP_MODE_KEY, appModeKey); + args.putString(DIALOG_MODE_KEY, dialogMode.name()); fragment.setArguments(args); + fragment.setTargetFragment(targetFragment, 0); fragment.show(fm, TAG); } } catch (RuntimeException e) { @@ -694,6 +739,10 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { } } + public interface OnAppModeConfiguredCallback { + void onAppModeConfigured(); + } + public enum AppModeOptions { CAR(MuteSoundRoutingParameter.KEY, diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/NavigationFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/NavigationFragment.java index 08ea81a092..47b8270066 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/NavigationFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/NavigationFragment.java @@ -4,10 +4,14 @@ import android.graphics.drawable.Drawable; import android.os.Bundle; import androidx.activity.OnBackPressedCallback; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; import androidx.preference.Preference; import androidx.preference.SwitchPreferenceCompat; +import net.osmand.plus.measurementtool.MeasurementToolFragment; import net.osmand.plus.routepreparationmenu.RouteOptionsBottomSheet; +import net.osmand.plus.routepreparationmenu.RouteOptionsBottomSheet.DialogMode; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; @@ -35,7 +39,7 @@ import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.IS import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.PROFILE_KEY_ARG; import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.SELECTED_KEY; import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.TYPE_NAV_PROFILE; -import static net.osmand.plus.routepreparationmenu.RouteOptionsBottomSheet.PLANE_ROUTE; +import static net.osmand.plus.routepreparationmenu.RouteOptionsBottomSheet.DIALOG_MODE_KEY; public class NavigationFragment extends BaseSettingsFragment { @@ -51,16 +55,31 @@ public class NavigationFragment extends BaseSettingsFragment { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); routingProfileDataObjects = getRoutingProfiles(app); - requireMyActivity().getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) { + setupOnBackPressedCallback(); + } + + private void setupOnBackPressedCallback() { + OnBackPressedCallback callback = new OnBackPressedCallback(true) { public void handleOnBackPressed() { + MapActivity mapActivity = getMapActivity(); Bundle args = getArguments(); - if (args != null && args.getBoolean(PLANE_ROUTE, false)) { - RouteOptionsBottomSheet.showInstance(getMapActivity().getSupportFragmentManager(), - getSelectedAppMode().getStringKey()); + if (mapActivity != null && args != null) { + String dialogModeName = args.getString(DIALOG_MODE_KEY, null); + if (DialogMode.getModeByName(dialogModeName) == DialogMode.PLAN_ROUTE) { + FragmentManager fm = mapActivity.getSupportFragmentManager(); + Fragment fragment = fm.findFragmentByTag(MeasurementToolFragment.TAG); + if (fragment != null) { + RouteOptionsBottomSheet.showInstance( + mapActivity, fragment, DialogMode.PLAN_ROUTE, + getSelectedAppMode().getStringKey()); + ((MeasurementToolFragment) fragment).getOnBackPressedCallback().setEnabled(true); + } + } } dismiss(); } - }); + }; + requireMyActivity().getOnBackPressedDispatcher().addCallback(this, callback); } @Override From a40a064e135a25f8f120b3381c709ba86853732d Mon Sep 17 00:00:00 2001 From: Franco Date: Sun, 13 Dec 2020 22:59:02 +0000 Subject: [PATCH 68/91] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3581 of 3581 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 0047cec907..4618562b7e 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -1952,7 +1952,7 @@ Lapso de tiempo mínimo entre avisos. Rumbo relativo Rumbo magnético - Destino indefinido + Complemento de accesibilidad: Destino indefinido Activa la navegación para cambios en vivo de OsmAnd. Navegación con OsmAnd Live Síguenos @@ -2396,7 +2396,7 @@ Descarga el mapa de «Curvas de nivel» para usarlas en esta región. Complemento Compra e instala el complemento «Curvas de nivel» para mostrar áreas verticales graduadas. - Descarga el mapa «Superposición de sombreado» para mostrar el sombreado vertical. + Descarga la capa superpuesta del mapa «Sombreado» para mostrar el sombreado vertical. Instala el complemento «Curvas de nivel» para mostrar las áreas verticales graduadas. Ocultar desde el nivel de zoom Mostrar u ocultar notas de OSM @@ -3432,7 +3432,7 @@ Nombre de usuario y contraseña Los ajustes de este complemento son globales y se aplican a todos los perfiles Edición de OSM - Puedes ver todas tus ediciones aún no subidas o errores de OSM en «%1$s». Los puntos subidos no se muestran en OsmAnd. + Vea todas las ediciones aún no subidas o errores de OSM en «%1$s». Los cambios ya cargados no se mostrarán más. OSM El icono se muestra mientras se navega o se mueve. El icono se muestra en reposo. @@ -3799,9 +3799,9 @@ Proporciona la longitud del vehículo, se pueden aplicar algunas restricciones de rutas para vehículos largos. Borrar el punto de destino más cercano Proporciona un nombre para el punto - El punto de destino actual de la ruta será borrado. Si será el destino, la navegación se detendrá. + Quita el siguiente destino de la ruta. Si es el destino final, la navegación se detendrá. Descargar datos de Wikipedia - Obtén información sobre los puntos de interés de Wikipedia. Es tu guía de bolsillo sin conexión - sólo activa el complemento de Wikipedia y disfruta los artículos sobre los objetos de alrededor. + Obtén información sobre los puntos de interés de Wikipedia, una guía de bolsillo sin conexión que incluye artículos sobre objetos y destinos. Motocicleta de enduro Motoneta (motor) Silla de ruedas @@ -3839,7 +3839,7 @@ Perfil de navegación Elige un archivo de traza al que se añadirá un nuevo segmento. Imágenes a nivel de calle - ¿Cerrar el plan de ruta sin guardar\?, se descartarán todos los cambios. + ¿Descartar todos los cambios en la ruta planificada\? En caso de dirección inversa Grabar la traza automáticamente al navegar Trazas @@ -3911,12 +3911,12 @@ Nombre: A – Z Iconos de inicio y fin Gracias por comprar las «Curvas de nivel» - La suscripción se cobra por el período elegido. Puedes cancelarlo en cualquier momento en AppGallery. + La suscripción se cobra por el período elegido. Puedes cancelarlo en AppGallery en cualquier momento. El pago será cargado a la cuenta de AppGallery al confirmar la compra. \n \nLa suscripción se renueva automáticamente a menos que se cancele antes de la fecha de renovación. La cuenta será cargada por el período de renovación (mes/trimestre/año) sólo en la fecha de renovación. \n -\nPuedes administrar y cancelar las suscripciones accediendo a los ajustes de AppGallery. +\nPuedes administrar y cancelar las suscripciones en los ajustes de AppGallery. Evita pasar por las veredas o aceras Evitar veredas/aceras Desarrollo @@ -4021,4 +4021,6 @@ \n • Se añadieron colores personalizados para los favoritos y los puntos de referencia de la traza \n \n + Perfil de OsmAnd + Perfil de usuario \ No newline at end of file From c4822e1a5bf3f0c01b29f9b6b020a6a09fb73d42 Mon Sep 17 00:00:00 2001 From: Franco Date: Sun, 13 Dec 2020 23:07:55 +0000 Subject: [PATCH 69/91] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3873 of 3873 strings) --- OsmAnd/res/values-es-rAR/phrases.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml index 651585605e..eeb3cd5c9d 100644 --- a/OsmAnd/res/values-es-rAR/phrases.xml +++ b/OsmAnd/res/values-es-rAR/phrases.xml @@ -3248,7 +3248,7 @@ Bomba Perforación Camión de agua - Tanque de agua + Depósito de agua Botella de agua Comunidad Familia @@ -3893,4 +3893,12 @@ Base de salvavidas Vacunación: COVID19 Vacunación + Lago + Río + Pozo + Bomba accionada + Depósito de agua + Canilla + Planta potabilizadora + Pozo entubado \ No newline at end of file From b2de90fbd507e79632b410b4af7966adf8cf2ba6 Mon Sep 17 00:00:00 2001 From: Artem Date: Sun, 13 Dec 2020 22:37:19 +0000 Subject: [PATCH 70/91] Translated using Weblate (Russian) Currently translated at 99.9% (3872 of 3873 strings) --- OsmAnd/res/values-ru/phrases.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index 99417815a1..1430becd00 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3873,4 +3873,12 @@ Вакцинация База спасателей Медсестра + Озеро + Река + Колодец + Приводной насос + Резервуар для воды + Нажмите + Водозабор + Трубчатый колодец \ No newline at end of file From 621a18f1e49be5c5e408630a2614bee387618c1d Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Dec 2020 10:53:46 +0200 Subject: [PATCH 71/91] resourse manager travel repositories aded --- .../src/net/osmand/plus/AppInitializer.java | 2 +- .../plus/resources/ResourceManager.java | 166 ++++++++++-------- .../plus/wikivoyage/data/TravelObfHelper.java | 68 +++---- 3 files changed, 120 insertions(+), 116 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index ecbd2293df..7bcbc5f1d5 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -460,7 +460,7 @@ public class AppInitializer implements IProgress { app.mapViewTrackingUtilities = startupInit(new MapViewTrackingUtilities(app), MapViewTrackingUtilities.class); // TODOTRAVEL_OBF_HELPER check ResourceManager and use TravelObfHelper - app.travelHelper = new TravelObfHelper(app); //new TravelDbHelper(app); + app.travelHelper = TravelObfHelper.checkIfObfFileExists(app) ? new TravelObfHelper(app) : new TravelDbHelper(app); app.travelHelper.initializeDataOnAppStartup(); app.travelHelper = startupInit(app.travelHelper, TravelHelper.class); diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index eb88b16e52..3fe6bd4479 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -81,11 +81,11 @@ import java.util.concurrent.ConcurrentHashMap; import static net.osmand.IndexConstants.VOICE_INDEX_DIR; /** - * Resource manager is responsible to work with all resources + * Resource manager is responsible to work with all resources * that could consume memory (especially with file resources). * Such as indexes, tiles. * Also it is responsible to create cache for that resources if they - * can't be loaded fully into memory & clear them on request. + * can't be loaded fully into memory & clear them on request. */ public class ResourceManager { @@ -93,7 +93,7 @@ public class ResourceManager { private static final String INDEXES_CACHE = "ind.cache"; private static final Log log = PlatformUtil.getLog(ResourceManager.class); - + protected static ResourceManager manager = null; protected File dirWithTiles ; @@ -117,11 +117,11 @@ public class ResourceManager { STREET_LOOKUP, TRANSPORT, ADDRESS, - QUICK_SEARCH, + QUICK_SEARCH, ROUTING, TRANSPORT_ROUTING } - + public static class BinaryMapReaderResource { private BinaryMapIndexReader initialReader; private File filename; @@ -175,7 +175,7 @@ public class ResourceManager { } initialReader = null; } - + public boolean isClosed() { return initialReader == null; } @@ -191,7 +191,7 @@ public class ResourceManager { public void setUseForRouting(boolean useForRouting) { this.useForRouting = useForRouting; } - + public boolean isUseForRouting() { return useForRouting; } @@ -204,34 +204,35 @@ public class ResourceManager { this.useForPublicTransport = useForPublicTransport; } } - + protected final Map fileReaders = new ConcurrentHashMap(); - - + + private final Map addressMap = new ConcurrentHashMap(); protected final Map amenityRepositories = new ConcurrentHashMap(); // protected final Map routingMapFiles = new ConcurrentHashMap(); protected final Map transportRepositories = new ConcurrentHashMap(); - + protected final Map travelRepositories = new ConcurrentHashMap(); + protected final Map indexFileNames = new ConcurrentHashMap(); protected final Map basemapFileNames = new ConcurrentHashMap(); - - + + protected final IncrementalChangesManager changesManager = new IncrementalChangesManager(this); - + protected final MapRenderRepositories renderer; protected final MapTileDownloader tileDownloader; - + public final AsyncLoadingThread asyncLoadingThread = new AsyncLoadingThread(this); - + private HandlerThread renderingBufferImageThread; - + protected boolean internetIsNotAccessible = false; private boolean depthContours; - + public ResourceManager(OsmandApplication context) { - + this.context = context; this.renderer = new MapRenderRepositories(context); @@ -273,7 +274,7 @@ public class ResourceManager { public MapTileDownloader getMapTileDownloader() { return tileDownloader; } - + public HandlerThread getRenderingBufferImageThread() { return renderingBufferImageThread; } @@ -301,11 +302,11 @@ public class ResourceManager { tilesCache.setDirWithTiles(dirWithTiles); } } - + public java.text.DateFormat getDateFormat() { return DateFormat.getDateFormat(context); } - + public OsmandApplication getContext() { return context; } @@ -334,12 +335,12 @@ public class ResourceManager { } } } - + public synchronized boolean tileExistOnFileSystem(String file, ITileSource map, int x, int y, int zoom) { TilesCache cache = getTilesCache(map); return cache != null && cache.tileExistOnFileSystem(file, map, x, y, zoom); } - + public void clearTileForMap(String file, ITileSource map, int x, int y, int zoom){ TilesCache cache = getTilesCache(map); if (cache != null) { @@ -475,7 +476,7 @@ public class ResourceManager { log.error("Error while loading tts files from assets", e); } } - + public List checkAssets(IProgress progress, boolean forceUpdate) { String fv = Version.getFullVersion(context); if(context.getAppInitializer().isAppVersionChanged()) { @@ -511,7 +512,7 @@ public class ResourceManager { } return Collections.emptyList(); } - + private void copyRegionsBoundaries() { try { File file = context.getAppPath("regions.ocbf"); @@ -524,7 +525,7 @@ public class ResourceManager { log.error(e.getMessage(), e); } } - + private void copyPoiTypes() { try { File file = context.getAppPath(IndexConstants.SETTINGS_DIR + "poi_types.xml"); @@ -608,9 +609,9 @@ public class ResourceManager { } return files; } - - - + + + private void renameRoadsFiles(ArrayList files, File roadsPath) { Iterator it = files.iterator(); while(it.hasNext()) { @@ -630,18 +631,17 @@ public class ResourceManager { File appPath = context.getAppPath(null); File roadsPath = context.getAppPath(IndexConstants.ROADS_INDEX_DIR); roadsPath.mkdirs(); - + collectFiles(appPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); renameRoadsFiles(files, roadsPath); collectFiles(roadsPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); if (Version.isPaidVersion(context)) { collectFiles(context.getAppPath(IndexConstants.WIKI_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); - collectFiles(context.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); } if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isSubscribedToLiveUpdates(context)) { collectFiles(context.getAppPath(IndexConstants.SRTM_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); } - + changesManager.collectChangesFiles(context.getAppPath(IndexConstants.LIVE_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); Collections.sort(files, Algorithms.getFileVersionComparator()); @@ -729,7 +729,7 @@ public class ResourceManager { } renderer.initializeNewResource(progress, f, mapReader); BinaryMapReaderResource resource = new BinaryMapReaderResource(f, mapReader); - + fileReaders.put(f.getName(), resource); if (!mapReader.getRegionNames().isEmpty()) { RegionAddressRepositoryBinary rarb = new RegionAddressRepositoryBinary(this, resource); @@ -738,8 +738,9 @@ public class ResourceManager { if (mapReader.hasTransportData()) { transportRepositories.put(f.getName(), resource); } + collectTravelFiles(mapReader, resource); // disable osmc for routing temporarily due to some bugs - if (mapReader.containsRouteData() && (!f.getParentFile().equals(liveDir) || + if (mapReader.containsRouteData() && (!f.getParentFile().equals(liveDir) || context.getSettings().USE_OSM_LIVE_FOR_ROUTING.get())) { resource.setUseForRouting(true); } @@ -801,7 +802,15 @@ public class ResourceManager { return warnings; } - + private void collectTravelFiles(BinaryMapIndexReader mapReader, BinaryMapReaderResource resource) { + BinaryMapIndexReader index = mapReader; + for (BinaryIndexPart p : index.getIndexes()) { + if (p instanceof BinaryMapPoiReaderAdapter.PoiRegion) { + transportRepositories.put(index.getFile().getName(), resource); + } + } + } + public void initMapBoundariesCacheNative() { File indCache = context.getAppPath(INDEXES_CACHE); @@ -812,7 +821,7 @@ public class ResourceManager { } } } - + ////////////////////////////////////////////// Working with amenities //////////////////////////////////////////////// public List getAmenityRepositories() { @@ -878,9 +887,9 @@ public class ResourceManager { if (!filter.isEmpty()) { for (AmenityIndexRepository index : getAmenityRepositories()) { if (index.checkContainsInt( - MapUtils.get31TileNumberY(topLatitude), - MapUtils.get31TileNumberX(leftLongitude), - MapUtils.get31TileNumberY(bottomLatitude), + MapUtils.get31TileNumberY(topLatitude), + MapUtils.get31TileNumberX(leftLongitude), + MapUtils.get31TileNumberY(bottomLatitude), MapUtils.get31TileNumberX(rightLongitude))) { repos.add(index); } @@ -900,8 +909,8 @@ public class ResourceManager { } return amenities; } - - + + public boolean containsAmenityRepositoryToSearch(boolean searchByName){ for (AmenityIndexRepository index : getAmenityRepositories()) { if(searchByName){ @@ -914,9 +923,9 @@ public class ResourceManager { } return false; } - + public List searchAmenitiesByName(String searchQuery, - double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, + double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, double lat, double lon, ResultMatcher matcher) { List amenities = new ArrayList(); List list = new ArrayList(); @@ -935,11 +944,11 @@ public class ResourceManager { } else { list.add((AmenityIndexRepositoryBinary) index); } - + } } } - + // Not using boundares results in very slow initial search if user has many maps installed // int left = 0; // int top = 0; @@ -957,7 +966,7 @@ public class ResourceManager { return amenities; } - + public Map> searchAmenityCategoriesByName(String searchQuery, double lat, double lon) { Map> map = new LinkedHashMap>(); for (AmenityIndexRepository index : getAmenityRepositories()) { @@ -973,17 +982,17 @@ public class ResourceManager { public AmenityIndexRepositoryBinary getAmenityRepositoryByFileName(String filename) { return (AmenityIndexRepositoryBinary) amenityRepositories.get(filename); } - + ////////////////////////////////////////////// Working with address /////////////////////////////////////////// - + public RegionAddressRepository getRegionRepository(String name){ return addressMap.get(name); } - + public Collection getAddressRepositories(){ return addressMap.values(); } - + public Collection getFileReaders() { List fileNames = new ArrayList<>(fileReaders.keySet()); Collections.sort(fileNames, Algorithms.getStringVersionComparator()); @@ -996,8 +1005,8 @@ public class ResourceManager { } return res; } - - + + ////////////////////////////////////////////// Working with transport //////////////////////////////////////////////// private List getTransportRepositories(double topLat, double leftLon, double bottomLat, double rightLon) { @@ -1014,6 +1023,20 @@ public class ResourceManager { return res; } + private List getTravelRepositories(double topLat, double leftLon, double bottomLat, double rightLon) { + List fileNames = new ArrayList<>(travelRepositories.keySet()); + Collections.sort(fileNames, Algorithms.getStringVersionComparator()); + List res = new ArrayList<>(); + for (String fileName : fileNames) { + BinaryMapReaderResource r = travelRepositories.get(fileName); + if (r != null && r.isUseForPublicTransport() && + r.getShallowReader().containTransportData(topLat, leftLon, bottomLat, rightLon)) { + res.add(r.getReader(BinaryMapReaderResourceType.POI)); + } + } + return res; + } + public List searchTransportSync(double topLat, double leftLon, double bottomLat, double rightLon, ResultMatcher matcher) throws IOException { @@ -1043,37 +1066,38 @@ public class ResourceManager { public boolean updateRenderedMapNeeded(RotatedTileBox rotatedTileBox, DrawSettings drawSettings) { return renderer.updateMapIsNeeded(rotatedTileBox, drawSettings); } - + public void updateRendererMap(RotatedTileBox rotatedTileBox, OnMapLoadedListener mapLoadedListener){ renderer.interruptLoadingMap(); asyncLoadingThread.requestToLoadMap(new MapLoadRequest(rotatedTileBox, mapLoadedListener)); } - + public void interruptRendering(){ renderer.interruptLoadingMap(); } - + public boolean isSearchAmenitiesInProgress() { return searchAmenitiesInProgress; } - + public MapRenderRepositories getRenderer() { return renderer; } - + ////////////////////////////////////////////// Closing methods //////////////////////////////////////////////// - + public void closeFile(String fileName) { amenityRepositories.remove(fileName); addressMap.remove(fileName); transportRepositories.remove(fileName); + travelRepositories.remove(fileName); indexFileNames.remove(fileName); renderer.closeConnection(fileName); BinaryMapReaderResource resource = fileReaders.remove(fileName); if(resource != null) { resource.close(); } - } + } public synchronized void close(){ for (TilesCache tc : tilesCacheList) { @@ -1083,6 +1107,7 @@ public class ResourceManager { basemapFileNames.clear(); renderer.clearAllResources(); transportRepositories.clear(); + travelRepositories.clear(); addressMap.clear(); amenityRepositories.clear(); for(BinaryMapReaderResource res : fileReaders.values()) { @@ -1090,8 +1115,8 @@ public class ResourceManager { } fileReaders.clear(); } - - + + public BinaryMapIndexReader[] getRoutingMapFiles() { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); @@ -1139,7 +1164,8 @@ public class ResourceManager { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); for (BinaryMapReaderResource res : fileReaders) { - if (!res.filename.toString().toLowerCase().contains("travel.obf")) { + if (!res.filename.toString().toLowerCase() + .contains(IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT)) { continue; } BinaryMapIndexReader index = res.getReader(BinaryMapReaderResourceType.POI); @@ -1156,8 +1182,8 @@ public class ResourceManager { public Map getIndexFileNames() { return new LinkedHashMap(indexFileNames); } - - + + public boolean containsBasemap(){ return !basemapFileNames.isEmpty(); } @@ -1192,13 +1218,13 @@ public class ResourceManager { } return map; } - + public synchronized void reloadTilesFromFS() { for (TilesCache tc : tilesCacheList) { tc.tilesOnFS.clear(); } } - + /// On low memory method /// public void onLowMemory() { log.info("On low memory"); @@ -1207,10 +1233,10 @@ public class ResourceManager { r.clearCache(); } renderer.clearCache(); - + System.gc(); } - + public GeoidAltitudeCorrection getGeoidAltitudeCorrection() { return geoidAltitudeCorrection; } @@ -1225,7 +1251,7 @@ public class ResourceManager { tc.clearTiles(); } } - + public IncrementalChangesManager getChangesManager() { return changesManager; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 205d2378c7..7fc4995804 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -34,9 +34,7 @@ public class TravelObfHelper implements TravelHelper { private final OsmandApplication application; private TravelLocalDataHelper localDataHelper; - private SQLiteAPI.SQLiteConnection connection = null; - private File selectedTravelBook = null; private List files; private List existingTravelBooks = new ArrayList<>(); private List popularArticles = new ArrayList(); @@ -52,60 +50,22 @@ public class TravelObfHelper implements TravelHelper { } @Override - public boolean isAnyTravelBookPresent() { - return selectedTravelBook != null; - } - public void initializeDataOnAppStartup() { - 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; - } - } - } else { - selectedTravelBook = null; - } + } - @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().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT)) { - res.add(file); - } - } - return res; - } - return null; + @Override + public boolean isAnyTravelBookPresent() { + return checkIfObfFileExists(application); } + public void initializeDataToDisplay() { localDataHelper.refreshCachedData(); loadPopularArticles(); } - public String getSelectedTravelBookName() { - if (selectedTravelBook != null) { - return selectedTravelBook.getName(); - } - return null; - } - - public List getExistingTravelBooks() { - return existingTravelBooks; - } - @NonNull public List search(final String searchQuery) { // TODO remove @@ -194,6 +154,24 @@ public class TravelObfHelper implements TravelHelper { return file; } + @Override + public String getSelectedTravelBookName() { + //TODO REPLACE + return "OBF TRAVEL BOOK"; + } + + 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().contains(IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT)) { + return true; + } + } + } + return false; + } + // might use in future protected static class PopularArticle { String tripId; From a1ecaacbe8c7af2e9b14104221ae143037e70f85 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Dec 2020 10:58:07 +0200 Subject: [PATCH 72/91] formatting changes --- .../plus/resources/ResourceManager.java | 183 +++++++----------- 1 file changed, 68 insertions(+), 115 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 3fe6bd4479..8e7857b33a 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -19,10 +19,8 @@ import net.osmand.IndexConstants; import net.osmand.Location; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; -import net.osmand.binary.BinaryIndexPart; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader.SearchPoiTypeFilter; -import net.osmand.binary.BinaryMapPoiReaderAdapter; import net.osmand.binary.CachedOsmandIndexes; import net.osmand.data.Amenity; import net.osmand.data.RotatedTileBox; @@ -81,11 +79,11 @@ import java.util.concurrent.ConcurrentHashMap; import static net.osmand.IndexConstants.VOICE_INDEX_DIR; /** - * Resource manager is responsible to work with all resources + * Resource manager is responsible to work with all resources * that could consume memory (especially with file resources). * Such as indexes, tiles. * Also it is responsible to create cache for that resources if they - * can't be loaded fully into memory & clear them on request. + * can't be loaded fully into memory & clear them on request. */ public class ResourceManager { @@ -93,7 +91,7 @@ public class ResourceManager { private static final String INDEXES_CACHE = "ind.cache"; private static final Log log = PlatformUtil.getLog(ResourceManager.class); - + protected static ResourceManager manager = null; protected File dirWithTiles ; @@ -117,11 +115,11 @@ public class ResourceManager { STREET_LOOKUP, TRANSPORT, ADDRESS, - QUICK_SEARCH, + QUICK_SEARCH, ROUTING, TRANSPORT_ROUTING } - + public static class BinaryMapReaderResource { private BinaryMapIndexReader initialReader; private File filename; @@ -175,7 +173,7 @@ public class ResourceManager { } initialReader = null; } - + public boolean isClosed() { return initialReader == null; } @@ -191,7 +189,7 @@ public class ResourceManager { public void setUseForRouting(boolean useForRouting) { this.useForRouting = useForRouting; } - + public boolean isUseForRouting() { return useForRouting; } @@ -204,35 +202,34 @@ public class ResourceManager { this.useForPublicTransport = useForPublicTransport; } } - + protected final Map fileReaders = new ConcurrentHashMap(); - - + + private final Map addressMap = new ConcurrentHashMap(); protected final Map amenityRepositories = new ConcurrentHashMap(); // protected final Map routingMapFiles = new ConcurrentHashMap(); protected final Map transportRepositories = new ConcurrentHashMap(); - protected final Map travelRepositories = new ConcurrentHashMap(); - + protected final Map indexFileNames = new ConcurrentHashMap(); protected final Map basemapFileNames = new ConcurrentHashMap(); - - + + protected final IncrementalChangesManager changesManager = new IncrementalChangesManager(this); - + protected final MapRenderRepositories renderer; protected final MapTileDownloader tileDownloader; - + public final AsyncLoadingThread asyncLoadingThread = new AsyncLoadingThread(this); - + private HandlerThread renderingBufferImageThread; - + protected boolean internetIsNotAccessible = false; private boolean depthContours; - + public ResourceManager(OsmandApplication context) { - + this.context = context; this.renderer = new MapRenderRepositories(context); @@ -274,7 +271,7 @@ public class ResourceManager { public MapTileDownloader getMapTileDownloader() { return tileDownloader; } - + public HandlerThread getRenderingBufferImageThread() { return renderingBufferImageThread; } @@ -302,11 +299,11 @@ public class ResourceManager { tilesCache.setDirWithTiles(dirWithTiles); } } - + public java.text.DateFormat getDateFormat() { return DateFormat.getDateFormat(context); } - + public OsmandApplication getContext() { return context; } @@ -335,12 +332,12 @@ public class ResourceManager { } } } - + public synchronized boolean tileExistOnFileSystem(String file, ITileSource map, int x, int y, int zoom) { TilesCache cache = getTilesCache(map); return cache != null && cache.tileExistOnFileSystem(file, map, x, y, zoom); } - + public void clearTileForMap(String file, ITileSource map, int x, int y, int zoom){ TilesCache cache = getTilesCache(map); if (cache != null) { @@ -476,7 +473,7 @@ public class ResourceManager { log.error("Error while loading tts files from assets", e); } } - + public List checkAssets(IProgress progress, boolean forceUpdate) { String fv = Version.getFullVersion(context); if(context.getAppInitializer().isAppVersionChanged()) { @@ -512,7 +509,7 @@ public class ResourceManager { } return Collections.emptyList(); } - + private void copyRegionsBoundaries() { try { File file = context.getAppPath("regions.ocbf"); @@ -525,7 +522,7 @@ public class ResourceManager { log.error(e.getMessage(), e); } } - + private void copyPoiTypes() { try { File file = context.getAppPath(IndexConstants.SETTINGS_DIR + "poi_types.xml"); @@ -609,9 +606,9 @@ public class ResourceManager { } return files; } - - - + + + private void renameRoadsFiles(ArrayList files, File roadsPath) { Iterator it = files.iterator(); while(it.hasNext()) { @@ -631,7 +628,7 @@ public class ResourceManager { File appPath = context.getAppPath(null); File roadsPath = context.getAppPath(IndexConstants.ROADS_INDEX_DIR); roadsPath.mkdirs(); - + collectFiles(appPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); renameRoadsFiles(files, roadsPath); collectFiles(roadsPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); @@ -641,7 +638,7 @@ public class ResourceManager { if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isSubscribedToLiveUpdates(context)) { collectFiles(context.getAppPath(IndexConstants.SRTM_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); } - + changesManager.collectChangesFiles(context.getAppPath(IndexConstants.LIVE_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); Collections.sort(files, Algorithms.getFileVersionComparator()); @@ -729,7 +726,7 @@ public class ResourceManager { } renderer.initializeNewResource(progress, f, mapReader); BinaryMapReaderResource resource = new BinaryMapReaderResource(f, mapReader); - + fileReaders.put(f.getName(), resource); if (!mapReader.getRegionNames().isEmpty()) { RegionAddressRepositoryBinary rarb = new RegionAddressRepositoryBinary(this, resource); @@ -738,9 +735,8 @@ public class ResourceManager { if (mapReader.hasTransportData()) { transportRepositories.put(f.getName(), resource); } - collectTravelFiles(mapReader, resource); // disable osmc for routing temporarily due to some bugs - if (mapReader.containsRouteData() && (!f.getParentFile().equals(liveDir) || + if (mapReader.containsRouteData() && (!f.getParentFile().equals(liveDir) || context.getSettings().USE_OSM_LIVE_FOR_ROUTING.get())) { resource.setUseForRouting(true); } @@ -802,15 +798,7 @@ public class ResourceManager { return warnings; } - private void collectTravelFiles(BinaryMapIndexReader mapReader, BinaryMapReaderResource resource) { - BinaryMapIndexReader index = mapReader; - for (BinaryIndexPart p : index.getIndexes()) { - if (p instanceof BinaryMapPoiReaderAdapter.PoiRegion) { - transportRepositories.put(index.getFile().getName(), resource); - } - } - } - + public void initMapBoundariesCacheNative() { File indCache = context.getAppPath(INDEXES_CACHE); @@ -821,7 +809,7 @@ public class ResourceManager { } } } - + ////////////////////////////////////////////// Working with amenities //////////////////////////////////////////////// public List getAmenityRepositories() { @@ -887,9 +875,9 @@ public class ResourceManager { if (!filter.isEmpty()) { for (AmenityIndexRepository index : getAmenityRepositories()) { if (index.checkContainsInt( - MapUtils.get31TileNumberY(topLatitude), - MapUtils.get31TileNumberX(leftLongitude), - MapUtils.get31TileNumberY(bottomLatitude), + MapUtils.get31TileNumberY(topLatitude), + MapUtils.get31TileNumberX(leftLongitude), + MapUtils.get31TileNumberY(bottomLatitude), MapUtils.get31TileNumberX(rightLongitude))) { repos.add(index); } @@ -909,8 +897,8 @@ public class ResourceManager { } return amenities; } - - + + public boolean containsAmenityRepositoryToSearch(boolean searchByName){ for (AmenityIndexRepository index : getAmenityRepositories()) { if(searchByName){ @@ -923,9 +911,9 @@ public class ResourceManager { } return false; } - + public List searchAmenitiesByName(String searchQuery, - double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, + double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, double lat, double lon, ResultMatcher matcher) { List amenities = new ArrayList(); List list = new ArrayList(); @@ -944,11 +932,11 @@ public class ResourceManager { } else { list.add((AmenityIndexRepositoryBinary) index); } - + } } } - + // Not using boundares results in very slow initial search if user has many maps installed // int left = 0; // int top = 0; @@ -966,7 +954,7 @@ public class ResourceManager { return amenities; } - + public Map> searchAmenityCategoriesByName(String searchQuery, double lat, double lon) { Map> map = new LinkedHashMap>(); for (AmenityIndexRepository index : getAmenityRepositories()) { @@ -982,17 +970,17 @@ public class ResourceManager { public AmenityIndexRepositoryBinary getAmenityRepositoryByFileName(String filename) { return (AmenityIndexRepositoryBinary) amenityRepositories.get(filename); } - + ////////////////////////////////////////////// Working with address /////////////////////////////////////////// - + public RegionAddressRepository getRegionRepository(String name){ return addressMap.get(name); } - + public Collection getAddressRepositories(){ return addressMap.values(); } - + public Collection getFileReaders() { List fileNames = new ArrayList<>(fileReaders.keySet()); Collections.sort(fileNames, Algorithms.getStringVersionComparator()); @@ -1005,8 +993,8 @@ public class ResourceManager { } return res; } - - + + ////////////////////////////////////////////// Working with transport //////////////////////////////////////////////// private List getTransportRepositories(double topLat, double leftLon, double bottomLat, double rightLon) { @@ -1023,20 +1011,6 @@ public class ResourceManager { return res; } - private List getTravelRepositories(double topLat, double leftLon, double bottomLat, double rightLon) { - List fileNames = new ArrayList<>(travelRepositories.keySet()); - Collections.sort(fileNames, Algorithms.getStringVersionComparator()); - List res = new ArrayList<>(); - for (String fileName : fileNames) { - BinaryMapReaderResource r = travelRepositories.get(fileName); - if (r != null && r.isUseForPublicTransport() && - r.getShallowReader().containTransportData(topLat, leftLon, bottomLat, rightLon)) { - res.add(r.getReader(BinaryMapReaderResourceType.POI)); - } - } - return res; - } - public List searchTransportSync(double topLat, double leftLon, double bottomLat, double rightLon, ResultMatcher matcher) throws IOException { @@ -1066,38 +1040,37 @@ public class ResourceManager { public boolean updateRenderedMapNeeded(RotatedTileBox rotatedTileBox, DrawSettings drawSettings) { return renderer.updateMapIsNeeded(rotatedTileBox, drawSettings); } - + public void updateRendererMap(RotatedTileBox rotatedTileBox, OnMapLoadedListener mapLoadedListener){ renderer.interruptLoadingMap(); asyncLoadingThread.requestToLoadMap(new MapLoadRequest(rotatedTileBox, mapLoadedListener)); } - + public void interruptRendering(){ renderer.interruptLoadingMap(); } - + public boolean isSearchAmenitiesInProgress() { return searchAmenitiesInProgress; } - + public MapRenderRepositories getRenderer() { return renderer; } - + ////////////////////////////////////////////// Closing methods //////////////////////////////////////////////// - + public void closeFile(String fileName) { amenityRepositories.remove(fileName); addressMap.remove(fileName); transportRepositories.remove(fileName); - travelRepositories.remove(fileName); indexFileNames.remove(fileName); renderer.closeConnection(fileName); BinaryMapReaderResource resource = fileReaders.remove(fileName); if(resource != null) { resource.close(); } - } + } public synchronized void close(){ for (TilesCache tc : tilesCacheList) { @@ -1107,7 +1080,6 @@ public class ResourceManager { basemapFileNames.clear(); renderer.clearAllResources(); transportRepositories.clear(); - travelRepositories.clear(); addressMap.clear(); amenityRepositories.clear(); for(BinaryMapReaderResource res : fileReaders.values()) { @@ -1115,8 +1087,8 @@ public class ResourceManager { } fileReaders.clear(); } - - + + public BinaryMapIndexReader[] getRoutingMapFiles() { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); @@ -1160,30 +1132,11 @@ public class ResourceManager { return readers.toArray(new BinaryMapIndexReader[0]); } - public List getTravelFiles() { - Collection fileReaders = getFileReaders(); - List readers = new ArrayList<>(fileReaders.size()); - for (BinaryMapReaderResource res : fileReaders) { - if (!res.filename.toString().toLowerCase() - .contains(IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT)) { - continue; - } - BinaryMapIndexReader index = res.getReader(BinaryMapReaderResourceType.POI); - for (BinaryIndexPart p : index.getIndexes()) { - if (p instanceof BinaryMapPoiReaderAdapter.PoiRegion) { - readers.add(index); - } - } - } - return readers; - } - - public Map getIndexFileNames() { return new LinkedHashMap(indexFileNames); } - - + + public boolean containsBasemap(){ return !basemapFileNames.isEmpty(); } @@ -1218,13 +1171,13 @@ public class ResourceManager { } return map; } - + public synchronized void reloadTilesFromFS() { for (TilesCache tc : tilesCacheList) { tc.tilesOnFS.clear(); } } - + /// On low memory method /// public void onLowMemory() { log.info("On low memory"); @@ -1233,10 +1186,10 @@ public class ResourceManager { r.clearCache(); } renderer.clearCache(); - + System.gc(); } - + public GeoidAltitudeCorrection getGeoidAltitudeCorrection() { return geoidAltitudeCorrection; } @@ -1251,7 +1204,7 @@ public class ResourceManager { tc.clearTiles(); } } - + public IncrementalChangesManager getChangesManager() { return changesManager; } From 203934cc1d94119313127a2d07bca3ed6018c165 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Dec 2020 11:26:42 +0200 Subject: [PATCH 73/91] travel reader added --- .../plus/resources/ResourceManager.java | 50 +++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 8e7857b33a..7d6bbd82f1 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -19,8 +19,10 @@ import net.osmand.IndexConstants; import net.osmand.Location; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; +import net.osmand.binary.BinaryIndexPart; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader.SearchPoiTypeFilter; +import net.osmand.binary.BinaryMapPoiReaderAdapter; import net.osmand.binary.CachedOsmandIndexes; import net.osmand.data.Amenity; import net.osmand.data.RotatedTileBox; @@ -210,7 +212,7 @@ public class ResourceManager { protected final Map amenityRepositories = new ConcurrentHashMap(); // protected final Map routingMapFiles = new ConcurrentHashMap(); protected final Map transportRepositories = new ConcurrentHashMap(); - + protected final Map travelRepositories = new ConcurrentHashMap(); protected final Map indexFileNames = new ConcurrentHashMap(); protected final Map basemapFileNames = new ConcurrentHashMap(); @@ -735,6 +737,7 @@ public class ResourceManager { if (mapReader.hasTransportData()) { transportRepositories.put(f.getName(), resource); } + collectTravelFiles(mapReader, resource); // disable osmc for routing temporarily due to some bugs if (mapReader.containsRouteData() && (!f.getParentFile().equals(liveDir) || context.getSettings().USE_OSM_LIVE_FOR_ROUTING.get())) { @@ -798,7 +801,29 @@ public class ResourceManager { return warnings; } - + private void collectTravelFiles(BinaryMapIndexReader mapReader, BinaryMapReaderResource resource) { + BinaryMapIndexReader index = mapReader; + for (BinaryIndexPart p : index.getIndexes()) { + if (p instanceof BinaryMapPoiReaderAdapter.PoiRegion) { + transportRepositories.put(index.getFile().getName(), resource); + } + } + } + + private List getTravelRepositories(double topLat, double leftLon, double bottomLat, double rightLon) { + List fileNames = new ArrayList<>(travelRepositories.keySet()); + Collections.sort(fileNames, Algorithms.getStringVersionComparator()); + List res = new ArrayList<>(); + for (String fileName : fileNames) { + BinaryMapReaderResource r = travelRepositories.get(fileName); + if (r != null && r.isUseForPublicTransport() && + r.getShallowReader().containTransportData(topLat, leftLon, bottomLat, rightLon)) { + res.add(r.getReader(BinaryMapReaderResourceType.POI)); + } + } + return res; + } + public void initMapBoundariesCacheNative() { File indCache = context.getAppPath(INDEXES_CACHE); @@ -1065,6 +1090,7 @@ public class ResourceManager { addressMap.remove(fileName); transportRepositories.remove(fileName); indexFileNames.remove(fileName); + travelRepositories.remove(fileName); renderer.closeConnection(fileName); BinaryMapReaderResource resource = fileReaders.remove(fileName); if(resource != null) { @@ -1080,6 +1106,7 @@ public class ResourceManager { basemapFileNames.clear(); renderer.clearAllResources(); transportRepositories.clear(); + travelRepositories.clear(); addressMap.clear(); amenityRepositories.clear(); for(BinaryMapReaderResource res : fileReaders.values()) { @@ -1087,7 +1114,24 @@ public class ResourceManager { } fileReaders.clear(); } - + + public List getTravelFiles() { + Collection fileReaders = getFileReaders(); + List readers = new ArrayList<>(fileReaders.size()); + for (BinaryMapReaderResource res : fileReaders) { + if (!res.filename.toString().toLowerCase() + .contains(IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT)) { + continue; + } + BinaryMapIndexReader index = res.getReader(BinaryMapReaderResourceType.POI); + for (BinaryIndexPart p : index.getIndexes()) { + if (p instanceof BinaryMapPoiReaderAdapter.PoiRegion) { + readers.add(index); + } + } + } + return readers; + } public BinaryMapIndexReader[] getRoutingMapFiles() { Collection fileReaders = getFileReaders(); From f2f1b26bcdbcb5fe493a89e4f7e323b933d6ebb3 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Tue, 15 Dec 2020 14:03:19 +0200 Subject: [PATCH 74/91] "Reset to default" changes settings only after click on "Apply" button --- .../backend/ContextMenuItemsSettings.java | 2 +- .../plus/settings/backend/OsmandSettings.java | 2 +- .../fragments/ConfigureMenuItemsFragment.java | 36 +++++++++++++++---- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsSettings.java index 54e64ba045..c37aa50c09 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ContextMenuItemsSettings.java @@ -102,7 +102,7 @@ public class ContextMenuItemsSettings implements Serializable { return Collections.unmodifiableList(orderIds); } - public static ContextMenuItemsSettings getDefaultInstanceForDrawer() { + public static ContextMenuItemsSettings getDrawerDefaultInstance() { ArrayList hiddenByDefault = new ArrayList<>(); hiddenByDefault.add(DRAWER_DASHBOARD_ID); return new ContextMenuItemsSettings(hiddenByDefault, new ArrayList()); diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index 61671c1143..e5fa9065cd 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -2520,7 +2520,7 @@ public class OsmandSettings { new ListStringPreference(this, "inactive_poi_filters", null, ",,").makeProfile().cache(); public final ContextMenuItemsPreference DRAWER_ITEMS = - (ContextMenuItemsPreference) new ContextMenuItemsPreference(this, "drawer_items", DRAWER_ITEM_ID_SCHEME, ContextMenuItemsSettings.getDefaultInstanceForDrawer()) + (ContextMenuItemsPreference) new ContextMenuItemsPreference(this, "drawer_items", DRAWER_ITEM_ID_SCHEME, ContextMenuItemsSettings.getDrawerDefaultInstance()) .makeProfile().cache(); public final ContextMenuItemsPreference CONFIGURE_MAP_ITEMS = diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureMenuItemsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureMenuItemsFragment.java index 3ba64d544a..dee6cdb541 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureMenuItemsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureMenuItemsFragment.java @@ -164,17 +164,26 @@ public class ConfigureMenuItemsFragment extends BaseOsmAndFragment } private void initSavedIds(ApplicationMode appMode) { - hiddenMenuItems = new ArrayList<>(getSettingForScreen(app, screenType).getModeValue(appMode).getHiddenIds()); + initSavedIds(appMode, false); + } + + private void initSavedIds(ApplicationMode appMode, boolean useDefaultValue) { + ContextMenuItemsSettings settings = getMenuItemsSettings(appMode, useDefaultValue); + hiddenMenuItems = new ArrayList<>(settings.getHiddenIds()); menuItemsOrder = new HashMap<>(); - List orderIds = getSettingForScreen(app, screenType).getModeValue(appMode).getOrderIds(); + List orderIds = settings.getOrderIds(); for (int i = 0; i < orderIds.size(); i++) { menuItemsOrder.put(orderIds.get(i), i); } } private void initMainActionsIds(ApplicationMode appMode) { + initMainActionsIds(appMode, false); + } + + private void initMainActionsIds(ApplicationMode appMode, boolean useDefaultValue) { List defItems = getCustomizableDefaultItems(contextMenuAdapter.getDefaultItems()); - ContextMenuItemsSettings pref = getSettingForScreen(app, screenType).getModeValue(appMode); + ContextMenuItemsSettings pref = getMenuItemsSettings(appMode, useDefaultValue); if (pref instanceof MainContextMenuItemsSettings) { mainActionItems = new ArrayList<>(((MainContextMenuItemsSettings) pref).getMainIds()); if (mainActionItems.isEmpty()) { @@ -276,7 +285,7 @@ public class ConfigureMenuItemsFragment extends BaseOsmAndFragment } if (fm != null) { ChangeGeneralProfilesPrefBottomSheet.showInstance(fm, - getSettingForScreen(app, screenType).getId(), + getSettingForScreen().getId(), prefToSave, getTargetFragment(), false, @@ -501,13 +510,12 @@ public class ConfigureMenuItemsFragment extends BaseOsmAndFragment menuItemsOrder.clear(); wasReset = true; isChanged = true; - getSettingForScreen(app, screenType).resetModeToDefault(appMode); if (screenType == ScreenType.CONTEXT_MENU_ACTIONS) { mainActionItems.clear(); } instantiateContextMenuAdapter(); - initSavedIds(appMode); - initMainActionsIds(appMode); + initSavedIds(appMode, true); + initMainActionsIds(appMode, true); rearrangeAdapter.updateItems(getAdapterItems()); } }); @@ -537,6 +545,20 @@ public class ConfigureMenuItemsFragment extends BaseOsmAndFragment } } + public ContextMenuItemsSettings getMenuItemsSettings(ApplicationMode appMode, + boolean useDefaultValue) { + ContextMenuItemsPreference preference = getSettingForScreen(); + if (useDefaultValue) { + return preference.getProfileDefaultValue(appMode); + } else { + return preference.getModeValue(appMode); + } + } + + public ContextMenuItemsPreference getSettingForScreen() { + return getSettingForScreen(app, screenType); + } + public static ContextMenuItemsPreference getSettingForScreen(OsmandApplication app, ScreenType screenType) throws IllegalArgumentException { switch (screenType) { case DRAWER: From 8ff06d88c9773e27ce8435b79375ef5d0f6d3946 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Tue, 15 Dec 2020 14:22:24 +0200 Subject: [PATCH 75/91] small refactoring --- .../routepreparationmenu/RouteOptionsBottomSheet.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java index 1769f3c7bc..461f947592 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java @@ -545,9 +545,11 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { public void onClick(View view) { dismiss(); - Fragment fragment = getTargetFragment(); - if (fragment instanceof MeasurementToolFragment) { - ((MeasurementToolFragment) fragment).getOnBackPressedCallback().setEnabled(false); + if (dialogMode == DialogMode.PLAN_ROUTE) { + Fragment fragment = getTargetFragment(); + if (fragment instanceof MeasurementToolFragment) { + ((MeasurementToolFragment) fragment).getOnBackPressedCallback().setEnabled(false); + } } Bundle args = new Bundle(); From c7dddc3f23217b6460bf4586ad6131ec2564df0b Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Dec 2020 15:19:45 +0200 Subject: [PATCH 76/91] removed unused methods --- .../plus/resources/ResourceManager.java | 39 +--------------- .../plus/wikivoyage/data/TravelObfHelper.java | 46 +++++++++---------- 2 files changed, 25 insertions(+), 60 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 7d6bbd82f1..5d5ca05c96 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -803,28 +803,11 @@ public class ResourceManager { private void collectTravelFiles(BinaryMapIndexReader mapReader, BinaryMapReaderResource resource) { BinaryMapIndexReader index = mapReader; - for (BinaryIndexPart p : index.getIndexes()) { - if (p instanceof BinaryMapPoiReaderAdapter.PoiRegion) { - transportRepositories.put(index.getFile().getName(), resource); - } + for (BinaryIndexPart p : index.getPoiIndexes()) { + travelRepositories.put(index.getFile().getName(), resource); } } - private List getTravelRepositories(double topLat, double leftLon, double bottomLat, double rightLon) { - List fileNames = new ArrayList<>(travelRepositories.keySet()); - Collections.sort(fileNames, Algorithms.getStringVersionComparator()); - List res = new ArrayList<>(); - for (String fileName : fileNames) { - BinaryMapReaderResource r = travelRepositories.get(fileName); - if (r != null && r.isUseForPublicTransport() && - r.getShallowReader().containTransportData(topLat, leftLon, bottomLat, rightLon)) { - res.add(r.getReader(BinaryMapReaderResourceType.POI)); - } - } - return res; - } - - public void initMapBoundariesCacheNative() { File indCache = context.getAppPath(INDEXES_CACHE); if (indCache.exists()) { @@ -1115,24 +1098,6 @@ public class ResourceManager { fileReaders.clear(); } - public List getTravelFiles() { - Collection fileReaders = getFileReaders(); - List readers = new ArrayList<>(fileReaders.size()); - for (BinaryMapReaderResource res : fileReaders) { - if (!res.filename.toString().toLowerCase() - .contains(IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT)) { - continue; - } - BinaryMapIndexReader index = res.getReader(BinaryMapReaderResourceType.POI); - for (BinaryIndexPart p : index.getIndexes()) { - if (p instanceof BinaryMapPoiReaderAdapter.PoiRegion) { - readers.add(index); - } - } - } - return readers; - } - public BinaryMapIndexReader[] getRoutingMapFiles() { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 7fc4995804..b162fa8698 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -69,30 +69,30 @@ public class TravelObfHelper implements TravelHelper { @NonNull public List search(final String searchQuery) { // TODO remove - this.files = application.getResourceManager().getTravelFiles(); + //this.files = application.getResourceManager().getTravelFiles(); List res = new ArrayList<>(); - List searchObjects = new ArrayList<>(); - for (BinaryMapIndexReader reader : files) { - try { - BinaryMapIndexReader.SearchRequest searchRequest = BinaryMapIndexReader. - buildSearchPoiRequest(0, 0, searchQuery, - 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null); - - searchObjects = reader.searchPoiByName(searchRequest); - } catch (IOException e) { - LOG.error(e); - } - } - for (MapObject obj : searchObjects) { - //TODO map - WikivoyageSearchResult r = new WikivoyageSearchResult(); - r.articleTitles = Collections.singletonList(obj.getName()); - r.langs = Collections.singletonList(obj.getName()); - r.imageTitle = (obj.getName()); - r.isPartOf = Collections.singletonList(obj.getName()); - r.routeId = "routeid";//obj.getId(); - res.add(r); - } +// List searchObjects = new ArrayList<>(); +// for (BinaryMapIndexReader reader : files) { +// try { +// BinaryMapIndexReader.SearchRequest searchRequest = BinaryMapIndexReader. +// buildSearchPoiRequest(0, 0, searchQuery, +// 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null); +// +// searchObjects = reader.searchPoiByName(searchRequest); +// } catch (IOException e) { +// LOG.error(e); +// } +// } +// for (MapObject obj : searchObjects) { +// //TODO map +// WikivoyageSearchResult r = new WikivoyageSearchResult(); +// r.articleTitles = Collections.singletonList(obj.getName()); +// r.langs = Collections.singletonList(obj.getName()); +// r.imageTitle = (obj.getName()); +// r.isPartOf = Collections.singletonList(obj.getName()); +// r.routeId = "routeid";//obj.getId(); +// res.add(r); +// } return res; } From 29a57dc562c6004bd632537c0c9742a3e7b45e87 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Dec 2020 15:22:10 +0200 Subject: [PATCH 77/91] check db file exists added --- OsmAnd/src/net/osmand/plus/AppInitializer.java | 2 +- .../osmand/plus/wikivoyage/data/TravelDbHelper.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 7bcbc5f1d5..00b5d2dc80 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -460,7 +460,7 @@ public class AppInitializer implements IProgress { app.mapViewTrackingUtilities = startupInit(new MapViewTrackingUtilities(app), MapViewTrackingUtilities.class); // TODOTRAVEL_OBF_HELPER check ResourceManager and use TravelObfHelper - app.travelHelper = TravelObfHelper.checkIfObfFileExists(app) ? new TravelObfHelper(app) : new TravelDbHelper(app); + app.travelHelper = !TravelDbHelper.checkIfDbFileExists(app) ? new TravelObfHelper(app) : new TravelDbHelper(app); app.travelHelper.initializeDataOnAppStartup(); app.travelHelper = startupInit(app.travelHelper, TravelHelper.class); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java index f5d6cc5898..378f0a6a70 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java @@ -114,6 +114,18 @@ public class TravelDbHelper implements TravelHelper { localDataHelper = new TravelLocalDataHelper(application); } + public static boolean checkIfDbFileExists(OsmandApplication app) { + File[] files = app.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles(); + if (files != null) { + for (File file : files) { + if (file.getName().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT)) { + return true; + } + } + } + return false; + } + public TravelLocalDataHelper getBookmarksHelper() { return localDataHelper; } From 2b439a4c80677172be9bfa3ad59227a7e219ae9a Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Dec 2020 15:45:23 +0200 Subject: [PATCH 78/91] update travelobfhelper --- .../osmand/plus/resources/ResourceManager.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 5d5ca05c96..85fc4b43df 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -801,9 +801,21 @@ public class ResourceManager { return warnings; } - private void collectTravelFiles(BinaryMapIndexReader mapReader, BinaryMapReaderResource resource) { - BinaryMapIndexReader index = mapReader; - for (BinaryIndexPart p : index.getPoiIndexes()) { + private List getTravelRepositories() { + List fileNames = new ArrayList<>(travelRepositories.keySet()); + Collections.sort(fileNames, Algorithms.getStringVersionComparator()); + List res = new ArrayList<>(); + for (String fileName : fileNames) { + BinaryMapReaderResource r = travelRepositories.get(fileName); + if (r != null) { + res.add(r.getReader(BinaryMapReaderResourceType.POI)); + } + } + return res; + } + + private void collectTravelFiles(BinaryMapReaderResource resource) { + for (BinaryMapIndexReader index : getTravelRepositories()){ travelRepositories.put(index.getFile().getName(), resource); } } From 89ad77ba0248bbe57bd188879f13bd53f5b580c7 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Dec 2020 16:54:14 +0200 Subject: [PATCH 79/91] travel obf helper updated --- .../plus/resources/ResourceManager.java | 36 ++++++++++--- .../plus/wikivoyage/data/TravelObfHelper.java | 53 +------------------ 2 files changed, 30 insertions(+), 59 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 85fc4b43df..8f8c93a3d8 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -19,10 +19,8 @@ import net.osmand.IndexConstants; import net.osmand.Location; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; -import net.osmand.binary.BinaryIndexPart; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader.SearchPoiTypeFilter; -import net.osmand.binary.BinaryMapPoiReaderAdapter; import net.osmand.binary.CachedOsmandIndexes; import net.osmand.data.Amenity; import net.osmand.data.RotatedTileBox; @@ -78,6 +76,7 @@ import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; +import static net.osmand.IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT; import static net.osmand.IndexConstants.VOICE_INDEX_DIR; /** @@ -636,6 +635,7 @@ public class ResourceManager { collectFiles(roadsPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); if (Version.isPaidVersion(context)) { collectFiles(context.getAppPath(IndexConstants.WIKI_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); + collectFiles(context.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); } if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isSubscribedToLiveUpdates(context)) { collectFiles(context.getAppPath(IndexConstants.SRTM_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); @@ -728,7 +728,10 @@ public class ResourceManager { } renderer.initializeNewResource(progress, f, mapReader); BinaryMapReaderResource resource = new BinaryMapReaderResource(f, mapReader); - + if (collectTravelFiles(resource)){ + //travel files are indexed + continue; + } fileReaders.put(f.getName(), resource); if (!mapReader.getRegionNames().isEmpty()) { RegionAddressRepositoryBinary rarb = new RegionAddressRepositoryBinary(this, resource); @@ -737,7 +740,6 @@ public class ResourceManager { if (mapReader.hasTransportData()) { transportRepositories.put(f.getName(), resource); } - collectTravelFiles(mapReader, resource); // disable osmc for routing temporarily due to some bugs if (mapReader.containsRouteData() && (!f.getParentFile().equals(liveDir) || context.getSettings().USE_OSM_LIVE_FOR_ROUTING.get())) { @@ -814,10 +816,30 @@ public class ResourceManager { return res; } - private void collectTravelFiles(BinaryMapReaderResource resource) { - for (BinaryMapIndexReader index : getTravelRepositories()){ - travelRepositories.put(index.getFile().getName(), resource); + private List getTravelRepositories(double topLat, double leftLon, double bottomLat, double rightLon) { + List fileNames = new ArrayList<>(transportRepositories.keySet()); + Collections.sort(fileNames, Algorithms.getStringVersionComparator()); + List res = new ArrayList<>(); + for (String fileName : fileNames) { + int topx31 = MapUtils.get31TileNumberX(topLat); + int leftx31 = MapUtils.get31TileNumberY(leftLon); + int bottomx31 = MapUtils.get31TileNumberX(bottomLat); + int rightx31 = MapUtils.get31TileNumberY(rightLon); + BinaryMapReaderResource r = transportRepositories.get(fileName); + if (r != null && + r.getShallowReader().containsPoiData(topx31, leftx31, bottomx31, rightx31)) { + res.add(r.getReader(BinaryMapReaderResourceType.TRANSPORT)); + } } + return res; + } + + private boolean collectTravelFiles(BinaryMapReaderResource resource) { + if (resource.getFileName().contains(BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT)){ + travelRepositories.put(resource.getFileName(), resource); + return true; + } + return false; } public void initMapBoundariesCacheNative() { diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index b162fa8698..df54776ab8 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -29,14 +29,11 @@ public class TravelObfHelper implements TravelHelper { private static final Log LOG = PlatformUtil.getLog(TravelObfHelper.class); - private static final int POPULAR_LIMIT = 25; private final OsmandApplication application; private TravelLocalDataHelper localDataHelper; - private List files; - private List existingTravelBooks = new ArrayList<>(); private List popularArticles = new ArrayList(); @@ -68,31 +65,7 @@ public class TravelObfHelper implements TravelHelper { @NonNull public List search(final String searchQuery) { - // TODO remove - //this.files = application.getResourceManager().getTravelFiles(); List res = new ArrayList<>(); -// List searchObjects = new ArrayList<>(); -// for (BinaryMapIndexReader reader : files) { -// try { -// BinaryMapIndexReader.SearchRequest searchRequest = BinaryMapIndexReader. -// buildSearchPoiRequest(0, 0, searchQuery, -// 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null); -// -// searchObjects = reader.searchPoiByName(searchRequest); -// } catch (IOException e) { -// LOG.error(e); -// } -// } -// for (MapObject obj : searchObjects) { -// //TODO map -// WikivoyageSearchResult r = new WikivoyageSearchResult(); -// r.articleTitles = Collections.singletonList(obj.getName()); -// r.langs = Collections.singletonList(obj.getName()); -// r.imageTitle = (obj.getName()); -// r.isPartOf = Collections.singletonList(obj.getName()); -// r.routeId = "routeid";//obj.getId(); -// res.add(r); -// } return res; } @@ -132,14 +105,6 @@ public class TravelObfHelper implements TravelHelper { return popularArticles; } - public String formatTravelBookName(File tb) { - if (tb == null) { - return application.getString(R.string.shared_string_none); - } - String nm = tb.getName(); - return nm.substring(0, nm.indexOf('.')).replace('_', ' '); - } - public String getGPXName(TravelArticle article) { return article.getTitle().replace('/', '_').replace('\'', '_') .replace('\"', '_') + IndexConstants.GPX_FILE_EXT; @@ -156,8 +121,7 @@ public class TravelObfHelper implements TravelHelper { @Override public String getSelectedTravelBookName() { - //TODO REPLACE - return "OBF TRAVEL BOOK"; + return null; } public static boolean checkIfObfFileExists(OsmandApplication app) { @@ -171,19 +135,4 @@ public class TravelObfHelper implements TravelHelper { } return false; } - - // might use in future - protected static class PopularArticle { - String tripId; - String title; - String lang; - int popIndex; - int order; - double lat; - double lon; - - public boolean isLocationSpecified() { - return !Double.isNaN(lat) && !Double.isNaN(lon); - } - } } From 358590cd6806172677f33ab15352d05e40fe6142 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Dec 2020 17:12:25 +0200 Subject: [PATCH 80/91] small changes --- .../osmand/plus/resources/ResourceManager.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 8f8c93a3d8..87d06fd936 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -75,7 +75,6 @@ import java.util.Map.Entry; import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; - import static net.osmand.IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT; import static net.osmand.IndexConstants.VOICE_INDEX_DIR; @@ -817,18 +816,17 @@ public class ResourceManager { } private List getTravelRepositories(double topLat, double leftLon, double bottomLat, double rightLon) { - List fileNames = new ArrayList<>(transportRepositories.keySet()); + List fileNames = new ArrayList<>(travelRepositories.keySet()); Collections.sort(fileNames, Algorithms.getStringVersionComparator()); + int leftX31 = MapUtils.get31TileNumberX(leftLon); + int topX31 = MapUtils.get31TileNumberY(topLat); + int rightX31 = MapUtils.get31TileNumberX(rightLon); + int bottomX31 = MapUtils.get31TileNumberY(bottomLat); List res = new ArrayList<>(); for (String fileName : fileNames) { - int topx31 = MapUtils.get31TileNumberX(topLat); - int leftx31 = MapUtils.get31TileNumberY(leftLon); - int bottomx31 = MapUtils.get31TileNumberX(bottomLat); - int rightx31 = MapUtils.get31TileNumberY(rightLon); - BinaryMapReaderResource r = transportRepositories.get(fileName); - if (r != null && - r.getShallowReader().containsPoiData(topx31, leftx31, bottomx31, rightx31)) { - res.add(r.getReader(BinaryMapReaderResourceType.TRANSPORT)); + BinaryMapReaderResource r = travelRepositories.get(fileName); + if (r != null && r.getShallowReader().containsPoiData(leftX31, topX31, rightX31, bottomX31)) { + res.add(r.getReader(BinaryMapReaderResourceType.POI)); } } return res; From 9b5982e3e6ca3ca960849396d77d0db71424d141 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Dec 2020 17:23:44 +0200 Subject: [PATCH 81/91] index name updated --- OsmAnd/src/net/osmand/plus/resources/ResourceManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 87d06fd936..c721da9507 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -634,7 +634,7 @@ public class ResourceManager { collectFiles(roadsPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); if (Version.isPaidVersion(context)) { collectFiles(context.getAppPath(IndexConstants.WIKI_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); - collectFiles(context.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); + collectFiles(context.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR), BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT, files); } if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isSubscribedToLiveUpdates(context)) { collectFiles(context.getAppPath(IndexConstants.SRTM_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); From 46c70865447b85e64236af52cd0834646dd8fbeb Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 15 Dec 2020 17:25:19 +0200 Subject: [PATCH 82/91] index name updated --- OsmAnd/src/net/osmand/plus/resources/ResourceManager.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index c721da9507..f8c25683db 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -75,7 +75,6 @@ import java.util.Map.Entry; import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; -import static net.osmand.IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT; import static net.osmand.IndexConstants.VOICE_INDEX_DIR; /** @@ -634,7 +633,7 @@ public class ResourceManager { collectFiles(roadsPath, IndexConstants.BINARY_MAP_INDEX_EXT, files); if (Version.isPaidVersion(context)) { collectFiles(context.getAppPath(IndexConstants.WIKI_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); - collectFiles(context.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR), BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT, files); + collectFiles(context.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR), IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT, files); } if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isSubscribedToLiveUpdates(context)) { collectFiles(context.getAppPath(IndexConstants.SRTM_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); @@ -833,7 +832,7 @@ public class ResourceManager { } private boolean collectTravelFiles(BinaryMapReaderResource resource) { - if (resource.getFileName().contains(BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT)){ + if (resource.getFileName().contains(IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT)){ travelRepositories.put(resource.getFileName(), resource); return true; } From 218827218ed3e94d39fb58c796807755bd1ad591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Tue, 15 Dec 2020 09:18:43 +0000 Subject: [PATCH 83/91] Translated using Weblate (Turkish) Currently translated at 100.0% (3581 of 3581 strings) --- OsmAnd/res/values-tr/strings.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index 861cfc3d9c..b018a39601 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -3781,8 +3781,8 @@ Ardından, bu seçeneği kullanmak için navigasyon profillerinizden biriyle izlenen yolunuzu izin verilen en yakın yola tutturun. Yeni bir izleme olarak kaydet Ters güzergah - Tüm yol, seçilen profil kullanılarak yeniden hesaplanacaktır. - Sadece sonraki bölüm, seçilen profil kullanılarak yeniden hesaplanacaktır. + Tüm yol, seçilen profil kullanılarak yeniden hesaplanacak. + Yalnızca sonraki bölüm, seçilen profil kullanılarak yeniden hesaplanacak. Düz bir çizgi ile noktaların nasıl birleştirileceğini veya aşağıda belirtildiği gibi aralarında nasıl güzergah hesaplanacağını seçin. Tüm yol Sonraki bölüm @@ -3818,15 +3818,15 @@ Adres sil Adres ekle Adres girin - Sadece güzergah hattı kaydedilecek, ara noktalar silinecektir. + Yalnızca güzergah hattı kaydedilecek, ara noktalar silinecek. Dosya adı Sistem öntanımlı değeri Sonraki tüm bölümler Önceki bölüm Önceki tüm bölümler - Sadece seçili bölüm, seçilen profil kullanılarak yeniden hesaplanacaktır. - Sonraki tüm bölümler, seçilen profil kullanılarak yeniden hesaplanacaktır. - Önceki tüm bölümler, seçilen profil kullanılarak yeniden hesaplanacaktır. + Yalnızca seçilen bölüm, seçilen profil kullanılarak yeniden hesaplanacak. + Sonraki tüm bölümler, seçilen profil kullanılarak yeniden hesaplanacak. + Önceki tüm bölümler, seçilen profil kullanılarak yeniden hesaplanacak. Yol güzergahı Yolu takip et Takip edilecek yol dosyasını seçin @@ -3971,4 +3971,6 @@ \n • Sık kullanılanlar ve yol ara noktaları için özel renk desteği \n \n + OsmAnd profili + Kullanıcı profili \ No newline at end of file From e15e940a598862874385a96c336fa198e6edef9b Mon Sep 17 00:00:00 2001 From: Ahmad Alfrhood Date: Tue, 15 Dec 2020 10:22:20 +0000 Subject: [PATCH 84/91] Translated using Weblate (Arabic) Currently translated at 100.0% (3581 of 3581 strings) --- OsmAnd/res/values-ar/strings.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index aca416ed50..1b5757ad14 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3781,7 +3781,7 @@ إعطاء معلومات وزن مركبتك ،قد يتم تطبيق بعض القيود على المركبات الثقيلة. حذف نقطة الوجهة التالية يرجى إعطاء اسم للنقطة - سيتم حذف نقطة الوجهة الحالية على المسار. إذا كانت هي الوجهة، سوف تتوقف الملاحة. + سيتم حذف نقطة الوجهة الحالية على المسار. إذا كانت هي الوجهة الرئيسية، سوف تتوقف الملاحة. تنزيل بيانات ويكيبيديا الحصول على معلومات حول النقاط المثيرة للاهتمام من ويكيبيديا. إنه دليلك غير المتصل بجيبك - ما عليك سوى تمكين المكون الإضافي ويكبيديا والاستمتاع بمقالات حول الكائنات من حولك. دراجة نارية @@ -3821,7 +3821,7 @@ بعد ذلك ، ألقط مسارك بأقرب طريق مسموح به باستخدام أحد أوضاع التنقل الخاصة بك لاستخدام هذا الخيار. بداية المسافة صور للشارع - هل أنت متأكد أنك تريد إغلاق مسار الخطة دون حفظ؟ سوف تفقد كل التغييرات؟ + هل أنت متأكد أنك تريد إغلاق مسار الرحلة دون حفظ؟ سوف تفقد كل التغييرات؟ في حالة الاتجاه المعاكس تسجيل المسار أثناء الملاحة حفظ كملف مسار جديد @@ -3855,7 +3855,7 @@ تغيير نوع المسار قبل تغيير نوع المسار بعد %s ملفات مسارات محددة - سيتم إيقاف تسجيل المسار مؤقتًا عند غلق التطبيق (عبر نافذة التطبيقات المستخدمة مؤخرا). (إشارة تشغيل التطبيق في الخلفية ستختفي من الشريط العلوي.) + سيتم إيقاف تسجيل المسار مؤقتًا عند إغلاق التطبيق (عبر نافذة التطبيقات المستخدمة مؤخرا). (إشارة تشغيل التطبيق في الخلفية ستختفي من الشريط العلوي.) حدد الفاصل الزمني للادخال الخاص بالتسجيل العام للمسار (مفعل من خلال ودجت \"تسجيل الرحلة\" على الخريطة). إيقاف تسجيل الرحلة مؤقتًا استئناف تسجيل الرحلة @@ -4003,4 +4003,6 @@ \n • دعم ألوان مخصصة للمفضلة ونقاط لمسار الطريق \n \n + ملف تعريف أوسماند + ملف تعريف المستخدم \ No newline at end of file From 391494b62a2f797bfd181cbc9dbd0e12c2c643fa Mon Sep 17 00:00:00 2001 From: ovl-1 Date: Tue, 15 Dec 2020 17:44:36 +0000 Subject: [PATCH 85/91] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 57.4% (2056 of 3581 strings) --- OsmAnd/res/values-nb/strings.xml | 113 ++++++++++++++++--------------- 1 file changed, 58 insertions(+), 55 deletions(-) diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 229c2c33d8..89b718abcd 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -271,7 +271,7 @@ Installer flere… Søk etter geografisk posisjon System - Velg visningsspråk (trer i kraft når OsmAnd startes på nytt). + Visningsspråk (brukes etter at OsmAnd er startet på nytt). Visningsspråk Neste Forrige @@ -308,7 +308,7 @@ km km/t m - Foreldet kartdataformat \'\'{0}\'\' støttes ikke + Foreldet kartdataformat \'\'{0}\'\', ikke støttet Nærmeste interessepunkter Egendefinert filter Kunne ikke finne angitt mappe. @@ -772,7 +772,7 @@ Varslingslyd Media-/navigasjonslyd Bruk rasterkart for alt utover dette nivået. - Minste vektorielle forstørrelsesnivå + Minste vektor-zoomnivå ufullstendig Velg en taleveiledningspakke Maksimal forstørrelse å forhåndslaste @@ -1480,7 +1480,7 @@ Kartmodus Følg oss OsmAnd Live-navigering - Reisemål er ikke angitt + Tilgjengelighetstillegg: Ingen reisemål angitt Naviger opp OSM-brukernavn og passord OsmAnd Live-abonnement @@ -1720,7 +1720,7 @@ Minste tidsintervall mellom annonseringer. Redigeringer %1$s, rang %2$s, redigeringer totalt %3$s Rangering av OSM-bidragsytere - Behøves for å gi deg info om dine bidrag. + Behøves for å oppdatere deg om dine bidrag. Støttet region Takk for at du støtter OsmAnd! \nFor å aktivere alle nye funksjoner må du starte OsmAnd på nytt. @@ -1998,7 +1998,7 @@ Ingenting funnet Endre søket eller øk radiusen. Analyser på kartet - Helning + Bakkehelning Rutehøydeprofil Nedstigning Stigning @@ -2058,7 +2058,7 @@ Lagre spor som er tatt opp, i undermapper per opptaksmåned (f.eks. 2018-01). Last kartfliser på nytt for å se oppdaterte data. Kartflis-hurtigbuffer - Kun vis tillagte bilder + Vis bare bilder som er lagt til Linje Lagre som rutepunkter Lagre som linje @@ -2078,7 +2078,7 @@ Legg til rutepunkter Legg til linje Ingen animasjoner - Slår av animasjoner i programmet. + Slår av kartanimasjoner. Fortsett å vise på kartet Avslutte uten å lagre\? Vis bare bilder lagt til av @@ -2301,7 +2301,7 @@ Favoritterkategori Opprett kartmarkører! Lang- eller korttrykk \'Steder\', deretter trykk markørflaggknappen. - Markører markert som passert vises på denne skjermen. + Markører merket som passerte vises på denne skjermen. Antall desimaler Høyre Venstre @@ -2318,7 +2318,7 @@ «Ett-trykk» aktiv Ta notater! Legg til lyd-, video- eller bildenotater til et hvilket som helst punkt på kartet ved bruk av modul eller lokalmeny. - Notater etter dato + Lyd/video-notater etter dato Etter dato Etter type Mer @@ -2329,12 +2329,12 @@ Endre OSM-notat Mørkegul Gjennomskinnelig rosa - Endre søket ditt. + Endre søket. Ser etter spor med rutepunkter Spor-rutepunkter Importer grupper fra favoritter eller GPX-rutepunkter. Importer favorittgrupper eller rutepunkter som markører. - Vis retningsbestemte linjer fra din posisjon til de aktive markørplasseringene. + Vis retningslinje fra din posisjon til de aktive markørplasseringene. Vis én eller to piler som indikerer retningen til de aktive markørene. Velg hvordan avstanden til aktive markører skal vises. Velg antall retningsindikatorer. @@ -2366,7 +2366,7 @@ Byggversion {0} ble installert ({1}). Vis interessepunktstelefon Ikke strekk (og gjør uskarpe) kartfliser på høyoppløselige skjermer. - Finner ingen GPX-filer i spormappen + Ingen GPX-filer funnet i spormappen Skriv for å finne interessepunkt Setter høyeste tillatte ventetid for hver bakgrunns-posisjonsbestemmelse. Maksimal ventetid for posisjonsbestemmelse @@ -2719,13 +2719,13 @@ \n • Lar deg velge hvordan du vil vise navn på kartet: På engelsk, lokale navn, eller fonetisk staving \n • Viser spesialiserte nettbaserte kartfliser, satellittvisning (fra Bing), forskjellige overlegg som GPX-spor til tur/navigering og ytterligere lag med tilpassbar gjennomsiktighet \n - Kartvisning -\n • Vis din posisjon og retning -\n • Eventuelt orienter kartet etter kompass eller bevegelsesretning -\n • Lagre dine viktigste steder som favoritter -\n • Vis interessepunkter rundt deg -\n • Vis spesialiserte nettbaserte kartfliser, satellittvisning (fra Bing), forskjellige overlegg som GPX-spor til tur/navigering og ytterligere lag med tilpassbar gjennomsiktighet -\n • Valgfri visning av stedsnavn på engelsk, lokalt språk, eller fonetisk staving + Kartvisning +\n • Vis din posisjon og retning +\n • Orienter kartet etter eget valg i henhold til kompass eller bevegelsesretning +\n • Lagre dine viktigste steder som favoritter +\n • Vis interessepunkter rundt deg +\n • Vis spesialiserte nettbaserte kartfliser, satellittvisning (fra Bing), forskjellige overlegg som GPX-spor til tur/navigering og ytterligere lag med tilpassbar gjennomsiktighet +\n • Valgfri visning av stedsnavn på engelsk, lokalt språk, eller fonetisk staving \n Bruk OSM- og Wikipedia-data \n • Høykvalitetsinfo fra de beste samarbeidsprosjektene i verden @@ -3086,9 +3086,9 @@ Velg profilene du vil ha synlig i programmet. Programprofiler Bruk WunderLINQ for styring - Alpint/utfor + Alpin skisport Kjelke - Løyper for kjelkebruk. + Bakker for kjelkebruk. Tillat avanserte ruter Tillat ekspertruter Tillat løyper kun for skøyting @@ -3109,7 +3109,7 @@ Alle typer offentlig transport Endre kartforstørrelse ved å rulle hjulet opp og ned. Escape tar deg tilbake til WunderLINQ-programmet. Legg til minst ett element i listen i hurtighandlingsinnstillingene - Bakker for alpint eller utfor og tilgang til skiheiser. + Bakker for alpin skisport og tilgang til skiheiser. Langrenn Løyper for langrenn. Skigåing @@ -3321,12 +3321,12 @@ Parrot Skru på minst én programprofil for å bruke denne innstillingen. Vintervei - Fast (asfaltert) - Fast (uasfaltert) - For det meste fast - For det meste mykt - Mykt - Flatefasthet + Hard (fast dekke) + Hard (uten fast dekke) + For det meste hard + For det meste myk + Myk + Overflatefasthet Åpne spor Sporet %s ble lagret Fjern mellomrom @@ -3367,8 +3367,8 @@ Forbindelse Skitur Alpint - Begynner - Enkelt + Nybegynner + Enkel Middels Avansert Ekspert @@ -3439,7 +3439,7 @@ Brukernavn og passord Disse programtillegg-innstillingene er globale og gjelder for alle profiler OSM-redigering - Du kan vise alle dine uopplastede redigeringer eller OSM-feil i %1$s. Opplastede punkter viser ikke i OsmAnd. + Vis alle redigeringene dine som ikke er lastet opp ennå eller OSM-feil i %1$s. Endringer som allerede er lastet opp vises ikke lenger. Ikon vist under navigering eller bevegelse. Ikon vist i hviletilstand. Bruk systemprogram @@ -3524,7 +3524,7 @@ Ustøttet handling %1$s Ekstra kart Skillelinje - Det kan hende noen Wikipedia-artikler ikke finnes på norsk. + Noen Wikipedia-artikler er kanskje ikke tilgjengelige på ditt språk. Egendefinert farge Søk etter interessepunkttyper Hurtighandling @@ -3581,8 +3581,8 @@ All data fra %1$s er importert, du kan bruke knappene nedenfor for å åpne den delen du trenger for å håndtere den. Alle profilinnstillinger blir gjenopprettet til deres opprinnelige tilstand etter opprettelse/import av denne profilen. Er du sikker på at du vil tømme lagret data\? - Anvis ny rute ved avvik - Løyper + Beregn rute på nytt ved avvik + Bakkehelninger Skuffeelementer, lokalmeny Grensesnittstilpasning Skuff @@ -3593,8 +3593,8 @@ Nåværende elementer vil erstattes med elementer fra filen Minimumsvinkel mellom min plassering og rute Importer opptegningsfil - Løyper bruker farger for å visualisere bratthet. - Ytterligere kart trengs for å vise løyper på kartet. + Bakkehelningskart bruker farger for å visualisere terrengbratthet. + Ekstra kart er nødvendige for å vise bakkehelninger på kartet. Abonnement - OsmAnd Live Gjenopprett forvalgt elementrekkefølge Fant ingen slike profiler. @@ -3605,20 +3605,20 @@ Ingen ny beregning Angi et navn for profilen Velg data å importere. - Du kan lese mer om løyper i %1$s. + Du kan lese mer om helninger på %1$s. Omarranger eller skjul elementer fra %1$s. Elementer under dette punktet er atskilt med en skillelinje. Skjuling av innstillinger tilbakestiller dem til opprinnelig tilstand. Skigåing Ustøttet type - Velg hvor mye avviksdistanse som skal utløse omruting. + Velg avstanden som skal til for å beregne ruten på nytt. Du kan velge ytterligere data å eksportere sammen med profilen. Importer profil inneholder ytterligere data. Klikk «Import» for å importere kun profildata, eller velg ytterligere data. Alle programtilleggsinnstillinger tilbakestilt til standard. Du kan legge til en ny egendefinert kategori ved å velge én eller flere kategorier. Endre listens sorteringsrekkefølge, skjul unødvendige kategorier. Du kan importere eller eksportere alle endringer med profiler. Omorganiser kategorier - Ruten vil bli kalkulert igjen hvis distansen til ruten er lengre enn angitt parameter + Ruten blir beregnet på nytt hvis avstanden til ruten er lengre enn angitt parameter Dette programtillegget er et eget program, du vil måtte fjerne det for seg hvis du ikke lenger vil bruke det. \n \nDette programtillegget vil forbli på enheten etter fjerning av OsmAnd. @@ -3627,7 +3627,7 @@ \n \nSlå av ubrukte programtillegg for å skjule alle deres styringskontroller. %1$s. Disse elementene er skjult fra menyen, men de representerte valgene eller programtilleggene vil fortsette å virke. - Velg språkene Wikipedia-artikler skal vises på i kartet. Du kan bytte mellom alle tilgjengelige språk mens du leser artikkelen. + Velg språkene for Wikipedia-artikler på kartet. Bytt til hvilket som helst tilgjengelig språk mens du leser artikkelen. Veiledning til kartets symbolbruk. Ruteplanlegging Minsteavstand for å beregne rute på nytt @@ -3695,7 +3695,7 @@ Egendefinert Retningspiler tonn - Rut mellom punkter + Rute mellom punkter Enduro-motorsykkel Skjermkontroll Bruk systemets skjermtidsavbrudd @@ -3778,17 +3778,17 @@ Avskrudd som forvalg: Skjermen vil ikke slås av så lenge OsmAnd kjører i forgrunnen. \n \nHvis påskrudd vil OsmAnd bruke systemets innstilling for skjermtidsavbrudd. - Skru på for å vise relieffskygge eller skråningskart. Du kan lese mer om disse karttypene på siden vår. + Slå på for å vise relieffskygge- eller bakkehelningskart. Du kan lese mer om disse karttypene på vårt nettsted. «Tilbakestill til forvalg» gjenoppretter sorteringsrekkefølgen til installasjonsforvalg. - Relieffskyggekart som bruker mørke skygger for å vise skråninger, topper og lavland. - Ruten vil regnes ut igjen hvis avstanden fra ruten til nåværende posisjon er mer enn valgt verdi. + Relieffskyggekart bruker mørke skygger for å vise bakkehelninger, topper og lavland. + Ruten blir beregnet på nytt hvis avstanden fra ruten til nåværende posisjon er større enn valgt verdi. Betaling vil bli belastet din Google Play-konto ved bekreftelse av kjøp. \n \n Abonnement fornyes automatisk med mindre det avbrytes før fornyelsesdatoen. Din konto vil bli belastet for fornyelsesperioden (måned/tre måneder/år) kun på fornyelsesdatoen. \n \n Du kan håndtere og avbryte dine abonnementer ved å gå til dine Google Play-innstillinger. Angi når skjermen skal vekkes opp (forsikre deg om at OsmAnd er i forgrunnen når enheten låses): - Sett minste og største forstørrelsesnivå å vise eller laste inn på nettbasert kart. + Still inn minimum og maksimum zoomnivå for å vise eller laste det nettbaserte kartet. Har innvirkning på om skjermen skal brukes som kart eller overlag/underlag. \n \n%1$s: Kartet er begrenset til valgt forstørrelsesrekkevidde. @@ -3803,13 +3803,13 @@ \n \nVelg %2$s. Alle data som har med fotobokser å gjøre: varsler, meldinger og interessepunkter blir slettet til OsmAnd er fullstendig installert på nytt. Å utføre disse endringene vil tømme hurtiglagret data for denne fliskilden. - Hent info om interessepunkter fra Wikipedia. Det er din frakoblede lommeguide - bare skru på Wikipedia-programtillegget og få artikler om objekter rundt deg. + Få info om interessepunkter fra Wikipedia, en nettfrakoblet lommeguide med artikler om steder og reisemål. Utfylt - Betaling vil bli belastet din programgalleri-konto ved bekreftelse av kjøp. + Betalingen blir belastet din AppGallery-konto ved bekreftelse på kjøp. \n -\nAbonnementet fornyes automatisk med mindre det avbrytes før fornyelsesdatoen. Din konto bil bli belastet for fornyelse for hver fornyelsesperiode (måned/tre måneder/år) kun på fornyelsesdatoen. +\nAbonnementet forlenges automatisk med mindre det avbrytes før fornyelsesdatoen. Din konto blir belastet for fornyelsesperioden (måned/tre måneder/år) kun på fornyelsesdatoen. \n -\nDu kan håndtere og avbryte ditt abonnement ved å gå gjennom dine programgalleri-innstillinger. +\nDu kan håndtere og avbryte dine abonnementer i dine AppGallery-innstillinger. OsmAnd-GPX er feilformatert, kontakt brukerstøtte for videre etterforskning. Skrur av skjermen i henhold til systemets skjermtidsavbrudd. Angi lengden på ditt kjøretøy, noen rutebegrensninger kan gjelde for lange kjøretøy. @@ -3825,7 +3825,7 @@ Legg til spor-rutepunkt Legg til spor-rutepunkt To-fase-ruting for bilnavigering. - Abonnement påløper per valgte periode. Avbryt det når som helst fra programgalleriet. + Abonnementet belastes for den valgte perioden. Avbryt det når som helst i AppGallery. Følg veier Minimumsforskyvning Radiuspasser @@ -3848,7 +3848,7 @@ Kompleks ruting Unngå gangveier Unngå gangveier - Ekstra rett segment mellom min posisjon og utregnet rute vil bli vist til den er regnet ut på ny + Ekstra rett segment mellom min posisjon og beregnet rute blir vist til ruten er beregnet på nytt OsmAnd sjekker %1$s for duplikater med eksisterende elementer i programmet. \n \nDet kan ta noe tid. @@ -3862,7 +3862,7 @@ Utvikling OsmAnd-sanntidsdata OsmAnd-sanntidsdata - Utfør OAuth-innlogging for å bruke osmedit-funksjoner + Logg inn med OAuth for å bruke osmedit-funksjoner Fjern OpenStreetmap-OAuth-symbol Logg inn via OAuth Hva er nytt @@ -3873,7 +3873,7 @@ \nGraf vil være tilgjengelig etter omberegning av ruten. %1$s — %2$s Graf - %1$s-data er tilgjengelig kun på veiene, du må beregne en rute med “Rut mellom punkter”. + %1$s-data er tilgjengelig kun på veiene, beregn en rute med “Rute mellom punkter” for å se grafer. Spor rute Spesiell OsmAnd bruker MGRS, som ligner UTM NATO-format @@ -3900,7 +3900,7 @@ Lukk OSM-notat Kommenter OSM-notat Skriv inn etiketter inndelt med komma. - Det er et problem med abonnementet ditt. Trykk på knappen for å gå til Google Play-abonnementsinnstillingene for å fikse betalingsmåten din. + Trykk på knappen for å sette opp en betalingsmåte på Google Play for å fikse ditt abonnement. OsmAnd-Live-abonnement utløpt OsmAnd-Live-abonnement har blitt satt på vent OsmAnd-Live-abonnement på vent @@ -3936,4 +3936,7 @@ Del før Del etter Legg til et nytt segment + Logg inn på OpenStreetMap.org + OsmAnd-profil + Brukerprofil \ No newline at end of file From 29754cd5f3f64a19668bc92db7e83f397b822892 Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Tue, 15 Dec 2020 00:38:28 +0000 Subject: [PATCH 86/91] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3581 of 3581 strings) --- OsmAnd/res/values-pt-rBR/strings.xml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index 2ea328bca8..331af6bd93 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -1874,7 +1874,7 @@ Mova o mapa para reposicionar o marcador Navegação OsmAnd Live - Destino não definido + Plug-in de acessibilidade: sem destino definido Desabilitar recálculo de rota depois de ter saído de rota. Desabilitar recálculo de rota se só estiver se movendo na direção oposta. Siga-nos @@ -2062,7 +2062,7 @@ Botão para mostrar ou ocultar notas do OSM no mapa. Classificado por distância Pesquisar Favoritos - Baixe o mapa \'Hillshade Overlay\' para mostrar o sombreamento vertical. + Baixe o mapa de sombreado para mostrar o sombreamento vertical. Instale o plugin \'Curvas de nível\' para mostrar declividades. Ocultar a partir do nível de zoom Baixe o mapa \'Curvas de nível\' para usar nesta região. @@ -3423,7 +3423,7 @@ Usuário e senha Essas configurações de plug-in são globais e se aplicam a todos os perfis Edição OSM - Você pode ver todas as suas edições ainda não carregadas ou erros de OSM em %1$s. Os pontos carregados não aparecem no OsmAnd. + Veja todas as suas edições ainda não carregadas ou erros de OSM em %1$s. As alterações já enviadas não aparecerão mais. OSM Ícone mostrado ao navegar ou mover. Ícone mostrado em repouso. @@ -3787,9 +3787,9 @@ Forneça o comprimento do seu veículo. Algumas restrições de rotas podem ser aplicadas a veículos longos. Apagar o ponto de destino mais próximo Forneça um nome para o ponto - O ponto de destino atual na rota será excluído. Se for o destino, a navegação será interrompida. + Exclui o próximo destino da sua rota. Se esse for o destino final, a navegação será interrompida. Baixar mapas da Wikipédia - Obtenha informações sobre pontos de interesse na Wikipédia. É o seu guia offline de bolso - basta ativar o plug-in da Wikipédia e desfrutar dos artigos sobre os objetos ao seu redor. + Obtenha informações sobre pontos de interesse na Wikipédia, um guia off-line de bolso com artigos sobre lugares e destinos. Motocicleta enduro Motoneta Cadeira de rodas @@ -3829,7 +3829,7 @@ Perfil de navegação Selecione um arquivo de trilha para o qual um novo segmento será adicionado. Imagens de rua - Tem certeza de que deseja descartar todas as alterações no percurso planejado, fechando-o\? + Tem certeza de que deseja descartar todas as alterações no percurso planejado\? Em caso de direção reversa Salvar como novo arquivo de trilha Trilhas @@ -3866,7 +3866,7 @@ Apenas a linha da rota será salva, os waypoints serão excluídos. Nome do arquivo %s arquivos de trilha selecionados - Pausará o registro de rastreamento quando o aplicativo for encerrado (por meio de aplicativos recentes). (A indicação de uso em segundo plano do OsmAnd desaparece da barra de notificação do Android.) + O registro de trilhas fará uma pausa quando o aplicativo for encerrado (por meio de aplicativos recentes). (A indicação de segundo plano do OsmAnd desaparece da barra de notificação do Android.) Especifique o intervalo de registro para a gravação geral da trilha (ligado por meio do widget de \'gravação de viagem\' no mapa). Pausar gravação de viagem Retomar a gravação da viagem @@ -3901,12 +3901,12 @@ Nome: A – Z Ícones de início e término Obrigado por adquirir \'curvas de nível\' - Assinatura cobrada por período selecionado. Cancele no AppGallery a qualquer momento. - O pagamento será cobrado em sua conta AppGallery na confirmação da compra. + A assinatura é cobrada de acordo com o período selecionado. Cancele em seu AppGallery a qualquer momento. + Sua conta AppGallery é cobrada após a confirmação da compra. \n -\nA assinatura é renovada automaticamente, a menos que seja cancelada antes da data de renovação. Sua conta será cobrada pelo período de renovação (mês/três meses/ano) apenas na data de renovação. +\nA assinatura se prolonga automaticamente, a menos que seja cancelada antes da data de renovação. Sua conta será cobrada pelo período de renovação (mês/três meses/ano) apenas na data de renovação. \n -\nVocê pode gerenciar e cancelar suas assinaturas acessando as configurações do AppGallery. +\nVocê pode gerenciar e cancelar suas assinaturas nas configurações do AppGallery. Evite passarelas Evite passarelas Desenvolvimento @@ -3943,7 +3943,7 @@ OsmAnd usa MGRS, que é semelhante ao formato UTM NATO. Adicione pelo menos dois pontos Gerenciar assinatura - Há um problema com sua assinatura. Toque no botão para ir para as configurações de assinatura do Google Play para corrigir sua forma de pagamento. + Toque no botão para configurar um método de pagamento no Google Play para corrigir sua assinatura. A assinatura do OsmAnd Live expirou A assinatura do OsmAnd Live foi pausada A assinatura do OsmAnd Live está em espera @@ -4011,4 +4011,6 @@ Dividir antes Dividir depois Adicionar novo segmento + Perfil do OsmAnd + Perfil de usuário \ No newline at end of file From 7315de06d6b0dc5177c536ea6c715bcaa1be1ad9 Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Tue, 15 Dec 2020 00:46:34 +0000 Subject: [PATCH 87/91] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3873 of 3873 strings) --- OsmAnd/res/values-pt-rBR/phrases.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OsmAnd/res/values-pt-rBR/phrases.xml b/OsmAnd/res/values-pt-rBR/phrases.xml index 1e72bd8f63..466eae1657 100644 --- a/OsmAnd/res/values-pt-rBR/phrases.xml +++ b/OsmAnd/res/values-pt-rBR/phrases.xml @@ -3886,4 +3886,12 @@ Base do salva-vidas Vacinação: COVID19 Vacinação + Lago + Rio + Poço de água + Bomba motorizada + Tanque de água + Toque + Estação de tratamento de água + Bem embalado \ No newline at end of file From 3ba88d9bc2e78d29ed64e7f92ab3492e6bdaf5f9 Mon Sep 17 00:00:00 2001 From: Verdulo Date: Mon, 14 Dec 2020 23:38:09 +0000 Subject: [PATCH 88/91] Translated using Weblate (Esperanto) Currently translated at 100.0% (3581 of 3581 strings) --- OsmAnd/res/values-eo/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index c653554cfe..563bf3a276 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -4015,4 +4015,6 @@ \n • propraj koloroj por ŝatataj ejoj kaj navigadpunktoj de spuro \n \n + OsmAnd‑profilo + Profilo de uzanto \ No newline at end of file From 1b201f90947e99d7fb74a75b225a5cb9510ad4f5 Mon Sep 17 00:00:00 2001 From: Selyan Sliman Amiri Date: Tue, 15 Dec 2020 11:51:18 +0000 Subject: [PATCH 89/91] Translated using Weblate (Kabyle) Currently translated at 36.6% (1314 of 3581 strings) --- OsmAnd/res/values-b+kab/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-b+kab/strings.xml b/OsmAnd/res/values-b+kab/strings.xml index 8a49267439..54589361a3 100644 --- a/OsmAnd/res/values-b+kab/strings.xml +++ b/OsmAnd/res/values-b+kab/strings.xml @@ -1340,4 +1340,6 @@ Fren afaylu n uḍfar iɣer ara yernu uḥric amaynut. Tebɣiḍ s tidet ad tmedleḍ abrid n uɣawas war asekles\? Ad tesruḥeḍ akk ibeddilen. Ittwasekles + Amaɣnu OsmAnd + Amaɣnu n useqdac \ No newline at end of file From f10dc798cce3e09e257d00cf20ff7f9b30201620 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Tue, 15 Dec 2020 02:18:45 +0000 Subject: [PATCH 90/91] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3581 of 3581 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 11c909591e..990ccc8531 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -1945,7 +1945,7 @@ 在通告之間的最短時間間隔。 相對方位 磁力方位 - 目的地未設定 + 無障礙外掛程式:未設定目的地 為 OsmAnd Live 變更啟用導航。 OsmAnd Live 導航 追蹤我們 @@ -2388,7 +2388,7 @@ 下載「等高線」地圖以在此區域使用。 外掛元件 購買並安裝「等高線」外掛程式以顯示垂直漸層區域。 - 下載「地形陰影覆蓋層」地圖以顯示垂直陰影。 + 下載「地形陰影」覆蓋層地圖以顯示垂直陰影。 安裝「等高線」外掛程式以顯示漸層垂直區域。 自此縮放等級開始隱藏 按距離排序 @@ -3429,7 +3429,7 @@ 無法解析地理含義「%s」。 您已紀錄的軌跡位於 %1$s,或是 OsmAnd 資料夾。 您的 OSM 註記位於 %1$s。 - 您可以在 %1$s 中檢視您所有尚未上傳的編輯或 OSM 臭蟲。已上傳的點不會在 OsmAnd 中顯示。 + 在 %1$s 中檢視您所有尚未上傳的編輯或 OSM 臭蟲。已上傳的更改將不會再顯示。 使用此選項需要權限。 這是一個低速過濾器,不記錄低於特定速度的點。在地圖上查看時,這可能會使記錄的軌跡看起來更平滑。 副作用:您的軌跡將會遺失所有未達到最低速度標準的部份(例如,您將自行車推上陡峭的山坡)。此外,也將沒有其餘的資訊,如休息等。這會影響任何分析或後處理,例如試圖確定行程的總長度,運動時間或平均速度時。 @@ -3789,9 +3789,9 @@ 提供您的車輛長度,某些路徑限制可能適用於較長的車輛。 刪除最近的目的地點 請提供點的名稱 - 目前路徑上的目的地點將會被刪除。如果其將為目的地,導航就會停止。 + 刪除您路線上的下一個目的地。如果其為您最後的目的地,導航將會中止。 下載維基百科地圖 - 從維基百科取得關於興趣點的資訊。這是您的離線口袋指南 ── 只要開啟維基百科外掛程式並享受有關於您周圍景點的文章。 + 從維基百科取得關於興趣點的資訊,這是一份袖珍離線指南,其中包含了地點與目的地的文章。 耐力賽摩托車 小型摩托車 輪椅 @@ -3944,7 +3944,7 @@ OsmAnd 使用 MGRS,其類似於 UTM NATO 格式。 新增至少兩個點 管理訂閱 - 您的訂閱似乎有點問題。點擊按鈕以跳到 Google Play 訂閱設定以修復您的付款方式。 + 點擊按鈕可在 Google Play 上設定付款方式來修復您的訂閱。 OsmAnd Live 訂閱已過期 OsmAnd Live 訂閱已暫停 OsmAnd Live 訂閱已暫停 @@ -4011,4 +4011,6 @@ \n • 支援自訂最愛與軌跡航點的顏色 \n \n + OsmAnd 設定檔 + 使用者設定檔 \ No newline at end of file From f22539ab4fa98636d16fe1985783edc59fd4e5dd Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Tue, 15 Dec 2020 02:22:24 +0000 Subject: [PATCH 91/91] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3873 of 3873 strings) --- OsmAnd/res/values-zh-rTW/phrases.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OsmAnd/res/values-zh-rTW/phrases.xml b/OsmAnd/res/values-zh-rTW/phrases.xml index 7d7cc6701b..3a13797bd1 100644 --- a/OsmAnd/res/values-zh-rTW/phrases.xml +++ b/OsmAnd/res/values-zh-rTW/phrases.xml @@ -3885,4 +3885,12 @@ 救生員基地 預防接種:COVID-19 預防接種 + + 河流 + + 動力幫浦 + 水箱 + 點擊 + 自來水廠 + 管井 \ No newline at end of file