protected boolean setValue(SharedPreferences prefs, String val) { if (val == null) { val = RendererRegistry.DEFAULT_RENDER; } BaseOsmandRender loaded = ctx.getRendererRegistry().getRenderer(val); if (loaded != null) { ctx.getRendererRegistry().setCurrentSelectedRender(loaded); super.setValue(prefs, val); ctx.getResourceManager().getRenderer().clearCache(); return true; } return false; };
protected void switchApplicationMode(ApplicationMode oldMode) { // change some global settings/ for car if (currentMode == ApplicationMode.CAR) { SHOW_TRANSPORT_OVER_MAP.set(false); SHOW_OSM_BUGS.set(false); } // update vector renderer RendererRegistry registry = ctx.getRendererRegistry(); BaseOsmandRender newRenderer = registry.getRenderer(RENDERER.get()); if (newRenderer == null) { newRenderer = registry.defaultRender(); } if (registry.getCurrentSelectedRenderer() != newRenderer) { registry.setCurrentSelectedRender(newRenderer); ctx.getResourceManager().getRenderer().clearCache(); } }