From 92560f268b32a552ee65d600c0b2597bcad3aa78 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 12 Jul 2014 01:08:20 +0200 Subject: [PATCH 1/2] Update settins --- OsmAnd/.gitignore | 3 ++- OsmAnd/build.xml | 6 ++++++ OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java | 2 +- .../plus/views/mapwidgets/AppearanceWidgetsFactory.java | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/OsmAnd/.gitignore b/OsmAnd/.gitignore index 42519e7a3f..3145ef927f 100644 --- a/OsmAnd/.gitignore +++ b/OsmAnd/.gitignore @@ -11,4 +11,5 @@ jni/Local.mk out/ use/ osmand.properties -osmand.xml \ No newline at end of file +osmand.xml +src/help diff --git a/OsmAnd/build.xml b/OsmAnd/build.xml index a73d7b4a7f..fb50412c73 100644 --- a/OsmAnd/build.xml +++ b/OsmAnd/build.xml @@ -34,6 +34,12 @@ + + + + + + diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java index fca1934fef..17e3f1fdbb 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java @@ -170,7 +170,7 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer MapInfoLayer layer = activity.getMapLayers().getMapInfoLayer(); osmoControl = createOsMoControl(activity, layer.getPaintText(), layer.getPaintSubText()); layer.getMapInfoControls().registerSideWidget(osmoControl, - R.drawable.mon_osmo_conn_big, R.string.osmo_control, "osmo_control", false, 18); + R.drawable.mon_osmo_signal_inactive, R.string.osmo_control, "osmo_control", false, 18); layer.recreateControls(); if(olayer != null) { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java index 8bc196a029..171fab3729 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java @@ -107,7 +107,7 @@ public class AppearanceWidgetsFactory { visibleNames[j] = Algorithms.capitalizeFirstLetterAndLowercase(items[j].replace('_', ' ').replace( '-', ' ')); } - bld.setSingleChoiceItems(items, selected, new DialogInterface.OnClickListener() { + bld.setSingleChoiceItems(visibleNames, selected, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { From d33cc4450756a983e655e55085052fa17a936492 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 12 Jul 2014 01:51:56 +0200 Subject: [PATCH 2/2] Fix rotation for osmo --- .../osmand/plus/osmo/OsMoPositionLayer.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoPositionLayer.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoPositionLayer.java index a20c990a47..77cc637c50 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoPositionLayer.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoPositionLayer.java @@ -117,22 +117,22 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye } @Override - public void onDraw(Canvas canvas, RotatedTileBox tb, DrawSettings nightMode) { - final int r = getRadiusPoi(tb); + public void onDraw(Canvas canvas, RotatedTileBox tileBox, DrawSettings nightMode) { + final int r = getRadiusPoi(tileBox); long treshold = System.currentTimeMillis() - 15000; for (OsMoDevice t : getTrackingDevices()) { Location l = t.getLastLocation(); ConcurrentLinkedQueue plocations = t.getPreviousLocations(treshold); if (!plocations.isEmpty() && l != null) { - int x = (int) tb.getPixXFromLatLon(l.getLatitude(), l.getLongitude()); - int y = (int) tb.getPixYFromLatLon(l.getLatitude(), l.getLongitude()); + int x = (int) tileBox.getPixXFromLonNoRot(l.getLongitude()); + int y = (int) tileBox.getPixYFromLatNoRot(l.getLatitude()); pth.rewind(); Iterator it = plocations.iterator(); boolean f = true; while (it.hasNext()) { Location lo = it.next(); - int xt = (int) tb.getPixXFromLatLon(lo.getLatitude(), lo.getLongitude()); - int yt = (int) tb.getPixYFromLatLon(lo.getLatitude(), lo.getLongitude()); + int xt = (int) tileBox.getPixXFromLonNoRot(lo.getLongitude()); + int yt = (int) tileBox.getPixYFromLatNoRot(lo.getLatitude()); if (f) { f = false; pth.moveTo(xt, yt); @@ -145,14 +145,15 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye canvas.drawPath(pth, paintPath); } } + canvas.rotate(-tileBox.getRotate(), tileBox.getCenterPixelX(), tileBox.getCenterPixelY()); for (OsMoDevice t : getTrackingDevices()) { Location l = t.getLastLocation(); if (l != null) { - int x = (int) tb.getPixXFromLatLon(l.getLatitude(), l.getLongitude()); - int y = (int) tb.getPixYFromLatLon(l.getLatitude(), l.getLongitude()); + int x = (int) tileBox.getPixXFromLatLon(l.getLatitude(), l.getLongitude()); + int y = (int) tileBox.getPixYFromLatLon(l.getLatitude(), l.getLongitude()); pointInnerCircle.setColor(t.getColor()); - canvas.drawCircle(x, y, r + (float)Math.ceil(tb.getDensity()), pointOuter); - canvas.drawCircle(x, y, r - (float)Math.ceil(tb.getDensity()), pointInnerCircle); + canvas.drawCircle(x, y, r + (float)Math.ceil(tileBox.getDensity()), pointOuter); + canvas.drawCircle(x, y, r - (float)Math.ceil(tileBox.getDensity()), pointInnerCircle); paintTextIcon.setTextSize(r * 3 / 2); canvas.drawText(t.getVisibleName().substring(0, 1).toUpperCase(), x, y + r / 2, paintTextIcon); }