use of net.osmand.aidlapi.OsmAndCustomizationConstants.ROUTES_ID in project Osmand by osmandapp.
the class ConfigureMapMenu method createRouteAttributeItems.
private void createRouteAttributeItems(List<RenderingRuleProperty> customRules, ContextMenuAdapter adapter, MapActivity activity, boolean nightMode) {
OsmandApplication app = activity.getMyApplication();
OsmandSettings settings = app.getSettings();
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.rendering_category_routes, activity).setId(ROUTES_ID).setCategory(true).setLayout(R.layout.list_group_title_with_switch).createItem());
for (String attrName : getRoutesDefaultAttrs().keySet()) {
RenderingRuleProperty property = getPropertyForAttr(customRules, attrName);
if (SHOW_CYCLE_ROUTES_ATTR.equals(attrName)) {
adapter.addItem(createCycleRoutesItem(activity, attrName, property, nightMode));
customRules.remove(getPropertyForAttr(customRules, CYCLE_NODE_NETWORK_ROUTES_ATTR));
} else if (HIKING_ROUTES_OSMC_ATTR.equals(attrName)) {
adapter.addItem(createHikingRoutesItem(activity, attrName, property, nightMode));
} else {
String id = ROUTES_ID + attrName;
int drawableId = getIconIdForAttr(attrName);
String name = AndroidUtils.getRenderingStringPropertyName(activity, attrName, property != null ? property.getName() : attrName);
CommonPreference<Boolean> pref = settings.getCustomRenderBooleanProperty(attrName);
ContextMenuItem item = createBooleanRenderingProperty(activity, attrName, name, id, property, drawableId, nightMode, result -> {
if (property == null) {
showRendererSnackbarForAttr(activity, attrName, nightMode, pref);
}
return false;
});
if (item != null) {
adapter.addItem(item);
}
}
customRules.remove(property);
}
ResourceManager manager = app.getResourceManager();
if (OsmandPlugin.isDevelopment() && (!Algorithms.isEmpty(manager.getTravelMapRepositories()) || !Algorithms.isEmpty(manager.getTravelRepositories()))) {
adapter.addItem(createTravelRoutesItem(activity, nightMode));
}
}
Aggregations