From a8d3c9d812d1b127b9c5ac6a883ef1f2a435424f Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 7 Jul 2013 11:43:47 +0200 Subject: [PATCH] update icons --- OsmAnd/res/layout/searchpoi_list.xml | 3 +++ .../plus/activities/MapActivityLayers.java | 2 ++ .../activities/search/SearchPOIActivity.java | 16 ++++++++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/layout/searchpoi_list.xml b/OsmAnd/res/layout/searchpoi_list.xml index 9341bd0d92..8ca65f0569 100644 --- a/OsmAnd/res/layout/searchpoi_list.xml +++ b/OsmAnd/res/layout/searchpoi_list.xml @@ -3,6 +3,9 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> + diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index e7c3280296..af4d7160ec 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -547,6 +547,8 @@ public class MapActivityLayers { Item it = adapter.item(f.getName()); if(RenderingIcons.containsBigIcon(f.getSimplifiedId())) { it.icon(RenderingIcons.getBigIconResourceId(f.getSimplifiedId())); + } else { + it.icon(RenderingIcons.getBigIconResourceId("user_defined")); } it.reg(); userDefined.add(f); diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java index b16d3d77eb..00d35918c3 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java @@ -36,6 +36,7 @@ import net.osmand.plus.activities.EditPOIFilterActivity; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivityActions; import net.osmand.plus.activities.OsmandListActivity; +import net.osmand.plus.render.RenderingIcons; import net.osmand.util.Algorithms; import net.osmand.util.OpeningHoursParser; import net.osmand.util.OpeningHoursParser.OpeningHours; @@ -765,6 +766,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa } float[] mes = null; TextView label = (TextView) row.findViewById(R.id.poi_label); + ImageView direction = (ImageView) row.findViewById(R.id.poi_direction); ImageView icon = (ImageView) row.findViewById(R.id.poi_icon); Amenity amenity = getItem(position); net.osmand.Location loc = location; @@ -794,16 +796,22 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa float a = h != null ? h : 0; draw.setAngle(mes[1] - a + 180); draw.setOpenedColor(opened); - icon.setImageDrawable(draw); + direction.setImageDrawable(draw); } else { if(opened == -1){ - icon.setImageResource(R.drawable.poi); + direction.setImageResource(R.drawable.poi); } else if(opened == 0){ - icon.setImageResource(R.drawable.opened_poi); + direction.setImageResource(R.drawable.opened_poi); } else { - icon.setImageResource(R.drawable.closed_poi); + direction.setImageResource(R.drawable.closed_poi); } } + String i = amenity.getType().getDefaultTag().toLowerCase() + "_" + amenity.getSubType().toLowerCase(); + if(RenderingIcons.containsBigIcon(i)) { + icon.setImageResource(RenderingIcons.getBigIconResourceId(i)); + } else { + icon.setImageDrawable(null); + } String distance = " "; if(mes != null){