Skip to content

Commit

Permalink
Merge pull request #16 from sonora/hardy_460_1
Browse files Browse the repository at this point in the history
Hardy 460 1
  • Loading branch information
sonora authored Sep 1, 2023
2 parents 33774af + 414ab61 commit 814b05e
Show file tree
Hide file tree
Showing 646 changed files with 16,368 additions and 9,044 deletions.
2 changes: 1 addition & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Credits to all major contributors / developers:
Major contributors / developers listed here https://github.com/osmandapp/osmandapp.github.io/blob/master/website/help/about.html#L8
Major contributors / developers listed [here](https://github.com/osmandapp/web/blob/main/main/src/components/content/About.mdx#L5).

### Other Pull requests
Copyright © All authors of translations and pull requests can be found in the commit history:
Expand Down
8 changes: 4 additions & 4 deletions OsmAnd-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apply plugin: 'ivy-publish'


android {
compileSdkVersion 33
buildToolsVersion "30.0.3"
compileSdk 33
buildToolsVersion = "33.0.2"

defaultConfig {
minSdkVersion 14
targetSdkVersion 31
targetSdkVersion 33
versionCode 2
versionName "2.0"
}
Expand Down Expand Up @@ -52,7 +52,7 @@ afterEvaluate {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'androidx.annotation:annotation:1.6.0'
}

task sourcesJar(type: Jar) {
Expand Down
35 changes: 21 additions & 14 deletions OsmAnd-api/src/net/osmand/aidlapi/OsmAndCustomizationConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@ public interface OsmAndCustomizationConstants {

// Configure Map:
String CONFIGURE_MAP_ITEM_ID_SCHEME = "map.configure.";
String SHOW_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "show.";
String RENDERING_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "rendering.";
String CUSTOM_RENDERING_ITEMS_ID_SCHEME = RENDERING_ITEMS_ID_SCHEME + "custom.";

String APP_PROFILES_ID = CONFIGURE_MAP_ITEM_ID_SCHEME + "app_profiles";

String SHOW_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "show.";
String SHOW_CATEGORY_ID = SHOW_ITEMS_ID_SCHEME + "category";
String FAVORITES_ID = SHOW_ITEMS_ID_SCHEME + "favorites";
String POI_OVERLAY_ID = SHOW_ITEMS_ID_SCHEME + "poi_overlay";
Expand All @@ -52,20 +49,31 @@ public interface OsmAndCustomizationConstants {
String MAP_SOURCE_ID = SHOW_ITEMS_ID_SCHEME + "map_source";
String MAP_BORDERS_ID = SHOW_ITEMS_ID_SCHEME + "map_borders";
String RECORDING_LAYER = SHOW_ITEMS_ID_SCHEME + "recording_layer";
String DEPTH_CONTOURS = SHOW_ITEMS_ID_SCHEME + "depth_contours";
String SHOW_DEPTH_CONTOURS = SHOW_ITEMS_ID_SCHEME + "depth_contours";
String MAPILLARY = SHOW_ITEMS_ID_SCHEME + "mapillary";
String OSM_NOTES = SHOW_ITEMS_ID_SCHEME + "osm_notes";
String OSM_EDITS = SHOW_ITEMS_ID_SCHEME + "osm_edits";
String OPEN_STREET_MAP = SHOW_ITEMS_ID_SCHEME + "open_street_map";
String OVERLAY_MAP = SHOW_ITEMS_ID_SCHEME + "overlay_map";
String UNDERLAY_MAP = SHOW_ITEMS_ID_SCHEME + "underlay_map";
String CONTOUR_LINES = SHOW_ITEMS_ID_SCHEME + "contour_lines";
String TERRAIN_ID = SHOW_ITEMS_ID_SCHEME + "terrain";
String TERRAIN_CATEGORY_ID = SHOW_ITEMS_ID_SCHEME + "terrain_category";
String TERRAIN_DESCRIPTION_ID = SHOW_ITEMS_ID_SCHEME + "terrain_description";
String WEATHER_ID = SHOW_ITEMS_ID_SCHEME + "weather";
String MAP_ENABLE_3D_MAPS_ID = SHOW_ITEMS_ID_SCHEME + "enable_3d_maps";

String TERRAIN_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "terrain.";
String TERRAIN_ID = TERRAIN_ITEMS_ID_SCHEME + "terrain";
String TERRAIN_PROMO_ID = TERRAIN_ITEMS_ID_SCHEME + "promo";
String TERRAIN_CATEGORY_ID = TERRAIN_ITEMS_ID_SCHEME + "category";
String TERRAIN_DESCRIPTION_ID = TERRAIN_ITEMS_ID_SCHEME + "description";
String CONTOUR_LINES = TERRAIN_ITEMS_ID_SCHEME + "contour_lines";
String RELIEF_3D_ID = TERRAIN_ITEMS_ID_SCHEME + "relief_3d";
String TERRAIN_DEPTH_CONTOURS = TERRAIN_ITEMS_ID_SCHEME + "depth_contours";

String OPEN_STREET_MAP_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "open_street_map.";
String OSM_NOTES = OPEN_STREET_MAP_ITEMS_ID_SCHEME + "osm_notes";
String OSM_EDITS = OPEN_STREET_MAP_ITEMS_ID_SCHEME + "osm_edits";
String OPEN_STREET_MAP_CATEGORY_ID = OPEN_STREET_MAP_ITEMS_ID_SCHEME + "category";

String ROUTES_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "routes.";
String ROUTES_CATEGORY_ID = ROUTES_ITEMS_ID_SCHEME + "category";

String RENDERING_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "rendering.";
String CUSTOM_RENDERING_ITEMS_ID_SCHEME = RENDERING_ITEMS_ID_SCHEME + "custom.";
String MAP_RENDERING_CATEGORY_ID = RENDERING_ITEMS_ID_SCHEME + "category";
String MAP_STYLE_ID = RENDERING_ITEMS_ID_SCHEME + "map_style";
String MAP_MODE_ID = RENDERING_ITEMS_ID_SCHEME + "map_mode";
Expand All @@ -75,7 +83,6 @@ public interface OsmAndCustomizationConstants {
String MAP_LANGUAGE_ID = RENDERING_ITEMS_ID_SCHEME + "map_language";
String DETAILS_ID = RENDERING_ITEMS_ID_SCHEME + "details";
String HIDE_ID = RENDERING_ITEMS_ID_SCHEME + "hide";
String ROUTES_ID = RENDERING_ITEMS_ID_SCHEME + "routes";

// Map Controls:
String HUD_BTN_ID_SCHEME = "map.view.";
Expand Down
2 changes: 1 addition & 1 deletion OsmAnd-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ publishing {

dependencies {
testImplementation 'junit:junit:4.12'
testImplementation 'com.google.code.gson:gson:2.8.2'
testImplementation 'org.hamcrest:hamcrest-core:1.3'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.2'
implementation 'com.google.code.gson:gson:2.8.9'
implementation group: 'org.json', name: 'json', version: '20171018'
implementation 'org.apache.commons:commons-compress:1.17'
implementation 'com.moparisthebest:junidecode:0.1.1'
Expand Down
10 changes: 5 additions & 5 deletions OsmAnd-java/src/main/java/net/osmand/CallbackWithObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

/**
* That class is designed to be common interface for callbacks with one param
* @author victor
*
* @param <T>
* @author victor
*/
public interface CallbackWithObject<T> {



/**
* Calls on processing result
*
* @param result could be null depends on usage
* @return processed or not
*/
public boolean processResult(T result);

boolean processResult(T result);
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private static int cindexOf(Collator collator, int start, String part, String ba
*/
public static boolean cstartsWith(Collator collator, String fullTextP, String theStart,
boolean checkBeginning, boolean checkSpaces, boolean equals) {
// FUTURE: This is not effective code, it runs on each comparision
// FUTURE: This is not effective code, it runs on each comparison
// It would be more efficient to normalize all strings in file and normalize search string before collator
theStart = alignChars(theStart);
String searchIn = simplifyStringAndAlignChars(fullTextP);
Expand Down
3 changes: 3 additions & 0 deletions OsmAnd-java/src/main/java/net/osmand/IndexConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public class IndexConstants {

public static final String WPT_CHART_FILE_EXT = ".wpt.chart";
public static final String SQLITE_CHART_FILE_EXT = ".3d.chart";
public static final String HELP_ARTICLE_FILE_EXT = ".mht";

public static final String AVOID_ROADS_FILE_EXT = ".geojson";

Expand All @@ -84,6 +85,8 @@ public class IndexConstants {
public static final String NAUTICAL_INDEX_DIR = "nautical/";
public static final String ROADS_INDEX_DIR = "roads/";
public static final String WIKI_INDEX_DIR = "wiki/";
public static final String HELP_INDEX_DIR = "help/";
public static final String ARTICLES_DIR = HELP_INDEX_DIR + "articles/";
public static final String WIKIVOYAGE_INDEX_DIR = "travel/";
public static final String GPX_TRAVEL_DIR = GPX_INDEX_DIR + WIKIVOYAGE_INDEX_DIR;
public static final String AV_INDEX_DIR = "avnotes/";
Expand Down
9 changes: 9 additions & 0 deletions OsmAnd-java/src/main/java/net/osmand/OnResultCallback.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package net.osmand;

/**
* Simple callback interface to indicate about
* completion and return result of some process
*/
public interface OnResultCallback<T> {
void onResult(T result);
}
4 changes: 2 additions & 2 deletions OsmAnd-java/src/main/java/net/osmand/RenderingContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

public class RenderingContext {
public static enum ShadowRenderingMode {
// int shadowRenderingMode = 0; // no shadow (minumum CPU)
// int shadowRenderingMode = 1; // classic shadow (the implementaton in master)
// int shadowRenderingMode = 0; // no shadow (minimum CPU)
// int shadowRenderingMode = 1; // classic shadow (the implementation in master)
// int shadowRenderingMode = 2; // blur shadow (most CPU, but still reasonable)
// int shadowRenderingMode = 3; solid border (CPU use like classic version or even smaller)
NO_SHADOW(0), ONE_STEP(1), BLUR_SHADOW(2), SOLID_SHADOW(3);
Expand Down
1 change: 0 additions & 1 deletion OsmAnd-java/src/main/java/net/osmand/data/Amenity.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

public class Amenity extends MapObject {

public static final String URL_KEY = "url";
public static final String WEBSITE = "website";
public static final String PHONE = "phone";
public static final String MOBILE = "mobile";
Expand Down
5 changes: 3 additions & 2 deletions OsmAnd-java/src/main/java/net/osmand/data/LatLon.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.osmand.data;

import net.osmand.util.MapUtils;

import java.io.Serializable;

public class LatLon implements Serializable {
Expand Down Expand Up @@ -42,8 +44,7 @@ public boolean equals(Object obj) {
return false;

LatLon other = (LatLon) obj;
return Math.abs(latitude - other.latitude) < 0.00001
&& Math.abs(longitude - other.longitude) < 0.00001;
return MapUtils.areLatLonEqual(this, other);
}

@Override
Expand Down
10 changes: 10 additions & 0 deletions OsmAnd-java/src/main/java/net/osmand/gpx/GPXFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,16 @@ public List<GPXUtilities.Track> getTracks(boolean includeGeneralTrack) {
return tracks;
}

public List<TrkSegment> getSegments(boolean includeGeneralTrack) {
List<TrkSegment> segments = new ArrayList<>();
for (Track track : tracks) {
if (includeGeneralTrack || !track.generalTrack) {
segments.addAll(track.segments);
}
}
return segments;
}

public int getTracksCount() {
int count = 0;
for (GPXUtilities.Track track : tracks) {
Expand Down
Loading

0 comments on commit 814b05e

Please sign in to comment.