From 0ea5e80eea97d7362ab564e43d4e59de9aa46bab Mon Sep 17 00:00:00 2001 From: sonora Date: Fri, 29 Aug 2014 02:07:45 +0200 Subject: [PATCH] justify display of new renderingProperties in menu --- OsmAnd/res/drawable-hdpi/widget_no_icon.png | Bin 0 -> 101 bytes OsmAnd/res/drawable-large/widget_no_icon.png | Bin 0 -> 101 bytes .../mapwidgets/AppearanceWidgetsFactory.java | 4 ++++ 3 files changed, 4 insertions(+) create mode 100644 OsmAnd/res/drawable-hdpi/widget_no_icon.png create mode 100644 OsmAnd/res/drawable-large/widget_no_icon.png diff --git a/OsmAnd/res/drawable-hdpi/widget_no_icon.png b/OsmAnd/res/drawable-hdpi/widget_no_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..63442f897574e283db71cbca3b99d64b873c45e5 GIT binary patch literal 101 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBSc;uILpXq-h9ji|$d~bSaSVxQ reS6T55y(5V;H!Twd;S6-lYya*StNyl(fefl5fIPQ)z4*}Q$iB})>{^G literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-large/widget_no_icon.png b/OsmAnd/res/drawable-large/widget_no_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..63442f897574e283db71cbca3b99d64b873c45e5 GIT binary patch literal 101 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBSc;uILpXq-h9ji|$d~bSaSVxQ reS6T55y(5V;H!Twd;S6-lYya*StNyl(fefl5fIPQ)z4*}Q$iB})>{^G literal 0 HcmV?d00001 diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java index 9a6ea957c1..e879e9cafb 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java @@ -182,6 +182,8 @@ public class AppearanceWidgetsFactory { Field f = R.drawable.class.getField("widget_" + p.getAttrName().toLowerCase()); icon = f.getInt(null); } catch(Exception e){ + Field f = R.drawable.class.getField("widget_no_icon"); + icon = f.getInt(null); } MapWidgetRegistry.MapWidgetRegInfo w = mapInfoControls.registerAppearanceWidget(icon, propertyName, "rend_"+p.getAttrName(), pref, categoryName); w.setStateChangeListener(new Runnable() { @@ -200,6 +202,8 @@ public class AppearanceWidgetsFactory { Field f = R.drawable.class.getField("widget_" + p.getAttrName().toLowerCase()); icon = f.getInt(null); } catch(Exception e){ + Field f = R.drawable.class.getField("widget_no_icon"); + icon = f.getInt(null); } MapWidgetRegistry.MapWidgetRegInfo w = mapInfoControls.registerAppearanceWidget(icon, propertyName, "rend_"+p.getAttrName(), pref, categoryName); w.setStateChangeListener(new Runnable() {