From 1b9eb9a6e17bc831a840432d01385047691a2d71 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Sat, 6 Feb 2021 13:08:43 +0300 Subject: [PATCH 1/2] Speedup location via gms --- OsmAnd/src-gms/net/osmand/plus/LocationServiceHelperImpl.java | 4 ++-- .../src/net/osmand/plus/views/layers/PointLocationLayer.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src-gms/net/osmand/plus/LocationServiceHelperImpl.java b/OsmAnd/src-gms/net/osmand/plus/LocationServiceHelperImpl.java index 41c74012a3..eaab9e3d06 100644 --- a/OsmAnd/src-gms/net/osmand/plus/LocationServiceHelperImpl.java +++ b/OsmAnd/src-gms/net/osmand/plus/LocationServiceHelperImpl.java @@ -63,11 +63,11 @@ public class LocationServiceHelperImpl extends LocationServiceHelper { // Sets the fastest rate for active location updates. This interval is exact, and your // application will never receive updates more frequently than this value. - .setFastestInterval(50) + //.setFastestInterval(50) // Sets the maximum time when batched location updates are delivered. Updates may be // delivered sooner than this interval. - .setMaxWaitTime(200) + .setMaxWaitTime(0) .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); diff --git a/OsmAnd/src/net/osmand/plus/views/layers/PointLocationLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/PointLocationLayer.java index 21dbbcc7bd..16952876a8 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/PointLocationLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/PointLocationLayer.java @@ -130,7 +130,9 @@ public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLay canvas.restore(); } // Issue 5538: Some devices return positives for hasBearing() at rest, hence add 0.0 check: - boolean isBearing = lastKnownLocation.hasBearing() && (lastKnownLocation.getBearing() != 0.0); + boolean isBearing = lastKnownLocation.hasBearing() && (lastKnownLocation.getBearing() != 0.0) + && (!lastKnownLocation.hasSpeed() || lastKnownLocation.getSpeed() > 0.1); + if (!locationOutdated && isBearing) { float bearing = lastKnownLocation.getBearing(); canvas.rotate(bearing - 90, locationX, locationY); From 68ab992f280df75a1a9920d68f3a648353f5e9df Mon Sep 17 00:00:00 2001 From: cepprice Date: Wed, 3 Feb 2021 13:27:39 +0500 Subject: [PATCH 2/2] Fix #5970 Make menu button active at once --- OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java | 2 ++ OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java | 1 + 2 files changed, 3 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java index 55b24b7ed4..946d79ca18 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java @@ -542,6 +542,7 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment { mapActivity.getContextMenu().showOrUpdate( new LatLon(point.getLatitude(), point.getLongitude()), plugin.getOsmEditsLayer(mapActivity).getObjectName(point), point); + mapActivity.getMapLayers().getContextMenuLayer().updateContextMenu(); } } @@ -869,6 +870,7 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment { mapActivity.getContextMenu().showOrUpdate( new LatLon(point.getLatitude(), point.getLongitude()), plugin.getOsmEditsLayer(mapActivity).getObjectName(point), point); + mapActivity.getMapLayers().getContextMenuLayer().updateContextMenu(); } } else { Toast.makeText(activity, R.string.poi_remove_success, Toast.LENGTH_LONG) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java index a13ae28bba..c4ab750fb3 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java @@ -387,6 +387,7 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider PointDescription pd = new PointDescription(PointDescription.POINT_TYPE_OSM_BUG, obj.local.getText()); activity.getContextMenu().show(new LatLon(obj.local.getLatitude(), obj.local.getLongitude()), pd, obj.local); + activity.getMapLayers().getContextMenuLayer().updateContextMenu(); } } else { if (action == Action.REOPEN) {