diff --git a/OsmAnd-java/src/net/osmand/NativeLibrary.java b/OsmAnd-java/src/net/osmand/NativeLibrary.java
index b33b8ea195..7fbac147b0 100644
--- a/OsmAnd-java/src/net/osmand/NativeLibrary.java
+++ b/OsmAnd-java/src/net/osmand/NativeLibrary.java
@@ -116,8 +116,8 @@ public class NativeLibrary {
return getRouteDataObjects(rs.region.routeReg, rs.nativeHandler, x31, y31);
}
- public boolean initMapFile(String filePath) {
- return initBinaryMapFile(filePath);
+ public boolean initMapFile(String filePath, boolean useLive) {
+ return initBinaryMapFile(filePath, useLive);
}
public boolean initCacheMapFile(String filePath) {
@@ -160,7 +160,7 @@ public class NativeLibrary {
protected static native void deleteSearchResult(long searchResultHandle);
- protected static native boolean initBinaryMapFile(String filePath);
+ protected static native boolean initBinaryMapFile(String filePath, boolean useLive);
protected static native boolean initCacheMapFiles(String filePath);
diff --git a/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java b/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java
index 3f0cc32f9d..f246bfeb47 100644
--- a/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java
+++ b/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java
@@ -171,6 +171,14 @@ public class GeoPointParserUtil {
assertGeoPoint(actual, new GeoParsedPoint(qstr));
assertUrlEquals(url, actual.getGeoUriString());
+ // geo:?q=Paris
+ qstr = "Paris";
+ url = "geo:?q=" + URLEncoder.encode(qstr);
+ System.out.println("url: " + url);
+ actual = GeoPointParserUtil.parse(url);
+ assertGeoPoint(actual, new GeoParsedPoint(qstr));
+ assertUrlEquals("geo:0,0?q=" + URLEncoder.encode(qstr), actual.getGeoUriString());
+
// geo:0,0?q=760 West Genesee Street Syracuse NY 13204
qstr = "760 West Genesee Street Syracuse NY 13204";
url = "geo:0,0?q=" + qstr;
@@ -1247,11 +1255,12 @@ public class GeoPointParserUtil {
final Pattern positionPattern = Pattern.compile(
"([+-]?\\d+(?:\\.\\d+)?),\\s?([+-]?\\d+(?:\\.\\d+)?)");
final Matcher positionMatcher = positionPattern.matcher(positionPart);
- if (!positionMatcher.find()) {
- return null;
+ double lat = 0.0;
+ double lon = 0.0;
+ if (positionMatcher.find()) {
+ lat = Double.valueOf(positionMatcher.group(1));
+ lon = Double.valueOf(positionMatcher.group(2));
}
- double lat = Double.valueOf(positionMatcher.group(1));
- double lon = Double.valueOf(positionMatcher.group(2));
int zoom = GeoParsedPoint.NO_ZOOM;
String searchRequest = null;
diff --git a/OsmAnd/res/layout/main.xml b/OsmAnd/res/layout/main.xml
index 71011b2b97..926cf7414e 100644
--- a/OsmAnd/res/layout/main.xml
+++ b/OsmAnd/res/layout/main.xml
@@ -46,11 +46,14 @@
android:layout_height="match_parent"
android:fitsSystemWindows="true">
-
+
-
+
-
+
Требование: контроль
Карточки не принимаются
Предоплаченные билеты
+
+ Депо
+
diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml
index 8e1d2c26fa..872dd20ea6 100644
--- a/OsmAnd/res/values-ru/strings.xml
+++ b/OsmAnd/res/values-ru/strings.xml
@@ -938,7 +938,7 @@
Автор
Редактирование POI
Добавление POI
- Узел не найден или удобство (amenity) состоит из нескольких узлов, что не поддерживается.
+ Узел не найден или объект состоит из нескольких узлов, что не поддерживается.
Вы действительно хотите удалить {0}?
Удаление POI
POI успешно удалена
diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml
index c9a47078d2..8c6a71c4a8 100644
--- a/OsmAnd/res/values/phrases.xml
+++ b/OsmAnd/res/values/phrases.xml
@@ -3634,4 +3634,6 @@
Charging station
+ Depot
+
diff --git a/OsmAnd/src/net/osmand/AndroidUtils.java b/OsmAnd/src/net/osmand/AndroidUtils.java
index a46f98e7c1..c0535bcf66 100644
--- a/OsmAnd/src/net/osmand/AndroidUtils.java
+++ b/OsmAnd/src/net/osmand/AndroidUtils.java
@@ -284,9 +284,11 @@ public class AndroidUtils {
decorView.setSystemUiVisibility(uiOptions);
}
- public static int[] getViewLocation(View view) {
+ public static int[] getCenterViewCoordinates(View view) {
int[] coordinates = new int[2];
view.getLocationOnScreen(coordinates);
+ coordinates[0] += view.getWidth() / 2;
+ coordinates[1] += view.getHeight() / 2;
return coordinates;
}
diff --git a/OsmAnd/src/net/osmand/plus/GPXUtilities.java b/OsmAnd/src/net/osmand/plus/GPXUtilities.java
index 21e12e8a88..307de185fc 100644
--- a/OsmAnd/src/net/osmand/plus/GPXUtilities.java
+++ b/OsmAnd/src/net/osmand/plus/GPXUtilities.java
@@ -57,6 +57,8 @@ public class GPXUtilities {
private final static NumberFormat latLonFormat = new DecimalFormat("0.00#####", new DecimalFormatSymbols(
new Locale("EN", "US")));
+ private final static NumberFormat decimalFormat = new DecimalFormat("#.###", new DecimalFormatSymbols(
+ new Locale("EN", "US")));
public static class GPXExtensions {
Map extensions = null;
@@ -1299,7 +1301,7 @@ public class GPXUtilities {
serializer.attribute(null, "lon", latLonFormat.format(p.lon)); //$NON-NLS-1$ //$NON-NLS-2$
if (!Double.isNaN(p.ele)) {
- writeNotNullText(serializer, "ele", (float) p.ele + "");
+ writeNotNullText(serializer, "ele", decimalFormat.format(p.ele));
}
if (p.time != 0) {
writeNotNullText(serializer, "time", format.format(new Date(p.time)));
@@ -1316,10 +1318,10 @@ public class GPXUtilities {
writeNotNullText(serializer, "cmt", p.comment);
}
if (!Double.isNaN(p.hdop)) {
- writeNotNullText(serializer, "hdop", p.hdop + "");
+ writeNotNullText(serializer, "hdop", decimalFormat.format(p.hdop));
}
if (p.speed > 0) {
- p.getExtensionsToWrite().put("speed", p.speed + "");
+ p.getExtensionsToWrite().put("speed", decimalFormat.format(p.speed));
}
writeExtensions(serializer, p);
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
index e1cdd641c7..a57e1c5508 100644
--- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
@@ -167,12 +167,16 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
ImageView emptyImageView = (ImageView) emptyView.findViewById(R.id.empty_state_image_view);
emptyImageView.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_empty_state_favorites_day : R.drawable.ic_empty_state_favorites_night);
Button importButton = (Button) emptyView.findViewById(R.id.import_button);
- importButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- importFavourites();
- }
- });
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ importButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ importFavourites();
+ }
+ });
+ } else {
+ importButton.setVisibility(View.GONE);
+ }
listView.setEmptyView(emptyView);
listView.setAdapter(favouritesAdapter);
setListView(listView);
@@ -321,8 +325,10 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
if (!MenuItemCompat.isActionViewExpanded(mi)) {
- createMenuItem(menu, IMPORT_FAVOURITES_ID, R.string.shared_string_add_to_favorites, R.drawable.ic_action_plus,
- R.drawable.ic_action_plus, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ createMenuItem(menu, IMPORT_FAVOURITES_ID, R.string.shared_string_add_to_favorites, R.drawable.ic_action_plus,
+ R.drawable.ic_action_plus, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
+ }
createMenuItem(menu, SHARE_ID, R.string.shared_string_share, R.drawable.ic_action_gshare_dark,
R.drawable.ic_action_gshare_dark, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
if (getSettings().USE_MAP_MARKERS.get()) {
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
index c63d47518e..6ec8ed06fb 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
@@ -1000,7 +1000,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
}
public void readLocationToShow() {
- mapLayers.getMapControlsLayer().showMapControls();
+ mapLayers.getMapControlsLayer().showMapControlsIfHidden();
LatLon cur = new LatLon(mapView.getLatitude(), mapView.getLongitude());
LatLon latLonToShow = settings.getAndClearMapLocationToShow();
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
index ab55d0f5e5..aed969a25e 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
@@ -947,7 +947,7 @@ public class MapActivityActions implements DialogProvider {
ContextMenuItem item = contextMenuAdapter.getItem(position);
ContextMenuAdapter.ItemClickListener click = item.getItemClickListener();
if (click != null && click.onContextMenuClick(simpleListAdapter, item.getTitleId(),
- position, false, AndroidUtils.getViewLocation(view))) {
+ position, false, AndroidUtils.getCenterViewCoordinates(view))) {
mapActivity.closeDrawer();
}
}
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
index 76e31beaf6..379fb7339f 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
@@ -1581,12 +1581,6 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
private void updateRecordControl(final MapActivity mapActivity, final File f) {
recordControl.setText(app.getString(R.string.shared_string_control_stop), "");
recordControl.setIcons(R.drawable.widget_icon_av_active, R.drawable.widget_icon_av_active);
- final MapInfoLayer mil = mapActivity.getMapLayers().getMapInfoLayer();
- if (!recordControl.isVisible()) {
- recordControl.setExplicitlyVisible(true);
- mil.recreateControls();
- mapActivity.getMapView().refreshMap(true);
- }
recordControl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -1599,10 +1593,6 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
if (!recordingDone) {
if (!restart || !stopMediaRecording(true)) {
recordingDone = true;
- if (!recordControl.isVisible()) {
- recordControl.setExplicitlyVisible(false);
- mapActivity.getMapLayers().getMapInfoLayer().recreateControls();
- }
stopMediaRecording(false);
if (recordControl != null) {
setRecordListener(recordControl, mapActivity);
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java b/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java
index 978b6c8a4b..d7d5fd151a 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java
@@ -196,7 +196,7 @@ public class NotesFragment extends OsmAndListFragment {
NotesSortByMode sortByMode = getMyApplication().getSettings().NOTES_SORT_BY_MODE.get();
if (sortByMode.isByDate()) {
res.add(NotesAdapter.TYPE_DATE_HEADER);
- res.addAll(sortItemsByDateDescending(recs));
+ res.addAll(sortRecsByDateDescending(recs));
} else if (sortByMode.isByType()) {
List audios = new LinkedList<>();
List photos = new LinkedList<>();
@@ -221,7 +221,7 @@ public class NotesFragment extends OsmAndListFragment {
private void addToResIfNotEmpty(List