Fix small issues

This commit is contained in:
Victor Shcherb 2014-06-01 15:54:46 +02:00
parent 52c87b323d
commit c944bff72c
3 changed files with 10 additions and 8 deletions

View file

@ -99,7 +99,7 @@ public class OsMoControlDevice implements OsMoReactor {
}
}
return true;
} else if(command.equals("GPX_GET")) {
} else if(command.equals("TP")) {
plugin.getDownloadGpxTask(true).execute(obj);
}
return false;

View file

@ -79,8 +79,8 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye
final float zoom = tb.getZoom() + tb.getZoomScale();
if(zoom < startZoom){
r = 0;
} else if(zoom <= 15){
r = 10;
} else if(zoom <= 14){
r = 12;
} else if(zoom <= 16){
r = 14;
} else if(zoom <= 17){
@ -93,7 +93,7 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye
@Override
public void onDraw(Canvas canvas, RotatedTileBox tb, DrawSettings nightMode) {
final int r = getRadiusPoi(tb) * 3 / 4;
final int r = getRadiusPoi(tb);
for (OsMoDevice t : getTrackingDevices()) {
Location l = t.getLastLocation();
if (l != null) {
@ -101,7 +101,7 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye
int y = (int) tb.getPixYFromLatLon(l.getLatitude(), l.getLongitude());
pointAltUI.setColor(t.getColor());
canvas.drawCircle(x, y, r , point);
canvas.drawCircle(x, y, r + 2, point);
canvas.drawCircle(x, y, r - 2, pointAltUI);
}
}
@ -152,9 +152,11 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye
if (o instanceof OsMoDevice) {
String d = map.getString(R.string.osmo_user_name) + " " + ((OsMoDevice) o).getVisibleName();
final Location l = ((OsMoDevice) o).getLastLocation();
float speed = 0;
if(l != null && l.hasSpeed()) {
d += "\n"+ OsmAndFormatter.getFormattedSpeed(l.getSpeed(), map.getMyApplication());
speed = l.getSpeed();
}
d += "\n"+ OsmAndFormatter.getFormattedSpeed(speed, map.getMyApplication());
return d;
}
return null;

View file

@ -273,7 +273,7 @@ public class OsMoService implements OsMoReactor {
si.motd = data;
}
return true;
} else if(command.equals("GET_MY_TRACKS")) {
} else if(command.equals("TRACK_GET")) {
try {
JSONArray ar = new JSONArray(data);
AsyncTask<JSONObject, GPXFile, String> task = plugin.getDownloadGpxTask(false);
@ -293,7 +293,7 @@ public class OsMoService implements OsMoReactor {
@Override
public void reconnect() {
pushCommand("GET_MY_TRACKS");
pushCommand("TRACK_GET");
}
public void reconnectToServer() {