From 00448eca4da0679c250c809ef6c6c797ebf3c1cc Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 11 Aug 2012 00:14:05 +0200 Subject: [PATCH 01/14] Update speed cameras icons --- .../res/drawable-hdpi/warnings_speed_bump.png | Bin 4373 -> 7664 bytes .../drawable-hdpi/warnings_speed_camera.png | Bin 2949 -> 5457 bytes .../plus/routing/RouteCalculationResult.java | 4 +-- .../osmand/plus/routing/RoutingHelper.java | 4 +-- .../net/osmand/plus/views/MapInfoLayer.java | 2 +- .../osmand/plus/views/RouteInfoControls.java | 32 +++++++++++++++--- 6 files changed, 32 insertions(+), 10 deletions(-) diff --git a/OsmAnd/res/drawable-hdpi/warnings_speed_bump.png b/OsmAnd/res/drawable-hdpi/warnings_speed_bump.png index ce09cf4c3a6daae5ade08eb4d5833a72262cf0e5..8d24847d55b0456b1166170de95e1147eab1b1fd 100644 GIT binary patch literal 7664 zcmZu$Wl+>#)czqzr*wC-bW85iy>z(1g5*l0hzNpo3rL4_FCeia`NZ^fY8tl0x>dj_44=fbM^9O(}qCUynVf#-JUrCz{{n46BkpH z0~*E4)jwd}n9%pSUdGh;Y{uaDP^uIj0d@j%of!6_MQUgtg}OQp<49o)c2ZJk0yR{K zIF4`uZ=1b1DZC^m?(5A)PzeIvdAU1w*D|lPS9_Mh({N)x{5`0#sflfy)6E4Xn`oEFKe}5C^ayb#&MQj6i@r@0;BjAT<9fI|vJ~dCyLb zRhR;>Q98w_0j`gM+6nVGb-+>-pmNq7lmiw(fT*^Gvlh_M3iOVX6Ey<(#DFL?CXye( z2?Fd#I5}Se5!nEh#;JwEZ^1h9J%M|qvKtlJxa8EsZ16!ocor7IEPUhIw1QO9@CWc5 z72*ECY zs*Hd7=!AN4nfe~C^b!5DmyQ5)4fcb{!GupknSAZ}Yu|$TqQ)AS1?)v;RhT7vp{`MB z-lW3)W}iqEy~(cO_yv7@onZtxsw4Q6aQ3AbEQdHt&Ln)=?8qzjJ}sO_@my?QVyK`T zx+zjx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)_HV-B72^#f z8dO=O(rM(VQPh0@`-m=#eM%`FdgvkUy6Z09dh4yS*S-7hyFB^ilSCpBW_GfI2in#c zzO5;ftr=;Wq2J_k{5qdM!ug9(flHy~2=tdIL+B7c1Q@hm_ zi>Uh6w*m_zeZ2kl+pJx?mc4uTmc1?rufP5}ufF;!bLPw;kw^qzC;{Nk=t$~cJIA`4|4eMVYY4C#)A(&$f;AO z0eMML%VPNO;q4!+q5@%AB=_#^v{>^$bGhX2^ZDOXAh2Xt z?)VMGTM??!OM#=to8}Eat*BUmQs?cW^r2c>sQl(PiErOdOG^unKmIre4jka<(W4wW za)bj14v-93_~{Eoqfy3;8N(Goi-lITV^wXBht0+Tz-pbG#M%jN(jl6;K-$V$AkXXhxt3LZ|87>#rw#%PsBBN25`~ z;c&YfA1HX9M@2E3-)CLuIpp`L>H5Lg=ET zPKFsr2wwBNPe0ev@=qykYkmiO2%M3$-^W&M2{B^3>&~;#vAWZHu&hA&|FIyg6f>lZ zecrN~|2302f=)Jk3MBo_Fg}5m*O}&=Yb>kwLbss)vBCp3yY7@)!x)3+DgxO4_-6xd z80znL-Rb4_a$Ks&D8(?taMoJZEK#VbvHXP-6ELPodF2GtjDJQ)v_3~lDb_m9ct^Vx z12Fy3QvumJAwotM*BdTHGb&Jt9_Z?&yvzA-d;t__?07yd!qr>-HN>Bs zxfUIcOBKb7`{$ysf0Rn;!}*EUOC74{RdqOb8JBSxmvI@FaT%BKS;YSXWNxZTv_1(V P00000NkvXXu0mjfmDi36 diff --git a/OsmAnd/res/drawable-hdpi/warnings_speed_camera.png b/OsmAnd/res/drawable-hdpi/warnings_speed_camera.png index 7e15ced9b3c5a5b09917ef0f37bb6a28eb95ab51..6f640f7ffa55617237c19a312b03092308770a65 100644 GIT binary patch literal 5457 zcmZv9bx_pN*Zzm@?vyU+2FYE7r5hHdYv~e1KyhK|?p_4xSR@1_r8}f!=@1bC1rd~b z`TpMb_s2W)-kEcsd(YgtbMBevoOy1nfu05lAtNCG03@0a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GD(dZKYH}2{`4T)1X;C;LU`hT zkjUB-Z9umWV$Pp`{z*|$5$Wmargp7dtx}Ua&YwT88nys%5^bpomD{9h2-MOF9^j0W z^1nieO+pCK+uIxWbKGQC2-+dwFd8rq8nj?6v;nl4wELx$7lja|LWm3^tG}SzPd4eN zN?wvu9s&*k-M~e(BI*NzY67TQmm>vjU5+%gdD}C9EVKnq)bcr3#gJ2zrK|^4>7Pe~ zHGl?8LGu7Um21=*Lv|u-bU4r;+I3<295>md8bej#d(l7*5NQZ}KtNyQVi#!AZz@dX z%*iHY%&Qfw^yZgZpeek 0 ? d / speed : 0; int vl = inf.updateDistanceAndGetPriority(time, d); - if(vl < value){ + if(vl < value && (!showCameras || inf.getType() == AlarmInfo.SPEED_CAMERA)){ mostImportant = inf; value = vl; } diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 4b091803f8..6777259e77 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -467,7 +467,7 @@ public class RoutingHelper { return i; } - public synchronized AlarmInfo getMostImportantAlarm(MetricsConstants mc){ + public synchronized AlarmInfo getMostImportantAlarm(MetricsConstants mc, boolean showCameras){ float mxspeed = route.getCurrentMaxSpeed(); AlarmInfo speedAlarm = null; if(mxspeed != 0 && lastFixedLocation != null && lastFixedLocation.hasSpeed()) { @@ -482,7 +482,7 @@ public class RoutingHelper { speedAlarm = AlarmInfo.createSpeedLimit(speed); } } - return route.getMostImportantAlarm(lastFixedLocation, speedAlarm); + return route.getMostImportantAlarm(lastFixedLocation, speedAlarm, showCameras); } public String formatStreetName(String name, String ref) { diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java index a09ccc355f..69fb8270d9 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java @@ -321,7 +321,7 @@ public class MapInfoLayer extends OsmandMapLayer { flp = new FrameLayout.LayoutParams((int)(78 * scaleCoefficient), (int)(78 * scaleCoefficient), Gravity.RIGHT | Gravity.BOTTOM); - flp.rightMargin = STATUS_BAR_MARGIN_X; + flp.rightMargin = (int) (10*scaleCoefficient); flp.bottomMargin = (int) (85*scaleCoefficient); alarmControl.setLayoutParams(flp); diff --git a/OsmAnd/src/net/osmand/plus/views/RouteInfoControls.java b/OsmAnd/src/net/osmand/plus/views/RouteInfoControls.java index 37674c94ec..10eebbeeb3 100644 --- a/OsmAnd/src/net/osmand/plus/views/RouteInfoControls.java +++ b/OsmAnd/src/net/osmand/plus/views/RouteInfoControls.java @@ -16,6 +16,8 @@ import net.osmand.plus.routing.RouteDirectionInfo; import net.osmand.plus.routing.RoutingHelper; import net.osmand.router.TurnType; import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Matrix; @@ -516,6 +518,7 @@ public class RouteInfoControls { paintCircle.setStrokeWidth(11 * scaleCoefficient); paintCircle.setStyle(Style.STROKE); paintCircle.setAntiAlias(true); + paintCircle.setDither(true); final Paint content = new Paint(); content.setColor(Color.WHITE); content.setStyle(Style.FILL); @@ -527,18 +530,22 @@ public class RouteInfoControls { final MapInfoControl alarm = new MapInfoControl(ctx) { private String text = ""; + private Bitmap img = null; + private int imgId; @Override public boolean updateInfo() { boolean limits = settings.SHOW_SPEED_LIMITS.get(); boolean cams = settings.SHOW_CAMERAS.get(); boolean visible = false; if ((limits || cams) && routingHelper != null && routingHelper.isFollowingMode()) { - AlarmInfo alarm = routingHelper.getMostImportantAlarm(settings.METRIC_SYSTEM.get()); + AlarmInfo alarm = routingHelper.getMostImportantAlarm(settings.METRIC_SYSTEM.get(), cams); if(alarm != null) { + int locimgId = 0; if(alarm.getType() == AlarmInfo.SPEED_LIMIT) { text = alarm.getIntValue() +""; } else if(alarm.getType() == AlarmInfo.SPEED_CAMERA) { text = "CAM"; + locimgId = R.drawable.warnings_speed_camera; } else if(alarm.getType() == AlarmInfo.BORDER_CONTROL) { text = "CLO"; } else if(alarm.getType() == AlarmInfo.TOLL_BOOTH) { @@ -546,6 +553,7 @@ public class RouteInfoControls { } else if(alarm.getType() == AlarmInfo.TRAFFIC_CALMING) { // temporary omega text = "~^~"; + locimgId = R.drawable.warnings_speed_bump; } else if(alarm.getType() == AlarmInfo.STOP) { // text = "STOP"; } @@ -557,6 +565,16 @@ public class RouteInfoControls { visible = limits; } } + if(visible) { + if(locimgId != imgId) { + imgId = locimgId; + if(imgId == 0) { + img = null; + } else { + img = BitmapFactory.decodeResource(getResources(), locimgId); + } + } + } } } updateVisibility(visible); @@ -565,10 +583,14 @@ public class RouteInfoControls { @Override protected void onDraw(Canvas canvas) { - RectF f = new RectF(th / 2, th / 2, getWidth() - th / 2, getHeight() - th / 2); - canvas.drawOval(f, content); - canvas.drawOval(f, paintCircle); - canvas.drawText(text, getWidth() / 2, getHeight() / 2 + ptext.descent() + 3 * scaleCoefficient, ptext); + if(img == null) { + RectF f = new RectF(th / 2, th / 2, getWidth() - th / 2, getHeight() - th / 2); + canvas.drawOval(f, content); + canvas.drawOval(f, paintCircle); + canvas.drawText(text, getWidth() / 2, getHeight() / 2 + ptext.descent() + 3 * scaleCoefficient, ptext); + } else { + canvas.drawBitmap(img, 0, 0, paintCircle); + } } }; From 108edbdf4f96c9c15e4dc6e6fd5ba1e6395344cc Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 11 Aug 2012 01:40:31 +0200 Subject: [PATCH 02/14] Fix turn calculation issues --- .../src/net/osmand/router/BinaryRoutePlanner.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/DataExtractionOSM/src/net/osmand/router/BinaryRoutePlanner.java b/DataExtractionOSM/src/net/osmand/router/BinaryRoutePlanner.java index 1f0a9289b8..b3f811916b 100644 --- a/DataExtractionOSM/src/net/osmand/router/BinaryRoutePlanner.java +++ b/DataExtractionOSM/src/net/osmand/router/BinaryRoutePlanner.java @@ -757,6 +757,8 @@ public class BinaryRoutePlanner { return false; } + private static final float TURN_DEGREE_MIN = 45; + /** * Helper method to prepare final result */ @@ -826,12 +828,12 @@ public class BinaryRoutePlanner { if (next != rr.getEndPointIndex() && !rr.getObject().roundabout() && attachedRoutes != null) { float before = rr.getBearing(next, !plus); float after = rr.getBearing(next, plus); - boolean straight = Math.abs(MapUtils.degreesDiff(before + 180, after)) < 70; + boolean straight = Math.abs(MapUtils.degreesDiff(before + 180, after)) < TURN_DEGREE_MIN; boolean split = false; // split if needed for (RouteSegmentResult rs : attachedRoutes) { double diff = MapUtils.degreesDiff(before + 180, rs.getBearingBegin()); - if (Math.abs(diff) < 50) { + if (Math.abs(diff) <= TURN_DEGREE_MIN) { split = true; } else if (!straight && Math.abs(diff) < 100) { split = true; @@ -988,7 +990,7 @@ public class BinaryRoutePlanner { if (prev != null) { // add description about turn double mpi = MapUtils.degreesDiff(prev.getBearingEnd(), rr.getBearingBegin()); - if (mpi >= 50) { + if (mpi >= TURN_DEGREE_MIN) { if (mpi < 60) { t = TurnType.valueOf(TurnType.TSLL, leftSide); } else if (mpi < 120) { @@ -998,7 +1000,7 @@ public class BinaryRoutePlanner { } else { t = TurnType.valueOf(TurnType.TU, leftSide); } - } else if (mpi < -50) { + } else if (mpi < -TURN_DEGREE_MIN) { if (mpi > -60) { t = TurnType.valueOf(TurnType.TSLR, leftSide); } else if (mpi > -120) { @@ -1062,14 +1064,15 @@ public class BinaryRoutePlanner { if(attachedRoutes != null){ for(RouteSegmentResult rs : attachedRoutes){ double ex = MapUtils.degreesDiff(rs.getBearingBegin(), rr.getBearingBegin()); - if(ex < 45 && ex >= 0) { + double mpi = Math.abs(MapUtils.degreesDiff(prev.getBearingEnd(), rs.getBearingBegin())) ; + if((ex < TURN_DEGREE_MIN || mpi < TURN_DEGREE_MIN) && ex >= 0) { kl = true; int lns = rs.getObject().getLanes(); if (lns > 0) { right += lns; } speak = speak || !highwayLowEnd(rs.getObject().getHighway()); - } else if(ex > -45 && ex <= 0) { + } else if((ex > -TURN_DEGREE_MIN || mpi < TURN_DEGREE_MIN) && ex <= 0) { kr = true; int lns = rs.getObject().getLanes(); if (lns > 0) { From 93abc73ab00624ae3c4fedc8158ffa3d8de761f4 Mon Sep 17 00:00:00 2001 From: Pavol Zibrita Date: Sat, 11 Aug 2012 02:53:41 +0200 Subject: [PATCH 03/14] Increase touch area of the close button --- .../plus/activities/MainMenuActivity.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java b/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java index 7d4e163f63..963b77b051 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java @@ -22,6 +22,7 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; +import android.graphics.Rect; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -29,8 +30,11 @@ import android.text.SpannableString; import android.text.method.LinkMovementMethod; import android.text.style.ClickableSpan; import android.view.KeyEvent; +import android.view.MotionEvent; +import android.view.TouchDelegate; import android.view.View; import android.view.View.OnClickListener; +import android.view.View.OnTouchListener; import android.view.Window; import android.view.animation.AccelerateInterpolator; import android.view.animation.Animation; @@ -207,7 +211,7 @@ public class MainMenuActivity extends Activity { } }); - View closeButton = window.findViewById(R.id.CloseButton); + final View closeButton = window.findViewById(R.id.CloseButton); closeButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { @@ -222,6 +226,27 @@ public class MainMenuActivity extends Activity { } } }); + closeButton.setOnTouchListener(new OnTouchListener() { + @Override + public boolean onTouch(View v, MotionEvent event) { + closeButton.performClick(); + return true; + } + }); + //increase touch area for the button + final View parent = (View) closeButton.getParent(); + parent.post( new Runnable() { + // Post in the parent's message queue to make sure the parent + // lays out its children before we call getHitRect() + @Override + public void run() { + Rect r = new Rect(); + closeButton.getHitRect(r); + r.right += r.width() * 3; + r.bottom += r.height() * 3; + parent.setTouchDelegate(new TouchDelegate(r, closeButton)); + } + }); View searchButton = window.findViewById(R.id.SearchButton); searchButton.setOnClickListener(new OnClickListener() { From 748167678dc2671b3709e24c5e30fbab30d0da90 Mon Sep 17 00:00:00 2001 From: Pavol Zibrita Date: Sat, 11 Aug 2012 03:10:07 +0200 Subject: [PATCH 04/14] Added Catalan language resources --- OsmAnd/res/values-ca/bidforfix.xml | 3 +++ OsmAnd/res/values-ca/strings.xml | 3 +++ plugins/Osmand-ParkingPlugin/res/values-ca/strings.xml | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 OsmAnd/res/values-ca/bidforfix.xml create mode 100644 OsmAnd/res/values-ca/strings.xml create mode 100644 plugins/Osmand-ParkingPlugin/res/values-ca/strings.xml diff --git a/OsmAnd/res/values-ca/bidforfix.xml b/OsmAnd/res/values-ca/bidforfix.xml new file mode 100644 index 0000000000..81fcead2f0 --- /dev/null +++ b/OsmAnd/res/values-ca/bidforfix.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml new file mode 100644 index 0000000000..9c5ad89af1 --- /dev/null +++ b/OsmAnd/res/values-ca/strings.xml @@ -0,0 +1,3 @@ + + + diff --git a/plugins/Osmand-ParkingPlugin/res/values-ca/strings.xml b/plugins/Osmand-ParkingPlugin/res/values-ca/strings.xml new file mode 100644 index 0000000000..81fcead2f0 --- /dev/null +++ b/plugins/Osmand-ParkingPlugin/res/values-ca/strings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file From 20cf9a5dc01169fce731ab03049992ef021a7e5b Mon Sep 17 00:00:00 2001 From: sonora Date: Sat, 11 Aug 2012 10:12:29 +0200 Subject: [PATCH 05/14] fix tracking icon behavior --- OsmAnd/res/values/strings.xml | 4 ++-- .../net/osmand/plus/monitoring/OsmandMonitoringPlugin.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 2197614ecd..539daf533d 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,8 +9,8 @@ 1. All your modified/created strings are in the top of the file (to make easier find what's translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> - Live tracking - Stop Live tracking + Start live tracking + Stop live tracking Configure screen… Show lanes Avoid unpaved roads diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java index c2fc6b6c7e..43e0beeaec 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java @@ -263,7 +263,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements LockInfoCont final ActionItem bgServiceAction = new ActionItem(); final boolean off = !view.getSettings().SAVE_TRACK_TO_GPX.get(); bgServiceAction.setTitle(view.getResources().getString(off? R.string.monitoring_mode_off : R.string.monitoring_mode_on)); - bgServiceAction.setIcon(view.getResources().getDrawable(off ? R.drawable.monitoring_rec_big : R.drawable.monitoring_rec_inactive)); + bgServiceAction.setIcon(view.getResources().getDrawable(off ? R.drawable.monitoring_rec_inactive : R.drawable.monitoring_rec_big)); bgServiceAction.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -290,7 +290,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements LockInfoCont final ActionItem liveAction = new ActionItem(); final boolean liveoff = !view.getSettings().LIVE_MONITORING.get(); liveAction.setTitle(view.getResources().getString(liveoff? R.string.live_monitoring_mode_off : R.string.live_monitoring_mode_on)); - liveAction.setIcon(view.getResources().getDrawable(liveoff?R.drawable.monitoring_rec_big:R.drawable.monitoring_rec_inactive)); + liveAction.setIcon(view.getResources().getDrawable(liveoff? R.drawable.monitoring_rec_inactive : R.drawable.monitoring_rec_big)); liveAction.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { From c4f4a5e405a00f140faa746099e44a5855848642 Mon Sep 17 00:00:00 2001 From: sonora Date: Sat, 11 Aug 2012 10:18:59 +0200 Subject: [PATCH 06/14] fix sleep mode icon --- .../osmand/plus/background/OsmandBackgroundServicePlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/background/OsmandBackgroundServicePlugin.java b/OsmAnd/src/net/osmand/plus/background/OsmandBackgroundServicePlugin.java index d6032a21ea..df9dda6e5d 100644 --- a/OsmAnd/src/net/osmand/plus/background/OsmandBackgroundServicePlugin.java +++ b/OsmAnd/src/net/osmand/plus/background/OsmandBackgroundServicePlugin.java @@ -153,7 +153,7 @@ public class OsmandBackgroundServicePlugin extends OsmandPlugin implements LockI final ActionItem bgServiceAction = new ActionItem(); final boolean off = view.getApplication().getNavigationService() == null; bgServiceAction.setTitle(view.getResources().getString(!off? R.string.bg_service_sleep_mode_on : R.string.bg_service_sleep_mode_off)); -// bgServiceAction.setIcon(view.getResources().getDrawable(R.drawable.car_small)); + bgServiceAction.setIcon(view.getResources().getDrawable(!off? R.drawable.monitoring_rec_big : R.drawable.monitoring_rec_inactive)); bgServiceAction.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { From 2cd9b2d9cd5a66a29b8ca8d6e2bea5b813580331 Mon Sep 17 00:00:00 2001 From: sonora Date: Sat, 11 Aug 2012 10:42:27 +0200 Subject: [PATCH 07/14] try line breaks for tracking buttons --- OsmAnd/res/values/strings.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 539daf533d..bf3c83ff11 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,8 +9,8 @@ 1. All your modified/created strings are in the top of the file (to make easier find what's translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> - Start live tracking - Stop live tracking + Start\n live tracking + Stop\n live tracking Configure screen… Show lanes Avoid unpaved roads @@ -25,9 +25,9 @@ Viewing direction Transparent skin Record GPX - Stop GPX rec. - Enable sleep mode - Stop sleep mode + Stop\n GPX rec. + Enable\n sleep mode + Stop\n sleep mode GPS wake-up interval : %s Continuously To unlock screen press lock icon From c35d5ef91ba64bb1fc6ce318be8f765aca8dbd9f Mon Sep 17 00:00:00 2001 From: sonora Date: Sat, 11 Aug 2012 10:56:35 +0200 Subject: [PATCH 08/14] fix lock icon. Icons should display status while text describes action. --- OsmAnd/src/net/osmand/plus/views/LockInfoControl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/LockInfoControl.java b/OsmAnd/src/net/osmand/plus/views/LockInfoControl.java index 9b5bcbe5f1..54e9a8f5fb 100644 --- a/OsmAnd/src/net/osmand/plus/views/LockInfoControl.java +++ b/OsmAnd/src/net/osmand/plus/views/LockInfoControl.java @@ -116,7 +116,7 @@ public class LockInfoControl { final ActionItem lockScreenAction = new ActionItem(); lockScreenAction.setTitle(view.getResources().getString( isScreenLocked ? R.string.bg_service_screen_unlock : R.string.bg_service_screen_lock)); - lockScreenAction.setIcon(view.getResources().getDrawable(isScreenLocked ? R.drawable.lock_disabled : R.drawable.lock_enabled)); + lockScreenAction.setIcon(view.getResources().getDrawable(isScreenLocked ? R.drawable.lock_enabled : R.drawable.lock_disabled)); lockScreenAction.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { From 1cf9bf5c65d099c97206626ea8efdf8493db46b6 Mon Sep 17 00:00:00 2001 From: sonora Date: Sat, 11 Aug 2012 22:38:14 +0200 Subject: [PATCH 09/14] fix time interval options --- .../osmand/plus/background/OsmandBackgroundServicePlugin.java | 4 ++-- .../net/osmand/plus/monitoring/OsmandMonitoringPlugin.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/background/OsmandBackgroundServicePlugin.java b/OsmAnd/src/net/osmand/plus/background/OsmandBackgroundServicePlugin.java index df9dda6e5d..7b652348ec 100644 --- a/OsmAnd/src/net/osmand/plus/background/OsmandBackgroundServicePlugin.java +++ b/OsmAnd/src/net/osmand/plus/background/OsmandBackgroundServicePlugin.java @@ -29,8 +29,8 @@ import android.preference.PreferenceScreen; import android.view.View; public class OsmandBackgroundServicePlugin extends OsmandPlugin implements LockInfoControlActions { - public static final int[] MINUTES = new int[]{2, 3, 5, 10, 15, 30, 45, 60, 90}; - public static final int[] SECONDS = new int[]{0, 30, 45, 60}; + public static final int[] SECONDS = new int[]{0, 30, 60, 90}; + public static final int[] MINUTES = new int[]{2, 3, 5, 10, 15, 30, 60, 90}; private final static boolean REGISTER_BG_SETTINGS = false; private static final String ID = "osmand.backgroundservice"; private OsmandSettings settings; diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java index 43e0beeaec..1ed5de07c8 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java @@ -106,8 +106,8 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements LockInfoCont adapter.registerItem(R.string.context_menu_item_add_waypoint, R.drawable.list_activities_gpx_waypoint, listener, -1); } - public static final int[] MINUTES = new int[]{2, 3, 5, 10, 15, 30, 45, 60, 90}; - public static final int[] SECONDS = new int[] { 1, 2, 3, 5}; + public static final int[] SECONDS = new int[] {1, 2, 3, 5, 10, 15, 30, 60, 90}; + public static final int[] MINUTES = new int[] {2, 3, 5}; @Override public void settingsActivityCreate(final SettingsActivity activity, PreferenceScreen screen) { From b93aba0a9cd732095e77d492892e68446373f3c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an?= Date: Sun, 12 Aug 2012 11:27:39 +0300 Subject: [PATCH 10/14] updated slovak translation --- OsmAnd/res/values-sk/strings.xml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index a2fa145b5f..23d5d0229b 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -1,5 +1,8 @@ -Konfigurovať obrazovku… + + Spustiť\n stopovanie naživo + Zastaviť\n stopovanie naživo + Konfigurovať obrazovku… Zobraziť jazdné pruhy Nespevneným cestám Trajektom @@ -15,9 +18,9 @@ Interval prebúdzania GPS: %s Priebežne GPX zázn. - GPX vyp. - Zapnúť režim spánku - Vypnúť režim spánku + Zastavit\n GPX záznam + Zapnúť\n režim spánku + Vypnúť\n režim spánku Názov ulice Konfigurácia Výber mapy From fb3bd384000d2dfdcdfd4e8c564b029bd2ab2252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an?= Date: Sun, 12 Aug 2012 16:01:24 +0300 Subject: [PATCH 11/14] updated slovak translation --- OsmAnd/res/values-sk/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 23d5d0229b..de33124dba 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -3,7 +3,7 @@ Spustiť\n stopovanie naživo Zastaviť\n stopovanie naživo Konfigurovať obrazovku… - Zobraziť jazdné pruhy + Jazdné pruhy Nespevneným cestám Trajektom Vyhnúť sa… @@ -919,9 +919,9 @@ Zobrazenie radarov (môže byť zakázané v niektorých krajinách) Zobrazenie radarov a spomaľovačov Vyvarovanie sa plateným cestám pri kalkulácii trasy - Zobrazenie radarov - Zobraziť radary - Vyhnúť sa spoplatneným cestám + Radary + Rýchlostné obmedzenia + Spoplatneným cestám Zmeny vo verzii 0.8.2 : \n\t* Vylepšená navigácia \n\t* Dynamické mapové widgety From 0a4e0ae3b821db47c17c94840cbdf19452d6d42b Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 13 Aug 2012 00:04:16 +0200 Subject: [PATCH 12/14] Add double buffer for images --- OsmAnd/.project | 6 --- .../src/net/osmand/plus/RotatedTileBox.java | 14 +++--- .../osmand/plus/activities/MapActivity.java | 21 ++------- .../plus/render/MapRenderRepositories.java | 43 ++++++++++++------- .../osmand/plus/render/MapVectorLayer.java | 30 ++++++------- .../osmand/plus/render/OsmandRenderer.java | 4 -- .../osmand/plus/routing/RoutingHelper.java | 2 +- .../osmand/plus/views/MapControlsLayer.java | 12 +++--- .../net/osmand/plus/views/MapInfoLayer.java | 2 +- .../plus/views/NextTurnInfoControl.java | 2 +- 10 files changed, 65 insertions(+), 71 deletions(-) diff --git a/OsmAnd/.project b/OsmAnd/.project index ad1b540a68..54da46b446 100644 --- a/OsmAnd/.project +++ b/OsmAnd/.project @@ -89,11 +89,6 @@ - - net.rim.ajde.internal.verifier - - - com.android.ide.eclipse.adt.AndroidNature @@ -102,7 +97,6 @@ org.eclipse.cdt.core.ccnature org.eclipse.cdt.managedbuilder.core.managedBuildNature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - net.rim.ajde.BlackBerryAndroidNature diff --git a/OsmAnd/src/net/osmand/plus/RotatedTileBox.java b/OsmAnd/src/net/osmand/plus/RotatedTileBox.java index bb22dfa330..51466f0623 100644 --- a/OsmAnd/src/net/osmand/plus/RotatedTileBox.java +++ b/OsmAnd/src/net/osmand/plus/RotatedTileBox.java @@ -10,7 +10,7 @@ public class RotatedTileBox { private float tileWidth; private float tileHeight; private float rotate; - private int zoom; + private float zoom; private float rotateCos; private float rotateSin; @@ -28,7 +28,7 @@ public class RotatedTileBox { rotateSin = FloatMath.sin(rad); } - public void set(float leftTileX, float topTileY, float tileWidth, float tileHeight, float rotate, int zoom) { + public void set(float leftTileX, float topTileY, float tileWidth, float tileHeight, float rotate, float zoom) { this.leftTileX = leftTileX; if(rotate < 0){ rotate += 360; @@ -51,9 +51,13 @@ public class RotatedTileBox { return rotateSin; } - public int getZoom() { + public float getZoom() { return zoom; } + + public int getIntZoom() { + return Math.round(zoom); + } public float getRotate() { return rotate; @@ -77,7 +81,7 @@ public class RotatedTileBox { public boolean containsTileBox(RotatedTileBox box) { PointF temp = new PointF(); - if(box.getZoom() != zoom){ + if(box.zoom != zoom){ throw new UnsupportedOperationException(); } box.calcPointTile(0, 0, temp); @@ -105,7 +109,7 @@ public class RotatedTileBox { float tx3 = calcPointTileX(0, tileHeight); float minTileX = Math.min(Math.min(leftTileX, tx), Math.min(tx2, tx3)) ; float maxTileX = Math.max(Math.max(leftTileX, tx), Math.max(tx2, tx3)) ; - int max = 1 << zoom; + int max = (int) MapUtils.getPowZoom(zoom); if(minTileX < 0){ minTileX = 0; } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index d359f28cdd..bf365739dc 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -458,6 +458,7 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe } public void changeZoom(float newZoom){ + newZoom = Math.round(newZoom * OsmandMapTileView.ZOOM_DELTA) * OsmandMapTileView.ZOOM_DELTA_1; boolean changeLocation = settings.AUTO_ZOOM_MAP.get(); mapView.getAnimatedDraggingThread().startZooming(newZoom, changeLocation); if (getMyApplication().accessibilityEnabled()) @@ -703,7 +704,9 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe SensorManager sensorMgr = (SensorManager) getSystemService(SENSOR_SERVICE); Sensor s = sensorMgr.getDefaultSensor(Sensor.TYPE_ORIENTATION); if (s != null) { - sensorMgr.registerListener(this, s, SensorManager.SENSOR_DELAY_UI); + if(!sensorMgr.registerListener(this, s, SensorManager.SENSOR_DELAY_NORMAL)) { + Log.e(LogUtil.TAG, "Sensor could not be enabled"); + } } sensorRegistered = true; } @@ -881,22 +884,6 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe } public float defineZoomFromSpeed(float speed) { - // Hardy's old implementation: correct for roughly constant "look ahead" distance on different screens using screen size correction, see Issue 914 - // less than 23: show zoom 17 - // int screenSizeCorrection = (int)Math.round(Math.log(((float)getMapView().getHeight())/320.0f) / Math.log(2.0f)); - // if(speed < 23f/3.6){ - // return 17 + screenSizeCorrection; - // } else if(speed < 43f/3.6){ - // return 16 + screenSizeCorrection; - // } else if(speed < 63f/3.6){ - // return 15 + screenSizeCorrection; - // } else if(speed < 83f/3.6){ - // return 14 + screenSizeCorrection; - // } - // return 13 + screenSizeCorrection; - - // new implementation - // TODO Hardy: verify look ahead distance, there still seems bug in calculation if (speed < 7f / 3.6) { return 0; } diff --git a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java index 4ab905cc8f..1384650745 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java +++ b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java @@ -528,10 +528,10 @@ public class MapRenderRepositories { boolean loaded; if(nativeLib != null) { cObjects = new LinkedList(); - loaded = loadVectorDataNative(dataBox, requestedBox.getZoom(), renderingReq, nativeLib); + loaded = loadVectorDataNative(dataBox, requestedBox.getIntZoom(), renderingReq, nativeLib); } else { cNativeObjects = null; - loaded = loadVectorData(dataBox, requestedBox.getZoom(), renderingReq); + loaded = loadVectorData(dataBox, requestedBox.getIntZoom(), renderingReq); } if (!loaded || checkWhetherInterrupted()) { @@ -542,19 +542,19 @@ public class MapRenderRepositories { currentRenderingContext = new OsmandRenderer.RenderingContext(context); renderingReq.clearState(); - renderingReq.setIntFilter(renderingReq.ALL.R_MINZOOM, requestedBox.getZoom()); + renderingReq.setIntFilter(renderingReq.ALL.R_MINZOOM, requestedBox.getIntZoom()); if(renderingReq.searchRenderingAttribute(RenderingRuleStorageProperties.A_DEFAULT_COLOR)) { currentRenderingContext.defaultColor = renderingReq.getIntPropertyValue(renderingReq.ALL.R_ATTR_COLOR_VALUE); } renderingReq.clearState(); - renderingReq.setIntFilter(renderingReq.ALL.R_MINZOOM, requestedBox.getZoom()); + renderingReq.setIntFilter(renderingReq.ALL.R_MINZOOM, requestedBox.getIntZoom()); if(renderingReq.searchRenderingAttribute(RenderingRuleStorageProperties.A_SHADOW_RENDERING)) { currentRenderingContext.shadowRenderingMode = renderingReq.getIntPropertyValue(renderingReq.ALL.R_ATTR_INT_VALUE); currentRenderingContext.shadowRenderingColor = renderingReq.getIntPropertyValue(renderingReq.ALL.R_SHADOW_COLOR); } - currentRenderingContext.leftX = (float) requestedBox.getLeftTileX(); - currentRenderingContext.topY = (float) requestedBox.getTopTileY(); - currentRenderingContext.zoom = requestedBox.getZoom(); + currentRenderingContext.leftX = requestedBox.getLeftTileX(); + currentRenderingContext.topY = requestedBox.getTopTileY() ; + currentRenderingContext.zoom = requestedBox.getIntZoom(); currentRenderingContext.rotate = requestedBox.getRotate(); currentRenderingContext.width = (int) (requestedBox.getTileWidth() * OsmandRenderer.TILE_SIZE); currentRenderingContext.height = (int) (requestedBox.getTileHeight() * OsmandRenderer.TILE_SIZE); @@ -562,6 +562,8 @@ public class MapRenderRepositories { currentRenderingContext.useEnglishNames = prefs.USE_ENGLISH_NAMES.get(); currentRenderingContext.setDensityValue(prefs.USE_HIGH_RES_MAPS.get(), prefs.MAP_TEXT_SIZE.get(), renderer.getDensity()); + // init rendering context + currentRenderingContext.tileDivisor = (float) MapUtils.getPowZoom(31 - requestedBox.getZoom()); if (checkWhetherInterrupted()) { return; } @@ -573,19 +575,25 @@ public class MapRenderRepositories { if (rr != null) { transparent = renderingReq.getIntPropertyValue(rr) > 0; } -// if(transparent) { -// bmp = Bitmap.createBitmap(currentRenderingContext.width, currentRenderingContext.height, Config.ARGB_8888); -// } else { - bmp = Bitmap.createBitmap(currentRenderingContext.width, currentRenderingContext.height, Config.RGB_565); -// } // 1. generate image step by step + Bitmap reuse = prevBmp; this.prevBmp = this.bmp; this.prevBmpLocation = this.bmpLocation; + if (reuse != null && reuse.getWidth() == currentRenderingContext.width && reuse.getHeight() == currentRenderingContext.height) { + bmp = reuse; + bmp.eraseColor(currentRenderingContext.defaultColor); + } else { + if(reuse != null){ + log.error(String.format("Create new image ? %d != %d (w) %d != %d (h) ", currentRenderingContext.width, reuse.getWidth(), currentRenderingContext.height, reuse.getHeight())); + } + bmp = Bitmap.createBitmap(currentRenderingContext.width, currentRenderingContext.height, Config.RGB_565); + } this.bmp = bmp; this.bmpLocation = tileRect; + if(nativeLib != null) { renderer.generateNewBitmapNative(currentRenderingContext, nativeLib, cNativeObjects, bmp, renderingReq, notifyList); } else { @@ -601,8 +609,11 @@ public class MapRenderRepositories { // revert if it was interrupted // (be smart a bit do not revert if road already drawn) if(currentRenderingContext.lastRenderedKey < 35) { + reuse = this.bmp; this.bmp = this.prevBmp; this.bmpLocation = this.prevBmpLocation; + this.prevBmp = reuse; + this.prevBmpLocation = null; } currentRenderingContext = null; return; @@ -610,7 +621,8 @@ public class MapRenderRepositories { currentRenderingContext = null; // 2. replace whole image - this.prevBmp = null; + // keep cache + // this.prevBmp = null; this.prevBmpLocation = null; if (prefs.DEBUG_RENDERING_INFO.get()) { String timeInfo = "Searching: " + searchTime + " ms"; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ @@ -660,15 +672,16 @@ public class MapRenderRepositories { } public Bitmap getPrevBitmap() { - return prevBmp; + return prevBmpLocation == null ? null : prevBmp ; } public synchronized void clearCache() { cObjects = new ArrayList(); cObjectsBox = new RectF(); - prevBmp = null; + requestedBox = prevBmpLocation = null; // Do not clear main bitmap to not cause a screen refresh +// prevBmp = null; // bmp = null; // bmpLocation = null; } diff --git a/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java b/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java index 196e14eaab..655ad05c85 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java +++ b/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java @@ -49,13 +49,11 @@ public class MapVectorLayer extends BaseMapLayer { } private void updateRotatedTileBox(){ -// float ts = view.getTileSize(); - int zm = Math.round(view.getFloatZoom()); - float xL = view.calcDiffTileX(pixRect.left - view.getCenterPointX(), pixRect.top - view.getCenterPointY()) + view.getXTile(); - float yT = view.calcDiffTileY(pixRect.left - view.getCenterPointX(), pixRect.top - view.getCenterPointY()) + view.getYTile(); - float mult = (float) Math.pow(2, zm - view.getZoom()); - float ts = (float) (view.getSourceTileSize() * Math.pow(2, view.getFloatZoom() - (int) zm)); - rotatedTileBox.set(xL * mult, yT * mult, ((float) pixRect.width()) / ts , ((float) pixRect.height()) / ts, view.getRotate(), zm); + float mult = (float) Math.pow(2, view.getFloatZoom() - view.getZoom()); + float xL = (view.calcDiffTileX(pixRect.left - view.getCenterPointX(), pixRect.top - view.getCenterPointY()) + view.getXTile()); + float yT = (view.calcDiffTileY(pixRect.left - view.getCenterPointX(), pixRect.top - view.getCenterPointY()) + view.getYTile()) ; + float ts = view.getSourceTileSize(); + rotatedTileBox.set(xL * mult, yT * mult, ((float) pixRect.width()) / ts , ((float) pixRect.height()) / ts, view.getRotate(), view.getFloatZoom()); } public boolean isVectorDataVisible() { @@ -118,21 +116,23 @@ public class MapVectorLayer extends BaseMapLayer { if (bmp != null && bmpLoc != null) { float rot = bmpLoc.getRotate(); float mult = (float) MapUtils.getPowZoom(view.getZoom() - bmpLoc.getZoom()); + float fmult = (float) MapUtils.getPowZoom(view.getFloatZoom() - bmpLoc.getZoom()); - float tx = view.getXTile(); - float ty = view.getYTile(); - float dleftX1 = (bmpLoc.getLeftTileX() * mult - tx) ; - float dtopY1 = (bmpLoc.getTopTileY() * mult - ty); + float tx = view.getXTile() / mult; + float ty = view.getYTile() / mult; + float dleftX1 = bmpLoc.getLeftTileX() - tx; + float dtopY1 = bmpLoc.getTopTileY() - ty; + float ts = view.getSourceTileSize() * fmult; float cos = bmpLoc.getRotateCos(); float sin = bmpLoc.getRotateSin(); - float x1 = MapUtils.calcDiffPixelX(sin, cos, dleftX1, dtopY1, view.getTileSize()) + view.getCenterPointX(); - float y1 = MapUtils.calcDiffPixelY(sin, cos, dleftX1, dtopY1, view.getTileSize()) + view.getCenterPointY(); + float x1 = MapUtils.calcDiffPixelX(sin, cos, dleftX1, dtopY1, ts) + view.getCenterPointX(); + float y1 = MapUtils.calcDiffPixelY(sin, cos, dleftX1, dtopY1, ts) + view.getCenterPointY(); canvas.rotate(-rot, view.getCenterPointX(), view.getCenterPointY()); - destImage.set(x1, y1, x1 + bmpLoc.getTileWidth() * mult * view.getTileSize(), y1 + bmpLoc.getTileHeight() * mult - * view.getTileSize()); + destImage.set(x1, y1, x1 + bmpLoc.getTileWidth() * ts, y1 + + bmpLoc.getTileHeight() * ts); if(!bmp.isRecycled()){ canvas.drawBitmap(bmp, null, destImage, paintImg); shown = true; diff --git a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java index cdd145bd26..701864e598 100644 --- a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java @@ -160,8 +160,6 @@ public class OsmandRenderer { Bitmap bmp, RenderingRuleSearchRequest render, final List notifyList) { long now = System.currentTimeMillis(); if (rc.width > 0 && rc.height > 0 && searchResultHandler != null) { - // init rendering context - rc.tileDivisor = (int) (1 << (31 - rc.zoom)); rc.cosRotateTileSize = FloatMath.cos((float) Math.toRadians(rc.rotate)) * TILE_SIZE; rc.sinRotateTileSize = FloatMath.sin((float) Math.toRadians(rc.rotate)) * TILE_SIZE; try { @@ -201,8 +199,6 @@ public class OsmandRenderer { cv.drawColor(rc.defaultColor); } if (objects != null && !objects.isEmpty() && rc.width > 0 && rc.height > 0) { - // init rendering context - rc.tileDivisor = (int) (1 << (31 - rc.zoom)); rc.cosRotateTileSize = FloatMath.cos((float) Math.toRadians(rc.rotate)) * TILE_SIZE; rc.sinRotateTileSize = FloatMath.sin((float) Math.toRadians(rc.rotate)) * TILE_SIZE; diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 6777259e77..a3bb6eeb0b 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -488,7 +488,7 @@ public class RoutingHelper { public String formatStreetName(String name, String ref) { if(name != null && name.length() > 0){ if(ref != null && ref.length() > 0) { - name += "(" + ref +")"; + name = ref + " " + name; } return name; } else { diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 32fd5e72d3..3d9a3d36f3 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -303,11 +303,11 @@ public class MapControlsLayer extends OsmandMapLayer { @Override public void onClick(View v) { if (view.isZooming()) { - activity.changeZoom(view.getZoom() + 2 ); -// activity.changeZoom(view.getFloatZoom() + 2 * OsmandMapTileView.ZOOM_DELTA_1 ); +// activity.changeZoom(view.getZoom() + 2 ); + activity.changeZoom(view.getFloatZoom() + 2 * OsmandMapTileView.ZOOM_DELTA_1 ); } else { - activity.changeZoom(view.getZoom() + 1 ); -// activity.changeZoom(view.getFloatZoom() + 1 * OsmandMapTileView.ZOOM_DELTA_1 ); +// activity.changeZoom(view.getZoom() + 1 ); + activity.changeZoom(view.getFloatZoom() + 1 * OsmandMapTileView.ZOOM_DELTA_1 ); } } @@ -316,8 +316,8 @@ public class MapControlsLayer extends OsmandMapLayer { zoomOutButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - activity.changeZoom(view.getZoom() - 1 ); -// activity.changeZoom(view.getFloatZoom() - 1 * OsmandMapTileView.ZOOM_DELTA_1 ); +// activity.changeZoom(view.getZoom() - 1 ); + activity.changeZoom(view.getFloatZoom() - 1 * OsmandMapTileView.ZOOM_DELTA_1 ); } }); } diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java index 69fb8270d9..a4825ca578 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java @@ -617,7 +617,7 @@ public class MapInfoLayer extends OsmandMapLayer { if (!text.equals(getText().toString())) { TextPaint pp = new TextPaint(getPaint()); if (!text.equals("")) { - pp.setTextSize(25 * scaleCoefficient); + pp.setTextSize(20 * scaleCoefficient); float ts = pp.measureText(text); int wth = getWidth(); while (ts > wth && pp.getTextSize() > (14 * scaleCoefficient)) { diff --git a/OsmAnd/src/net/osmand/plus/views/NextTurnInfoControl.java b/OsmAnd/src/net/osmand/plus/views/NextTurnInfoControl.java index 09fc889684..c682a6aa33 100644 --- a/OsmAnd/src/net/osmand/plus/views/NextTurnInfoControl.java +++ b/OsmAnd/src/net/osmand/plus/views/NextTurnInfoControl.java @@ -103,7 +103,7 @@ public class NextTurnInfoControl extends MapInfoControl { canvas.translate(0, 3 * scaleCoefficient); canvas.drawPath(pathForTurn, paintRouteDirection); canvas.drawPath(pathForTurn, paintBlack); - if (exitOut != null && !horisontalMini) { + if (exitOut != null && !horisontalMini && !makeUturnWhenPossible) { drawShadowText(canvas, exitOut, width / 2 - 7 * scaleCoefficient, height / 2 + textPaint.getTextSize() / 2 - 3 * scaleCoefficient, textPaint); } From c4dd01cff77156da49bfe496f638c050baf0c9f6 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 13 Aug 2012 01:30:56 +0200 Subject: [PATCH 13/14] Remove test UI --- .../src/net/osmand/plus/views/MapControlsLayer.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 3d9a3d36f3..32fd5e72d3 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -303,11 +303,11 @@ public class MapControlsLayer extends OsmandMapLayer { @Override public void onClick(View v) { if (view.isZooming()) { -// activity.changeZoom(view.getZoom() + 2 ); - activity.changeZoom(view.getFloatZoom() + 2 * OsmandMapTileView.ZOOM_DELTA_1 ); + activity.changeZoom(view.getZoom() + 2 ); +// activity.changeZoom(view.getFloatZoom() + 2 * OsmandMapTileView.ZOOM_DELTA_1 ); } else { -// activity.changeZoom(view.getZoom() + 1 ); - activity.changeZoom(view.getFloatZoom() + 1 * OsmandMapTileView.ZOOM_DELTA_1 ); + activity.changeZoom(view.getZoom() + 1 ); +// activity.changeZoom(view.getFloatZoom() + 1 * OsmandMapTileView.ZOOM_DELTA_1 ); } } @@ -316,8 +316,8 @@ public class MapControlsLayer extends OsmandMapLayer { zoomOutButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { -// activity.changeZoom(view.getZoom() - 1 ); - activity.changeZoom(view.getFloatZoom() - 1 * OsmandMapTileView.ZOOM_DELTA_1 ); + activity.changeZoom(view.getZoom() - 1 ); +// activity.changeZoom(view.getFloatZoom() - 1 * OsmandMapTileView.ZOOM_DELTA_1 ); } }); } From 0513a681a7a3f9f735892fac931d48d5ae74555f Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 13 Aug 2012 01:46:26 +0200 Subject: [PATCH 14/14] Double check mute and check location accuracy if available --- .../osmand/plus/routing/RoutingHelper.java | 34 +++++++++++-------- .../net/osmand/plus/routing/VoiceRouter.java | 25 +++++++------- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index a3bb6eeb0b..26eec93beb 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -175,15 +175,18 @@ public class RoutingHelper { makeUturnWhenPossible = false; return locationProjection; } - boolean calculateRoute = false; synchronized (this) { // 0. Route empty or needs to be extended? Then re-calculate route. if(route.isEmpty()) { calculateRoute = true; } else { + float posTolerance = POSITION_TOLERANCE; + if(currentLocation.hasAccuracy()) { + posTolerance = POSITION_TOLERANCE / 3 + currentLocation.getAccuracy(); + } // 1. Update current route position status according to latest received location - boolean finished = updateCurrentRouteStatus(currentLocation); + boolean finished = updateCurrentRouteStatus(currentLocation, posTolerance); if (finished) { return null; } @@ -191,10 +194,10 @@ public class RoutingHelper { int currentRoute = route.currentRoute; // 2. Analyze if we need to recalculate route - // >120m off current route (sideways) + // >100m off current route (sideways) if (currentRoute > 0) { double dist = getOrthogonalDistance(currentLocation, routeNodes.get(currentRoute - 1), routeNodes.get(currentRoute)); - if (dist > 2 * POSITION_TOLERANCE) { + if (dist > 1.7 * posTolerance) { log.info("Recalculate route, because correlation : " + dist); //$NON-NLS-1$ calculateRoute = true; } @@ -202,21 +205,24 @@ public class RoutingHelper { // 3. Identify wrong movement direction (very similar to 2?) Location next = route.getNextRouteLocation(); boolean wrongMovementDirection = checkWrongMovementDirection(currentLocation, next); - if (wrongMovementDirection && currentLocation.distanceTo(routeNodes.get(currentRoute)) > 2 * POSITION_TOLERANCE) { + if (wrongMovementDirection && currentLocation.distanceTo(routeNodes.get(currentRoute)) > posTolerance) { log.info("Recalculate route, because wrong movement direction: " + currentLocation.distanceTo(routeNodes.get(currentRoute))); //$NON-NLS-1$ calculateRoute = true; } // 4. Identify if UTurn is needed - boolean uTurnIsNeeded = identifyUTurnIsNeeded(currentLocation); + boolean uTurnIsNeeded = identifyUTurnIsNeeded(currentLocation, posTolerance); // 5. Update Voice router - if (calculateRoute == false || uTurnIsNeeded == true) { - voiceRouter.updateStatus(currentLocation, uTurnIsNeeded); + boolean inRecalc = calculateRoute || isRouteBeingCalculated(); + if (!inRecalc && !uTurnIsNeeded) { + voiceRouter.updateStatus(currentLocation); + } else if (uTurnIsNeeded) { + voiceRouter.makeUTStatus(); } // calculate projection of current location if (currentRoute > 0) { double dist = getOrthogonalDistance(currentLocation, routeNodes.get(currentRoute - 1), routeNodes.get(currentRoute)); - double projectDist = mode == ApplicationMode.CAR ? POSITION_TOLERANCE : POSITION_TOLERANCE / 2; + double projectDist = mode == ApplicationMode.CAR ? posTolerance : posTolerance / 2; locationProjection = new Location(locationProjection); if (dist < projectDist) { Location nextLocation = routeNodes.get(currentRoute); @@ -270,7 +276,7 @@ public class RoutingHelper { return index; } - private boolean updateCurrentRouteStatus(Location currentLocation) { + private boolean updateCurrentRouteStatus(Location currentLocation, float posTolerance) { List routeNodes = route.getImmutableLocations(); int currentRoute = route.currentRoute; // 1. Try to proceed to next point using orthogonal distance (finding minimum orthogonal dist) @@ -296,7 +302,7 @@ public class RoutingHelper { } } else if (newDist < dist || newDist < 10) { // newDist < 10 (avoid distance 0 till next turn) - if (dist > POSITION_TOLERANCE) { + if (dist > posTolerance) { processed = true; if (log.isDebugEnabled()) { log.debug("Processed by distance : " + newDist + " " + dist); //$NON-NLS-1$//$NON-NLS-2$ @@ -331,7 +337,7 @@ public class RoutingHelper { // 2. check if destination found Location lastPoint = routeNodes.get(routeNodes.size() - 1); - if (currentRoute > routeNodes.size() - 3 && currentLocation.distanceTo(lastPoint) < POSITION_TOLERANCE) { + if (currentRoute > routeNodes.size() - 3 && currentLocation.distanceTo(lastPoint) < posTolerance * 1.5) { showMessage(context.getString(R.string.arrived_at_destination)); voiceRouter.arrivedDestinationPoint(); clearCurrentRoute(null); @@ -341,7 +347,7 @@ public class RoutingHelper { } - public boolean identifyUTurnIsNeeded(Location currentLocation) { + public boolean identifyUTurnIsNeeded(Location currentLocation, float posTolerance) { if (finalLocation == null || currentLocation == null || !route.isCalculated()) { this.makeUturnWhenPossible = false; return makeUturnWhenPossible; @@ -357,7 +363,7 @@ public class RoutingHelper { if (Math.abs(diff) > 135f) { float d = currentLocation.distanceTo(nextRoutePosition); // 60m tolerance to allow for GPS inaccuracy - if (d > POSITION_TOLERANCE) { + if (d > posTolerance) { if (makeUTwpDetected == 0) { makeUTwpDetected = System.currentTimeMillis(); // require 5 sec since first detection, to avoid false positive announcements diff --git a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java index cff18168a8..b8821761c9 100644 --- a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java +++ b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java @@ -160,11 +160,22 @@ public class VoiceRouter { return currentStatus <= statusToCheck; } + protected void makeUTStatus() { + // Mechanism via STATUS_UTWP_TOLD: Until turn in the right direction, or route is re-calculated in forward direction + if (currentStatus != STATUS_UTWP_TOLD) { + if (playMakeUTwp()) { + currentStatus = STATUS_UTWP_TOLD; + playGoAheadDist = 0; + } + } + + } + /** * Updates status of voice guidance * @param currentLocation */ - protected void updateStatus(Location currentLocation, boolean makeUturnWhenPossible) { + protected void updateStatus(Location currentLocation) { // Directly after turn: goAhead (dist), unless: // < PREPARE_LONG_DISTANCE (3000m): playPrepareTurn // < PREPARE_DISTANCE (1500m): playPrepareTurn @@ -175,17 +186,7 @@ public class VoiceRouter { speed = Math.max(currentLocation.getSpeed(), speed); } - // Mechanism via STATUS_UTWP_TOLD: Until turn in the right direction, or route is re-calculated in forward direction - if (makeUturnWhenPossible == true) { - if (currentStatus != STATUS_UTWP_TOLD) { - if (playMakeUTwp()) { - currentStatus = STATUS_UTWP_TOLD; - playGoAheadDist = 0; - } - } - return; - } - + NextDirectionInfo nextInfo = router.getNextRouteDirectionInfo(new NextDirectionInfo(), true); // after last turn say: if (nextInfo == null || nextInfo.directionInfo.distance == 0) {