From ed85c92047b0e0582fb89ad979ddb5bb582110fc Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Mon, 13 Jan 2020 14:58:03 +0200 Subject: [PATCH 01/16] tilt gesture in openGL initial commit --- .../osmand/plus/activities/MapActivity.java | 6 ++ .../osmand/plus/views/MultiTouchSupport.java | 76 +++++++++++++++---- .../osmand/plus/views/OsmandMapTileView.java | 18 ++++- 3 files changed, 86 insertions(+), 14 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index e933ca9232..1f7d9c9cee 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -489,6 +489,12 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven } } + public void setMapElevation(float angle) { + if (settings.USE_OPENGL_RENDER.get() && NativeCoreContext.isInit()) { + atlasMapRendererView.setElevationAngle(angle); + } + } + private void createProgressBarForRouting() { final ProgressBar pb = (ProgressBar) findViewById(R.id.map_horizontal_progress); diff --git a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java index 166d3f04ee..05389ef884 100644 --- a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java +++ b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java @@ -36,6 +36,8 @@ public class MultiTouchSupport { public void onActionPointerUp(); public void onActionCancel(); + + public void onChangingViewAngle(float angle); } private boolean multiTouchAPISupported = false; @@ -62,6 +64,10 @@ public class MultiTouchSupport { return inZoomMode; } + public boolean isInTiltMode() { + return inTiltMode; + } + private void initMethods(){ try { getPointerCount = MotionEvent.class.getMethod("getPointerCount"); //$NON-NLS-1$ @@ -76,9 +82,17 @@ public class MultiTouchSupport { } private boolean inZoomMode = false; + private boolean inTiltMode = false; private double zoomStartedDistance = 100; private double zoomRelative = 1; private PointF centerPoint = new PointF(); + private PointF firstFingerStart = new PointF(); + private PointF secondFingerStart = new PointF(); + private static final int TILT_X_THRESHOLD_PX = 40; + private static final int TILT_Y_THRESHOLD_PX = 40; + private static final int TILT_DY_THRESHOLD_PX = 40; + private static final float ROTATION_THRESHOLD_DEG = 15.0f; + private boolean isRotating; public boolean onTouchEvent(MotionEvent event){ if(!isMultiTouchSupported()){ @@ -91,9 +105,10 @@ public class MultiTouchSupport { } Integer pointCount = (Integer) getPointerCount.invoke(event); if(pointCount < 2){ - if(inZoomMode){ + if (inZoomMode || inTiltMode) { listener.onZoomOrRotationEnded(zoomRelative, angleRelative); inZoomMode = false; + inTiltMode = false; return true; } return false; @@ -114,28 +129,63 @@ public class MultiTouchSupport { } if (actionCode == ACTION_POINTER_DOWN) { centerPoint = new PointF((x1 + x2) / 2, (y1 + y2) / 2); + firstFingerStart = new PointF(x1, y1); + secondFingerStart = new PointF(x2, y2); listener.onGestureInit(x1, y1, x2, y2); listener.onZoomStarted(centerPoint); - zoomStartedDistance = distance; - angleStarted = angle; - inZoomMode = true; return true; } else if(actionCode == ACTION_POINTER_UP){ - if(inZoomMode){ + if (inZoomMode || inTiltMode) { listener.onZoomOrRotationEnded(zoomRelative, angleRelative); inZoomMode = false; + inTiltMode = false; } return true; - } else if(inZoomMode && actionCode == MotionEvent.ACTION_MOVE){ - // Keep zoom center fixed or flexible - centerPoint = new PointF((x1 + x2) / 2, (y1 + y2) / 2); + } else if (actionCode == MotionEvent.ACTION_MOVE) { + if (inZoomMode) { - if(angleDefined) { - angleRelative = MapUtils.unifyRotationTo360(angle - angleStarted); + // Keep zoom center fixed or flexible + centerPoint = new PointF((x1 + x2) / 2, (y1 + y2) / 2); + + if (angleDefined) { + float a = MapUtils.unifyRotationTo360(angle - angleStarted); + if (!isRotating && Math.abs(a) > ROTATION_THRESHOLD_DEG) { + isRotating = true; + angleStarted = angle; + } else if (isRotating) { + angleRelative = a; + } + } + zoomRelative = distance / zoomStartedDistance; + listener.onZoomingOrRotating(zoomRelative, angleRelative); + return true; + } else if (inTiltMode) { + float dy2 = secondFingerStart.y - y2; + float viewAngle = dy2 / 8f; + listener.onChangingViewAngle(viewAngle); + } else { + float dx1 = Math.abs(firstFingerStart.x - x1); + float dx2 = Math.abs(secondFingerStart.x - x2); + float dy1 = Math.abs(firstFingerStart.y - y1); + float dy2 = Math.abs(secondFingerStart.y - y2); + float startDy = Math.abs(secondFingerStart.y - firstFingerStart.y); + if (dx1 < TILT_X_THRESHOLD_PX && dx2 < TILT_X_THRESHOLD_PX + && dy1 > TILT_Y_THRESHOLD_PX && dy2 > TILT_Y_THRESHOLD_PX + && startDy < TILT_Y_THRESHOLD_PX * 6 + && Math.abs(dy2 - dy1) < TILT_DY_THRESHOLD_PX) { + inTiltMode = true; + } else if (dx1 > TILT_X_THRESHOLD_PX || dx2 > TILT_X_THRESHOLD_PX + || Math.abs(dy2 - dy1) > TILT_DY_THRESHOLD_PX + || Math.abs(dy1 - dy2) > TILT_DY_THRESHOLD_PX) { + listener.onZoomStarted(centerPoint); + zoomStartedDistance = distance; + angleStarted = angle; + angleRelative = 0; + zoomRelative = 0; + isRotating = false; + inZoomMode = true; + } } - zoomRelative = distance / zoomStartedDistance; - listener.onZoomingOrRotating(zoomRelative, angleRelative); - return true; } } catch (Exception e) { log.debug("Multi touch exception" , e); //$NON-NLS-1$ diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index eafefe7710..a267ac8254 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -1199,6 +1199,11 @@ public class OsmandMapTileView implements IMapDownloaderCallback { multiTouch = false; } + @Override + public void onChangingViewAngle(float angle) { + setElevationAngle(angle); + } + @Override public void onZoomStarted(PointF centerPoint) { initialMultiTouchCenterPoint = centerPoint; @@ -1287,6 +1292,15 @@ public class OsmandMapTileView implements IMapDownloaderCallback { } + private void setElevationAngle(float angle) { + if (angle < 35f) { + angle = 35f; + } else if (angle > 90f) { + angle = 90f; + } + ((MapActivity) activity).setMapElevation(angle); + } + private boolean isZoomingAllowed(int baseZoom, float dz) { if (baseZoom > getMaxZoom()) { return false; @@ -1346,7 +1360,9 @@ public class OsmandMapTileView implements IMapDownloaderCallback { @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { - dragToAnimate(e2.getX() + distanceX, e2.getY() + distanceY, e2.getX(), e2.getY(), true); + if (!multiTouchSupport.isInTiltMode()) { + dragToAnimate(e2.getX() + distanceX, e2.getY() + distanceY, e2.getX(), e2.getY(), true); + } return true; } From e0e99057d462bc604f491d6bafaa652e60dc954e Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Mon, 13 Jan 2020 18:26:50 +0200 Subject: [PATCH 02/16] clean --- .../src/net/osmand/plus/views/MultiTouchSupport.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java index 05389ef884..20b9d8f390 100644 --- a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java +++ b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java @@ -91,8 +91,6 @@ public class MultiTouchSupport { private static final int TILT_X_THRESHOLD_PX = 40; private static final int TILT_Y_THRESHOLD_PX = 40; private static final int TILT_DY_THRESHOLD_PX = 40; - private static final float ROTATION_THRESHOLD_DEG = 15.0f; - private boolean isRotating; public boolean onTouchEvent(MotionEvent event){ if(!isMultiTouchSupported()){ @@ -148,13 +146,7 @@ public class MultiTouchSupport { centerPoint = new PointF((x1 + x2) / 2, (y1 + y2) / 2); if (angleDefined) { - float a = MapUtils.unifyRotationTo360(angle - angleStarted); - if (!isRotating && Math.abs(a) > ROTATION_THRESHOLD_DEG) { - isRotating = true; - angleStarted = angle; - } else if (isRotating) { - angleRelative = a; - } + angleRelative = MapUtils.unifyRotationTo360(angle - angleStarted); } zoomRelative = distance / zoomStartedDistance; listener.onZoomingOrRotating(zoomRelative, angleRelative); @@ -182,7 +174,6 @@ public class MultiTouchSupport { angleStarted = angle; angleRelative = 0; zoomRelative = 0; - isRotating = false; inZoomMode = true; } } From 8e12147196329b6456584b08561d6c580001c60c Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Tue, 14 Jan 2020 11:34:44 +0200 Subject: [PATCH 03/16] saving elevation angle state --- OsmAnd/src/net/osmand/plus/OsmandSettings.java | 9 +++++++++ .../net/osmand/plus/activities/MapActivity.java | 3 ++- .../net/osmand/plus/views/MultiTouchSupport.java | 3 +++ .../net/osmand/plus/views/OsmandMapTileView.java | 15 ++++++++++++++- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 4bd2314dfc..2a155dc5af 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -2288,6 +2288,7 @@ public class OsmandSettings { public static final String LAST_KNOWN_MAP_LAT = "last_known_map_lat"; //$NON-NLS-1$ public static final String LAST_KNOWN_MAP_LON = "last_known_map_lon"; //$NON-NLS-1$ public static final String LAST_KNOWN_MAP_ZOOM = "last_known_map_zoom"; //$NON-NLS-1$ + public static final String LAST_KNOWN_MAP_ELEVATION = "last_known_map_elevation"; //$NON-NLS-1$ public static final String MAP_LABEL_TO_SHOW = "map_label_to_show"; //$NON-NLS-1$ public static final String MAP_LAT_TO_SHOW = "map_lat_to_show"; //$NON-NLS-1$ @@ -2401,6 +2402,14 @@ public class OsmandSettings { settingsAPI.edit(globalPreferences).putInt(LAST_KNOWN_MAP_ZOOM, zoom).commit(); } + public float getLastKnownMapElevation() { + return settingsAPI.getFloat(globalPreferences, LAST_KNOWN_MAP_ELEVATION, 90); + } + + public void setLastKnownMapElevation(float elevation) { + settingsAPI.edit(globalPreferences).putFloat(LAST_KNOWN_MAP_ELEVATION, elevation).commit(); + } + public final static String POINT_NAVIGATE_LAT = "point_navigate_lat"; //$NON-NLS-1$ public final static String POINT_NAVIGATE_LON = "point_navigate_lon"; //$NON-NLS-1$ public final static String POINT_NAVIGATE_ROUTE = "point_navigate_route_integer"; //$NON-NLS-1$ diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 1f7d9c9cee..b42fac9d50 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -475,7 +475,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven OsmAndMapLayersView ml = (OsmAndMapLayersView) findViewById(R.id.MapLayersView); ml.setVisibility(View.VISIBLE); atlasMapRendererView.setAzimuth(0); - atlasMapRendererView.setElevationAngle(90); + atlasMapRendererView.setElevationAngle(app.getSettings().getLastKnownMapElevation()); NativeCoreContext.getMapRendererContext().setMapRendererView(atlasMapRendererView); ml.setMapView(mapView); mapViewTrackingUtilities.setMapView(mapView); @@ -1497,6 +1497,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven } settings.setLastKnownMapZoom(mapView.getZoom()); + settings.setLastKnownMapElevation(mapView.getElevationAngle()); settings.MAP_ACTIVITY_ENABLED.set(false); app.getResourceManager().interruptRendering(); OsmandPlugin.onMapActivityPause(this); diff --git a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java index 20b9d8f390..cf7518028c 100644 --- a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java +++ b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java @@ -38,6 +38,8 @@ public class MultiTouchSupport { public void onActionCancel(); public void onChangingViewAngle(float angle); + + public void onChangeViewAngleStarted(); } private boolean multiTouchAPISupported = false; @@ -165,6 +167,7 @@ public class MultiTouchSupport { && dy1 > TILT_Y_THRESHOLD_PX && dy2 > TILT_Y_THRESHOLD_PX && startDy < TILT_Y_THRESHOLD_PX * 6 && Math.abs(dy2 - dy1) < TILT_DY_THRESHOLD_PX) { + listener.onChangeViewAngleStarted(); inTiltMode = true; } else if (dx1 > TILT_X_THRESHOLD_PX || dx2 > TILT_X_THRESHOLD_PX || Math.abs(dy2 - dy1) > TILT_DY_THRESHOLD_PX diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index a267ac8254..1f4f32c4c2 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -186,6 +186,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback { private long multiTouchStartTime; private long multiTouchEndTime; private boolean wasZoomInMultiTouch; + private float elevationAngle; public OsmandMapTileView(MapActivity activity, int w, int h) { this.activity = activity; @@ -257,6 +258,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback { } } }; + elevationAngle = settings.getLastKnownMapElevation(); } public void setView(View view) { @@ -439,6 +441,10 @@ public class OsmandMapTileView implements IMapDownloaderCallback { return currentViewport.getZoom(); } + public float getElevationAngle() { + return elevationAngle; + } + public double getZoomFractionalPart() { return currentViewport.getZoomFloatPart(); } @@ -1127,6 +1133,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback { private LatLon initialCenterLatLon; private boolean startRotating = false; private static final float ANGLE_THRESHOLD = 30; + private float initialElevation; @Override public void onZoomOrRotationEnded(double relativeToStart, float angleRelative) { @@ -1201,7 +1208,12 @@ public class OsmandMapTileView implements IMapDownloaderCallback { @Override public void onChangingViewAngle(float angle) { - setElevationAngle(angle); + setElevationAngle(initialElevation - angle); + } + + @Override + public void onChangeViewAngleStarted() { + initialElevation = elevationAngle; } @Override @@ -1298,6 +1310,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback { } else if (angle > 90f) { angle = 90f; } + this.elevationAngle = angle; ((MapActivity) activity).setMapElevation(angle); } From 5c5fe577982ca49de9825f1a8e2399191b7d02b4 Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Tue, 14 Jan 2020 12:01:10 +0200 Subject: [PATCH 04/16] USE_OPENGL_RENDER check in tilt --- OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java index cf7518028c..e9ef01937e 100644 --- a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java +++ b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java @@ -5,6 +5,8 @@ import android.graphics.PointF; import android.view.MotionEvent; import net.osmand.PlatformUtil; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.OsmandSettings; import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; @@ -45,6 +47,7 @@ public class MultiTouchSupport { private boolean multiTouchAPISupported = false; private final MultiTouchZoomListener listener; protected final Context ctx; + private OsmandSettings settings; protected Method getPointerCount; protected Method getX; @@ -71,6 +74,7 @@ public class MultiTouchSupport { } private void initMethods(){ + settings = ((OsmandApplication) ctx.getApplicationContext()).getSettings(); try { getPointerCount = MotionEvent.class.getMethod("getPointerCount"); //$NON-NLS-1$ getPointerId = MotionEvent.class.getMethod("getPointerId", Integer.TYPE); //$NON-NLS-1$ @@ -166,7 +170,8 @@ public class MultiTouchSupport { if (dx1 < TILT_X_THRESHOLD_PX && dx2 < TILT_X_THRESHOLD_PX && dy1 > TILT_Y_THRESHOLD_PX && dy2 > TILT_Y_THRESHOLD_PX && startDy < TILT_Y_THRESHOLD_PX * 6 - && Math.abs(dy2 - dy1) < TILT_DY_THRESHOLD_PX) { + && Math.abs(dy2 - dy1) < TILT_DY_THRESHOLD_PX + && settings.USE_OPENGL_RENDER.get()) { listener.onChangeViewAngleStarted(); inTiltMode = true; } else if (dx1 > TILT_X_THRESHOLD_PX || dx2 > TILT_X_THRESHOLD_PX From 8b12a4488955dbfc2d0716dda0c5ad571d66e353 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Tue, 14 Jan 2020 14:46:45 +0300 Subject: [PATCH 05/16] Add phrase --- OsmAnd/res/values-ru/phrases.xml | 3 +++ OsmAnd/res/values/phrases.xml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index ed12d660ac..82baef828e 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3504,6 +3504,7 @@ Трава Полоса движения Дизайн гидранта: wsh +<<<<<<< HEAD Платежные карты Косинто Автогаз @@ -3642,4 +3643,6 @@ Бушеншанк (изысканные австрийские вина) Изысканная кухня Сеть + Парковочное место + \ No newline at end of file diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 2c21a5fdb4..43f2573ac4 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4157,4 +4157,6 @@ Grave + Parking space + From e5abd2888b6a7e37aff323821ec11aab0c34d63b Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Tue, 14 Jan 2020 13:55:26 +0200 Subject: [PATCH 06/16] refactor --- .../osmand/plus/activities/MapActivity.java | 2 +- .../osmand/plus/views/MultiTouchSupport.java | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index b42fac9d50..fcdbcba407 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -490,7 +490,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven } public void setMapElevation(float angle) { - if (settings.USE_OPENGL_RENDER.get() && NativeCoreContext.isInit()) { + if (atlasMapRendererView != null) { atlasMapRendererView.setElevationAngle(angle); } } diff --git a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java index e9ef01937e..ced2348f40 100644 --- a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java +++ b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java @@ -6,7 +6,7 @@ import android.view.MotionEvent; import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; -import net.osmand.plus.OsmandSettings; +import net.osmand.plus.views.corenative.NativeCoreContext; import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; @@ -47,7 +47,6 @@ public class MultiTouchSupport { private boolean multiTouchAPISupported = false; private final MultiTouchZoomListener listener; protected final Context ctx; - private OsmandSettings settings; protected Method getPointerCount; protected Method getX; @@ -73,8 +72,11 @@ public class MultiTouchSupport { return inTiltMode; } + private boolean isTiltSupported() { + return ((OsmandApplication) ctx.getApplicationContext()).getSettings().USE_OPENGL_RENDER.get() && NativeCoreContext.isInit(); + } + private void initMethods(){ - settings = ((OsmandApplication) ctx.getApplicationContext()).getSettings(); try { getPointerCount = MotionEvent.class.getMethod("getPointerCount"); //$NON-NLS-1$ getPointerId = MotionEvent.class.getMethod("getPointerId", Integer.TYPE); //$NON-NLS-1$ @@ -137,6 +139,8 @@ public class MultiTouchSupport { secondFingerStart = new PointF(x2, y2); listener.onGestureInit(x1, y1, x2, y2); listener.onZoomStarted(centerPoint); + zoomStartedDistance = distance; + angleStarted = angle; return true; } else if(actionCode == ACTION_POINTER_UP){ if (inZoomMode || inTiltMode) { @@ -161,7 +165,7 @@ public class MultiTouchSupport { float dy2 = secondFingerStart.y - y2; float viewAngle = dy2 / 8f; listener.onChangingViewAngle(viewAngle); - } else { + } else if (isTiltSupported()) { float dx1 = Math.abs(firstFingerStart.x - x1); float dx2 = Math.abs(secondFingerStart.x - x2); float dy1 = Math.abs(firstFingerStart.y - y1); @@ -170,20 +174,19 @@ public class MultiTouchSupport { if (dx1 < TILT_X_THRESHOLD_PX && dx2 < TILT_X_THRESHOLD_PX && dy1 > TILT_Y_THRESHOLD_PX && dy2 > TILT_Y_THRESHOLD_PX && startDy < TILT_Y_THRESHOLD_PX * 6 - && Math.abs(dy2 - dy1) < TILT_DY_THRESHOLD_PX - && settings.USE_OPENGL_RENDER.get()) { + && Math.abs(dy2 - dy1) < TILT_DY_THRESHOLD_PX) { listener.onChangeViewAngleStarted(); inTiltMode = true; } else if (dx1 > TILT_X_THRESHOLD_PX || dx2 > TILT_X_THRESHOLD_PX || Math.abs(dy2 - dy1) > TILT_DY_THRESHOLD_PX || Math.abs(dy1 - dy2) > TILT_DY_THRESHOLD_PX) { listener.onZoomStarted(centerPoint); - zoomStartedDistance = distance; - angleStarted = angle; angleRelative = 0; zoomRelative = 0; inZoomMode = true; } + } else { + inZoomMode = true; } } } catch (Exception e) { From 249e38a913f6bd7677a43a58dfef1ed33466fcf0 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Tue, 14 Jan 2020 15:46:25 +0300 Subject: [PATCH 07/16] Fix search test --- OsmAnd-java/src/test/resources/search/double_parking.json | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd-java/src/test/resources/search/double_parking.json b/OsmAnd-java/src/test/resources/search/double_parking.json index 0c23cebe3d..46abccb8d1 100644 --- a/OsmAnd-java/src/test/resources/search/double_parking.json +++ b/OsmAnd-java/src/test/resources/search/double_parking.json @@ -17,6 +17,7 @@ "Parking fee: no (Charging station / Transportation)", "Parking fee: yes (Charging station / Transportation)", "Parking lot (Fire hydrant / Emergency infrastructure)", + "Parking space (Personal transport)", "Parking tickets (Vending machine / Store)", "Parking tickets (Vending machine / Store)", "Parking time limit (Parking / Personal transport)", From f6ba9ad6481df7eabf2d1be0dbf83f195f87be74 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Tue, 14 Jan 2020 15:47:36 +0300 Subject: [PATCH 08/16] Add phrase --- OsmAnd/res/values-ru/phrases.xml | 1 + OsmAnd/res/values/phrases.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index 82baef828e..e224e707fb 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3645,4 +3645,5 @@ Сеть Парковочное место + \ No newline at end of file diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 43f2573ac4..349b9b43a4 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4159,4 +4159,6 @@ Parking space + URL + From b8726913e87fe9a4ad15d554db7b84b9ba5e4b1b Mon Sep 17 00:00:00 2001 From: xmd5a Date: Tue, 14 Jan 2020 15:50:16 +0300 Subject: [PATCH 09/16] Fix --- OsmAnd/res/values-ru/phrases.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index e224e707fb..c431149358 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3504,7 +3504,6 @@ Трава Полоса движения Дизайн гидранта: wsh -<<<<<<< HEAD Платежные карты Косинто Автогаз From ed95fc77d6c5394bbdb290163cb92c79bf74bd68 Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Tue, 14 Jan 2020 15:31:32 +0200 Subject: [PATCH 10/16] corrections --- OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java index ced2348f40..e3c8b059f2 100644 --- a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java +++ b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java @@ -143,9 +143,10 @@ public class MultiTouchSupport { angleStarted = angle; return true; } else if(actionCode == ACTION_POINTER_UP){ - if (inZoomMode || inTiltMode) { + if (inZoomMode) { listener.onZoomOrRotationEnded(zoomRelative, angleRelative); inZoomMode = false; + } else if (inTiltMode) { inTiltMode = false; } return true; @@ -165,6 +166,7 @@ public class MultiTouchSupport { float dy2 = secondFingerStart.y - y2; float viewAngle = dy2 / 8f; listener.onChangingViewAngle(viewAngle); + return true; } else if (isTiltSupported()) { float dx1 = Math.abs(firstFingerStart.x - x1); float dx2 = Math.abs(secondFingerStart.x - x2); @@ -180,13 +182,14 @@ public class MultiTouchSupport { } else if (dx1 > TILT_X_THRESHOLD_PX || dx2 > TILT_X_THRESHOLD_PX || Math.abs(dy2 - dy1) > TILT_DY_THRESHOLD_PX || Math.abs(dy1 - dy2) > TILT_DY_THRESHOLD_PX) { - listener.onZoomStarted(centerPoint); angleRelative = 0; zoomRelative = 0; inZoomMode = true; } + return true; } else { inZoomMode = true; + return true; } } } catch (Exception e) { From c39b10c1b978eefe69b8443ab16bbec1ad04031c Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Tue, 14 Jan 2020 17:23:20 +0200 Subject: [PATCH 11/16] corrections --- OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java index e3c8b059f2..3b536b0fca 100644 --- a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java +++ b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java @@ -161,12 +161,10 @@ public class MultiTouchSupport { } zoomRelative = distance / zoomStartedDistance; listener.onZoomingOrRotating(zoomRelative, angleRelative); - return true; } else if (inTiltMode) { float dy2 = secondFingerStart.y - y2; float viewAngle = dy2 / 8f; listener.onChangingViewAngle(viewAngle); - return true; } else if (isTiltSupported()) { float dx1 = Math.abs(firstFingerStart.x - x1); float dx2 = Math.abs(secondFingerStart.x - x2); @@ -186,11 +184,10 @@ public class MultiTouchSupport { zoomRelative = 0; inZoomMode = true; } - return true; } else { inZoomMode = true; - return true; } + return true; } } catch (Exception e) { log.debug("Multi touch exception" , e); //$NON-NLS-1$ From b3400dce5e608b591810bb87fb58a24b605ce702 Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Tue, 14 Jan 2020 17:47:55 +0200 Subject: [PATCH 12/16] corrections --- OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java index 3b536b0fca..1e264e6d5d 100644 --- a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java +++ b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java @@ -111,9 +111,11 @@ public class MultiTouchSupport { } Integer pointCount = (Integer) getPointerCount.invoke(event); if(pointCount < 2){ - if (inZoomMode || inTiltMode) { + if (inZoomMode) { listener.onZoomOrRotationEnded(zoomRelative, angleRelative); inZoomMode = false; + return true; + } else if (inTiltMode) { inTiltMode = false; return true; } From 82883234f3311a9fb03f58b27b0ae4b83dc2cbf4 Mon Sep 17 00:00:00 2001 From: Mr-Update Date: Mon, 13 Jan 2020 17:29:32 +0000 Subject: [PATCH 13/16] Translated using Weblate (German) Currently translated at 100.0% (3101 of 3101 strings) --- OsmAnd/res/values-de/strings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 83dd6438de..009775bea2 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -1802,7 +1802,7 @@ Lon %2$s Übersichtsseite oder Menüsteuerung Es besteht die Möglichkeit, die App primär über die flexible Übersichtsseite oder ein statisches Menü zu steuern. Ihre Wahl kann jederzeit in den Übersichtsseiten-Einstellungen geändert werden. Aufruf von der Karte aus - Neu erstellen + Neue Katagorie erstellen Weiter %.1f MB Bitte einen gültigen POI-Typ angeben oder überspringen. @@ -3426,4 +3426,5 @@ Lon %2$s Alle Profil-Einstellungen werden auf den Ausgangszustand nach App-Installation zurückgesetzt. Alle Profil-Einstellungen auf den Standard zurücksetzen\? %1$s: %2$s + %1$s %2$s \ No newline at end of file From 3baaad06def727aeec659f4f52a0d82e6addfa62 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Mon, 13 Jan 2020 19:57:51 +0000 Subject: [PATCH 14/16] Translated using Weblate (Hebrew) Currently translated at 99.8% (3096 of 3101 strings) --- OsmAnd/res/values-he/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-he/strings.xml b/OsmAnd/res/values-he/strings.xml index 3d0b111958..cfd3ced71e 100644 --- a/OsmAnd/res/values-he/strings.xml +++ b/OsmAnd/res/values-he/strings.xml @@ -3412,4 +3412,5 @@ כל הגדרות הפרופיל יאופסו למצב כמו שלאחר ההתקנה. לאפס את הגדרות הפרופיל לבררת המחדל\? %1$s:‏ %2$s + %1$s %2$s \ No newline at end of file From 0c968a6e3c91e9357c9857b951b6cbea5aed376e Mon Sep 17 00:00:00 2001 From: Mr-Update Date: Mon, 13 Jan 2020 19:30:59 +0000 Subject: [PATCH 15/16] Translated using Weblate (German) Currently translated at 100.0% (3748 of 3748 strings) --- OsmAnd/res/values-de/phrases.xml | 110 +++++++++++++++---------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index 1ec73bd270..5dd440270c 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -763,7 +763,7 @@ Slowakisches Wiki Polnisches Wiki Niederländisches Wiki - Neu-Norwegisches Wiki + Neu-norwegisches Wiki Norwegisches Wiki Kroatisches Wiki Haitianisches Wiki @@ -773,7 +773,7 @@ Arabisches Wiki Weißrussisches Wiki Bulgarisches Wiki - Cebuanosprachiges Wiki + Cebuano-Wiki Tschechisches Wiki Dänisches Wiki Deutsches Wiki @@ -864,7 +864,7 @@ Nationaler Wanderweg Regionaler Wanderweg Örtlicher Wanderweg - Wanderwegshinweis + Wanderweghinweis Leerungszeiten Betriebszeiten Verlassenes Objekt @@ -933,7 +933,7 @@ Dusche E-Mail Fax - "Facebook " + Facebook Handy nein ja @@ -944,7 +944,7 @@ Zutritt verboten Kundenverkehr frei Lieferverkehr frei - Landwirtschaftl. Verkehr frei + Landwirtschaftlicher Verkehr frei Recyclingzentrum Aluminium Weiße Ware @@ -1030,7 +1030,7 @@ Anfangsdatum ja nein - Eingeschränkt + eingeschränkt Großhandel Inhalt: Silage Inhalt: Wasser @@ -1133,7 +1133,7 @@ Maximalbreite IATA-Code ICAO-Code - FAA Code + FAA-Code Breite Architekt Architektur: Modern @@ -1174,7 +1174,7 @@ Tanz Militär Kinder - Frauen + Damen Sport Männer Orthopädisch @@ -1329,7 +1329,7 @@ ja Nicht überdacht Nicht erlaubt - Nur Außerhalb + Nur außerhalb Erlaubt In einem separaten Raum ja @@ -1357,7 +1357,7 @@ Trittsteine Grüne Wiese Jainismus - schwarzes Brett + Schwarzes Brett Gartenstil: Englisch Gartenstil: Japanisch Kapazität @@ -1374,8 +1374,8 @@ Elternplätze Kabinen-, Gondel-, Sesselkapazität Kapazität pro Stunde - durchschnittliche Fahrzeit, Minuten - mit Überdachung + Durchschnittliche Fahrzeit, Minuten + Mit Überdachung Ohne Überdachung ja Keine Heizung @@ -1387,7 +1387,7 @@ Ein- und Ausgang Sommereingang Sommerausgang - Sommer Ein- und Ausgang + Sommerein- und -ausgang 1 (Tourist) 1S (gehobener Tourist) 2 (Standard) @@ -1397,7 +1397,7 @@ 4 (Erste Klasse) 4S (gehobene Erste Klasse) 5 (Luxus) - 5S (gehobenes De Luxe) + 5S (gehobener Luxus) Sterne: 6 Sterne: 7 Zimmer @@ -1467,7 +1467,7 @@ Pfingstler Kirche von England Episkopalkirche - Schia + Schiitisch Vereinigten Tibetisch Vereinigt Reformiert @@ -1504,11 +1504,11 @@ Stadt Nekropole Erdarbeiten - Megalith-Typ: Menhir - Megalith-Typ: Dolmen + Megalithtyp: Menhir + Megalithtyp: Dolmen Befestigungstyp: Wallburg Befestigungstyp: Limes - Festungsbautyp: Schanze + Befestungstyp: Schanze Befestigungstyp: Ringgraben Pa (befestigte Siedlung der Maori) Historischer Bauernhof @@ -1603,8 +1603,8 @@ Unitarisch Wesleyaner Shingon-shū - Mahayana Buddhisten - Jersey Barriere + Mahayana-Buddhisten + Jersey-Barriere Nadelwald Küche Wegweiser @@ -1620,7 +1620,7 @@ Lkw-Maut ja Ohne Blindenleitsystem - Nur wenn Gehen erlaubt ist + Nur, wenn Gehen erlaubt ist Raststätte Bahnübergang Reiten @@ -1669,7 +1669,7 @@ Routex-Tankkarten nicht akzeptiert Bancomat Bancomat nicht akzeptiert - vorausbezahlte Fahrkarten + Vorausbezahlte Fahrkarten JCB JCB-Karten nicht akzeptiert Eurowag @@ -1693,9 +1693,9 @@ E‑ZPass nicht akzeptiert KITCard KITCard nicht akzeptiert - V PAY + V-Pay V-Pay-Karten nicht akzeptiert - Dogecoin Ɖ + Dogecoin Dogecoin nicht akzeptiert Cibus Cibus-Karten nicht akzeptiert @@ -1705,7 +1705,7 @@ Geldkarte nicht akzeptiert Proton Proton-Karten nicht akzeptiert - Avant Karte + Avantcard Avantcard nicht akzeptiert MEP MEP nicht akzeptiert @@ -1719,7 +1719,7 @@ Monedero 4B nicht akzeptiert Monedero Monedero nicht akzeptiert - BankAxes + BankAxess BankAxess nicht akzeptiert Coinkite Coinkite nicht akzeptiert @@ -1727,8 +1727,8 @@ Roadrunner-Karten nicht akzeptiert SVG SVG nicht akzeptiert - SMS Zahlungen - SMS-Zahlung nicht akzeptiert + SMS-Zahlungen + SMS-Zahlungen nicht akzeptiert OV-Chipkaart OV-Chipkaart nicht akzeptiert Oyster @@ -1751,7 +1751,7 @@ Golden Crown-Karten nicht akzeptiert PRO100 PRO100-Karten nicht akzeptiert - Union Karte + Union-Karte Union-Karte nicht akzeptiert MTS-Money MTS-Money nicht akzeptiert @@ -1762,19 +1762,19 @@ Internetzugang: kostenlos Veranstaltungsort Nur vegetarisch - Vegetarische + Vegetarisch Vegetarisch: nein - vegetarisch (wenige) + Vegetarisch (wenige) Nur vegan Vegan Vegan: nein - Nur glutenfreie - glutenfrei + Nur glutenfrei + Glutenfrei Glutenfrei: nein Nur koscher Koscher Koscher: nein - Nur Halal + Nur halal Halal Halal: nein Nur laktosefrei @@ -1799,7 +1799,7 @@ Rundumservice Flugzeugtankstelle Öffentliches Bad - im Freien + Im Freien Innen Rollstuhlgerechte Toilette: ja Rollstuhlgerechte Toilette: nein @@ -1817,7 +1817,7 @@ Fahrscheine Getränke Süßigkeiten - Paketausgabe und -annahmestelle + Paketausgabe- und -annahmestelle Kondome Briefmarken Essen @@ -1850,7 +1850,7 @@ Stele Büste Koshinto - blaue Plakette + Blaue Plakette Jizo Kreuzförmig Fahrzeug @@ -1905,8 +1905,8 @@ Felsüberhang Sonnenschutz Feldhütte - Unterstand-Typ: Zelt - Unterstand-Typ: verlassen + Unterstandtyp: Zelt + Unterstandtyp: verlassen Tempelturm Baryt Strangmoor @@ -1924,7 +1924,7 @@ Kunstart: Stele Kunstart: Brunnen Architektur: Stalinistischer Neoklassizismus - Architektur: Eklektisch + Architektur: eklektisch Architektur: Neue Sachlichkeit Architektur: Zeitgenössisch Architektur: Konstruktivismus @@ -1932,7 +1932,7 @@ Architektur: Holzrahmen Architektur: Jugendstil Architektur: Neoklassizismus - Architektur: Viktorianisch + Architektur: viktorianisch Architektur: Brutalismus Architektur: Klassizismus Architektur: Gotik @@ -1943,12 +1943,12 @@ Architektur: Romanik Wassertunnel Wasserbrücke - Brückenkonstruktion: Strahl + Brückenkonstruktion: Balken Brückenkonstruktion: einfache Aufhängung Brückenkonstruktion: Aufhängung Brückenkonstruktion: Bogen Brückenkonstruktion: Fachwerk - Brückenkonstruktion: Schwimmend + Brückenkonstruktion: schwimmend Brückenkonstruktion: Buckel Brückenkonstruktion: Schrägseil Brückenkonstruktion: Promenade @@ -1966,7 +1966,7 @@ Beweglicher Brückentyp: Schubbrücke Beleuchtung: ja Beleuchtung: nein - Oberfläche: unbefestigte + Oberfläche: unbefestigt Oberfläche: befestigt Oberfläche: Asphalt Oberfläche: Beton @@ -1990,7 +1990,7 @@ Oberfläche: Salz Oberfläche: Schnee Bus - geteiltes Taxi + Geteiltes Taxi Oberleitungsbus Straßenbahn Zug @@ -2012,7 +2012,7 @@ Fahrradpumpe: nein Fahrradwerkzeuge für Eigenreparatur: nein Werkzeuge für Eigenreparatur - Reinigung + Fahrradreinigung Fahrradreinigung: nein Fahrradkettenwerkzeug Fahrradkettenwerkzeug: nein @@ -2055,7 +2055,7 @@ Beförderungstyp: Pferd Honiggeschäft Technisches Denkmal - Camping-Büro + Campingbüro Modellflugplatz Fremdenführerbüro Mittlerorganisation @@ -2105,7 +2105,7 @@ Burgtyp: Palast Burgtyp: Verteidigung, stattlich Thailändisch - Sexuelle + Sexuell Massagen Therapeutisch Sauna @@ -2237,9 +2237,9 @@ Typ: Steinkreuz Hüttenkreis Petroglyphe - Megalith-Typ: Nuraghe - Megalith-Typ: Steinkreis - Megalith-Typ: Ganggrab + Megalithtyp: Nuraghe + Megalithtyp: Steinkreis + Megalithtyp: Ganggrab Gipfelkreuz: ja Vermittlung: ja Afrikanisches Wiki @@ -2248,7 +2248,7 @@ Bishnupriyaisches Wiki Bretonisches Wiki Walisisches Wiki - Esperantoisches Wiki + Esperanto-Wiki Baskisches Wiki Farsisches Wiki Malayalamisches Wiki @@ -2257,7 +2257,7 @@ Warayisches Wiki Minangkabauisches Wiki Minnanisches Wiki - Malagasisches Wiki + Madagassisches Wiki Tatarisches Wiki Kirgisisches Wiki Tadschikisches Wiki @@ -2270,7 +2270,7 @@ Aragonesisches Wiki Gujaratisches Wiki Palsamoor - IC gespeicherte Fährfahrkarten + IC-gespeicherte Fährfahrkarten IC-gespeicherte Fährfahrkarten nicht akzeptiert Allgemeinmediziner Augenheilkunde @@ -2460,7 +2460,7 @@ Paragleiten: nein Drachenfliegen Drachenfliegen: nein - Strikt + Freeflying starr Freeflying starr: nein Freeflying Ausrichtung: N Freeflying-Platzausrichtung: NO From 6c93dc487898f3d635c2e9a3bb216c78dfc796ab Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 14 Jan 2020 17:16:58 +0100 Subject: [PATCH 16/16] Remove lowercase Fix #7947 --- .../plus/routepreparationmenu/AddPointBottomSheetDialog.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java index a411d5a128..94b4dfb0df 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java @@ -319,8 +319,8 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment { final View switchStartAndEndView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.bottom_sheet_item_simple_56dp, null); TextView title = (TextView) switchStartAndEndView.findViewById(R.id.title); - String start = getString(R.string.route_start_point).toLowerCase(); - String destination = getString(R.string.route_descr_destination).toLowerCase(); + String start = getString(R.string.route_start_point); + String destination = getString(R.string.route_descr_destination); String titleS = getString(R.string.swap_two_places, start, destination); SpannableString titleSpan = new SpannableString(titleS); int startIndex = titleS.indexOf(start);