Update icons

This commit is contained in:
Victor Shcherb 2013-07-15 01:17:14 +02:00
parent 303638b2aa
commit b62372a666
47 changed files with 23 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -51,7 +51,7 @@ public class NameFinderPoiFilter extends PoiFilter {
public void setQuery(String query) {
this.query = query;
}
@Override
protected List<Amenity> searchAmenities(double lat, double lon, double topLatitude,
double bottomLatitude, double leftLongitude, double rightLongitude, ResultMatcher<Amenity> matcher) {

View file

@ -301,9 +301,10 @@ public class PoiFilter {
public String getSimplifiedId(){
if(filterId.startsWith(STD_PREFIX)) {
return filterId.substring(STD_PREFIX.length()).toLowerCase();
} else {
} else if(filterId.startsWith(USER_PREFIX)) {
return filterId.substring(USER_PREFIX.length()).toLowerCase();
}
return filterId;
}

View file

@ -292,7 +292,7 @@ public class OsmandRenderer {
int[] alreadyDrawnIcons = new int[iconsW * iconsH / 32];
for (IconDrawInfo icon : rc.iconsToDraw) {
if (icon.resId != null) {
Bitmap ico = RenderingIcons.getIcon(context, icon.resId);
Bitmap ico = RenderingIcons.getSmallPoiIcon(context, icon.resId);
if (ico != null) {
if (icon.y >= 0 && icon.y < rc.height && icon.x >= 0 && icon.x < rc.width) {
int z = (((int) icon.x / skewConstant) + ((int) icon.y / skewConstant) * iconsW);

View file

@ -23,6 +23,7 @@ public class RenderingIcons {
private static final Log log = PlatformUtil.getLog(RenderingIcons.class);
private static Map<String, Integer> icons = new LinkedHashMap<String, Integer>();
private static Map<String, Integer> smallIcons = new LinkedHashMap<String, Integer>();
private static Map<String, Integer> bigIcons = new LinkedHashMap<String, Integer>();
private static Map<String, Bitmap> iconsBmp = new LinkedHashMap<String, Bitmap>();
private static DisplayMetrics dm;
@ -82,6 +83,14 @@ public class RenderingIcons {
return null;
}
public static Bitmap getSmallPoiIcon(Context ctx, String s) {
Integer resId = smallIcons.get(s);
if (resId != null) {
return BitmapFactory.decodeResource(ctx.getResources(), resId, null);
}
return null;
}
public static Bitmap getIcon(Context ctx, String s) {
if (!iconsBmp.containsKey(s)) {
Integer resId = icons.get(s);
@ -115,7 +124,15 @@ public class RenderingIcons {
for (Field f : cl.getDeclaredFields()) {
if (f.getName().startsWith("h_") || f.getName().startsWith("mm_")) {
try {
icons.put(f.getName().substring(f.getName().startsWith("mm_")? 3 : 2), f.getInt(null));
String id = f.getName().substring(f.getName().startsWith("mm_") ? 3 : 2);
int i = f.getInt(null);
// don't override shader or map icons (h)
if(f.getName().startsWith("h_") || !icons.containsKey(id)) {
icons.put(id, i);
}
if(f.getName().startsWith("mm_")) {
smallIcons.put(id, i);
}
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {

View file

@ -191,7 +191,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
id = tag.toString();
}
if(id != null){
Bitmap bmp = RenderingIcons.getIcon(view.getContext(), id);
Bitmap bmp = RenderingIcons.getSmallPoiIcon(view.getContext(), id);
if(bmp != null){
canvas.drawBitmap(bmp, x - bmp.getWidth() / 2, y - bmp.getHeight() / 2, paintIcon);
}