Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-06-06 17:06:50 +02:00
commit ea63697d80
3 changed files with 80 additions and 72 deletions

View file

@ -113,8 +113,6 @@ public class EditPOIFilterActivity extends OsmandListActivity {
View v = lv.getChildAt(0); View v = lv.getChildAt(0);
final int top = (v == null) ? 0 : v.getTop(); final int top = (v == null) ? 0 : v.getTop();
Builder builder = new AlertDialog.Builder(this); Builder builder = new AlertDialog.Builder(this);
ScrollView scroll = new ScrollView(this);
ListView listView = new ListView(this);
final LinkedHashMap<String, String> subCategories = new LinkedHashMap<String, String>(); final LinkedHashMap<String, String> subCategories = new LinkedHashMap<String, String>();
Set<String> acceptedCategories = filter.getAcceptedSubtypes(poiCategory); Set<String> acceptedCategories = filter.getAcceptedSubtypes(poiCategory);
if (acceptedCategories != null) { if (acceptedCategories != null) {
@ -150,9 +148,6 @@ public class EditPOIFilterActivity extends OsmandListActivity {
selected[i] = acceptedCategories.contains(subcategory); selected[i] = acceptedCategories.contains(subcategory);
} }
} }
scroll.addView(listView);
builder.setView(scroll);
builder.setNeutralButton(EditPOIFilterActivity.this.getText(R.string.shared_string_close), new DialogInterface.OnClickListener() { builder.setNeutralButton(EditPOIFilterActivity.this.getText(R.string.shared_string_close), new DialogInterface.OnClickListener() {
@Override @Override

View file

@ -461,6 +461,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
canvas.restore(); canvas.restore();
} catch (IndexOutOfBoundsException e) { } catch (IndexOutOfBoundsException e) {
// skip it // skip it
canvas.restore();
} }
} }
Bitmap t = bufferBitmap; Bitmap t = bufferBitmap;

View file

@ -124,8 +124,6 @@ public class RouteLayer extends OsmandMapLayer {
paint.setStrokeWidth(12 * view.getDensity()); paint.setStrokeWidth(12 * view.getDensity());
} }
osmandRenderer.updatePaint(req, actionPaint, 2, false, rc); osmandRenderer.updatePaint(req, actionPaint, 2, false, rc);
// TODO remove
// actionPaint.setColor(Color.BLUE);
paintIconAction.setColorFilter(new PorterDuffColorFilter(actionPaint.getColor(), Mode.MULTIPLY)); paintIconAction.setColorFilter(new PorterDuffColorFilter(actionPaint.getColor(), Mode.MULTIPLY));
isPaint2 = osmandRenderer.updatePaint(req, paint2, 1, false, rc); isPaint2 = osmandRenderer.updatePaint(req, paint2, 1, false, rc);
@ -191,6 +189,7 @@ public class RouteLayer extends OsmandMapLayer {
private void drawAction(RotatedTileBox tb, Canvas canvas) { private void drawAction(RotatedTileBox tb, Canvas canvas) {
if (actionPoints.size() > 0) { if (actionPoints.size() > 0) {
canvas.rotate(-tb.getRotate(), tb.getCenterPixelX(), tb.getCenterPixelY()); canvas.rotate(-tb.getRotate(), tb.getCenterPixelX(), tb.getCenterPixelY());
try {
Path pth = new Path(); Path pth = new Path();
Matrix matrix = new Matrix(); Matrix matrix = new Matrix();
boolean first = true; boolean first = true;
@ -219,7 +218,7 @@ public class RouteLayer extends OsmandMapLayer {
py = y; py = y;
x = (int) tb.getPixXFromLatLon(o.getLatitude(), o.getLongitude()); x = (int) tb.getPixXFromLatLon(o.getLatitude(), o.getLongitude());
y = (int) tb.getPixYFromLatLon(o.getLatitude(), o.getLongitude()); y = (int) tb.getPixYFromLatLon(o.getLatitude(), o.getLongitude());
if(first) { if (first) {
pth.reset(); pth.reset();
pth.moveTo(x, y); pth.moveTo(x, y);
first = false; first = false;
@ -229,14 +228,16 @@ public class RouteLayer extends OsmandMapLayer {
} }
} }
} finally {
canvas.rotate(tb.getRotate(), tb.getCenterPixelX(), tb.getCenterPixelY()); canvas.rotate(tb.getRotate(), tb.getCenterPixelX(), tb.getCenterPixelY());
} }
} }
}
private void drawSegment(RotatedTileBox tb, Canvas canvas) { private void drawSegment(RotatedTileBox tb, Canvas canvas) {
if (points.size() > 0) { if (points.size() > 0) {
canvas.rotate(-tb.getRotate(), tb.getCenterPixelX(), tb.getCenterPixelY()); canvas.rotate(-tb.getRotate(), tb.getCenterPixelX(), tb.getCenterPixelY());
try {
TIntArrayList tx = new TIntArrayList(); TIntArrayList tx = new TIntArrayList();
TIntArrayList ty = new TIntArrayList(); TIntArrayList ty = new TIntArrayList();
for (int i = 0; i < points.size(); i++) { for (int i = 0; i < points.size(); i++) {
@ -248,14 +249,14 @@ public class RouteLayer extends OsmandMapLayer {
} }
calculatePath(tb, tx, ty, path); calculatePath(tb, tx, ty, path);
if(isPaint_1) { if (isPaint_1) {
canvas.drawPath(path, paint_1); canvas.drawPath(path, paint_1);
} }
if(isShadowPaint) { if (isShadowPaint) {
canvas.drawPath(path, shadowPaint); canvas.drawPath(path, shadowPaint);
} }
canvas.drawPath(path, paint); canvas.drawPath(path, paint);
if(isPaint2) { if (isPaint2) {
canvas.drawPath(path, paint2); canvas.drawPath(path, paint2);
} }
if (tb.getZoomAnimation() == 0) { if (tb.getZoomAnimation() == 0) {
@ -263,9 +264,11 @@ public class RouteLayer extends OsmandMapLayer {
calculateSplitPaths(tb, tx, ty, lst); calculateSplitPaths(tb, tx, ty, lst);
drawArrowsOverPath(canvas, lst, coloredArrowUp); drawArrowsOverPath(canvas, lst, coloredArrowUp);
} }
} finally {
canvas.rotate(tb.getRotate(), tb.getCenterPixelX(), tb.getCenterPixelY()); canvas.rotate(tb.getRotate(), tb.getCenterPixelX(), tb.getCenterPixelY());
} }
} }
}
private void drawArrowsOverPath(Canvas canvas, TIntArrayList lst, Bitmap arrow) { private void drawArrowsOverPath(Canvas canvas, TIntArrayList lst, Bitmap arrow) {
@ -360,7 +363,15 @@ public class RouteLayer extends OsmandMapLayer {
double rightLongitude, Location lastProjection, List<Location> routeNodes, int cd, double rightLongitude, Location lastProjection, List<Location> routeNodes, int cd,
Iterator<RouteDirectionInfo> it, int zoom) { Iterator<RouteDirectionInfo> it, int zoom) {
RouteDirectionInfo nf = null; RouteDirectionInfo nf = null;
double DISTANCE_ACTION = zoom >= 17 ? 15 : 35;
double DISTANCE_ACTION = 35;
if(zoom >= 17) {
DISTANCE_ACTION = 15;
} else if (zoom == 15) {
DISTANCE_ACTION = 70;
} else if (zoom < 15) {
DISTANCE_ACTION = 110;
}
double actionDist = 0; double actionDist = 0;
Location previousAction = null; Location previousAction = null;
actionPoints.clear(); actionPoints.clear();
@ -421,9 +432,10 @@ public class RouteLayer extends OsmandMapLayer {
break; break;
} else { } else {
if(prevPoint == k) { if(prevPoint == k) {
actionPoints.remove(ind - 1); actionPoints.remove(actionPoints.size() - 1);
actionPoints.remove(ind - 1); actionPoints.remove(actionPoints.size() - 1);
prevPoint = -2; prevPoint = -2;
ind = actionPoints.size();
} }
actionPoints.add(ind, l); actionPoints.add(ind, l);
lp = l; lp = l;