diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java index 6285a6f643..c22d460039 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java @@ -181,8 +181,12 @@ public class AppearanceWidgetsFactory { try { Field f = R.drawable.class.getField("widget_" + p.getAttrName().toLowerCase()); icon = f.getInt(null); - //TODO: Use "widget_no_icon" where no widget icon exists } catch(Exception e){ + try { + Field f = R.drawable.class.getField("widget_no_icon"); + icon = f.getInt(null); + } catch(Exception e){ + } } MapWidgetRegistry.MapWidgetRegInfo w = mapInfoControls.registerAppearanceWidget(icon, propertyName, "rend_"+p.getAttrName(), pref, categoryName); w.setStateChangeListener(new Runnable() { @@ -200,8 +204,12 @@ public class AppearanceWidgetsFactory { try { Field f = R.drawable.class.getField("widget_" + p.getAttrName().toLowerCase()); icon = f.getInt(null); - //TODO: Use "widget_no_icon" where no widget icon exists } catch(Exception e){ + try { + Field f = R.drawable.class.getField("widget_no_icon"); + icon = f.getInt(null); + } catch(Exception e){ + } } MapWidgetRegistry.MapWidgetRegInfo w = mapInfoControls.registerAppearanceWidget(icon, propertyName, "rend_"+p.getAttrName(), pref, categoryName); w.setStateChangeListener(new Runnable() {