use of net.osmand.plus.views.mapwidgets.MapWidgetRegistry.MapWidgetRegInfo in project Osmand by osmandapp.
the class MapInfoLayer method registerSideWidget.
public void registerSideWidget(TextInfoWidget widget, WidgetState widgetState, String key, boolean left, int priorityOrder) {
MapWidgetRegInfo reg = mapInfoControls.registerSideWidgetInternal(widget, widgetState, key, left, priorityOrder);
updateReg(calculateTextState(), reg);
}
use of net.osmand.plus.views.mapwidgets.MapWidgetRegistry.MapWidgetRegInfo in project Osmand by osmandapp.
the class MapInfoLayer method registerSideWidget.
public MapWidgetRegInfo registerSideWidget(TextInfoWidget widget, int drawableMenu, int messageId, String key, boolean left, int priorityOrder) {
MapWidgetRegInfo reg = mapInfoControls.registerSideWidgetInternal(widget, drawableMenu, messageId, key, left, priorityOrder);
updateReg(calculateTextState(), reg);
return reg;
}
use of net.osmand.plus.views.mapwidgets.MapWidgetRegistry.MapWidgetRegInfo in project Osmand by osmandapp.
the class MapInfoLayer method updateColorShadowsOfText.
public void updateColorShadowsOfText() {
boolean transparent = view.getSettings().TRANSPARENT_MAP_THEME.get();
boolean nightMode = drawSettings != null && drawSettings.isNightMode();
boolean following = routeLayer.getHelper().isFollowingMode();
int calcThemeId = (transparent ? 4 : 0) | (nightMode ? 2 : 0) | (following ? 1 : 0);
if (themeId != calcThemeId) {
themeId = calcThemeId;
TextState ts = calculateTextState();
map.findViewById(R.id.map_center_info).setBackgroundResource(ts.boxFree);
for (MapWidgetRegInfo reg : mapInfoControls.getLeftWidgetSet()) {
updateReg(ts, reg);
}
for (MapWidgetRegInfo reg : mapInfoControls.getRightWidgetSet()) {
updateReg(ts, reg);
}
updateStreetName(nightMode, ts);
updateTopToolbar(nightMode);
lanesControl.updateTextSize(nightMode, ts.textColor, ts.textShadowColor, ts.textBold, ts.textShadowRadius / 2);
rulerControl.updateTextSize(nightMode, ts.textColor, ts.textShadowColor, (int) (2 * view.getDensity()));
this.expand.setBackgroundResource(ts.expand);
rightStack.invalidate();
leftStack.invalidate();
}
}
use of net.osmand.plus.views.mapwidgets.MapWidgetRegistry.MapWidgetRegInfo in project Osmand by osmandapp.
the class OsmandAidlApi method registerAddMapWidgetReceiver.
private void registerAddMapWidgetReceiver(final MapActivity mapActivity) {
addMapWidgetReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String widgetId = intent.getStringExtra(AIDL_OBJECT_ID);
if (widgetId != null) {
AMapWidget widget = widgets.get(widgetId);
if (widget != null) {
MapInfoLayer layer = mapActivity.getMapLayers().getMapInfoLayer();
if (layer != null) {
TextInfoWidget control = createWidgetControl(mapActivity, widgetId);
widgetControls.put(widgetId, control);
int menuIconId = getDrawableId(widget.getMenuIconName());
MapWidgetRegInfo widgetInfo = layer.registerSideWidget(control, menuIconId, widget.getMenuTitle(), "aidl_widget_" + widgetId, false, widget.getOrder());
if (!mapActivity.getMapLayers().getMapWidgetRegistry().isVisible(widgetInfo.key)) {
mapActivity.getMapLayers().getMapWidgetRegistry().setVisibility(widgetInfo, true, false);
}
layer.recreateControls();
}
}
}
}
};
mapActivity.registerReceiver(addMapWidgetReceiver, new IntentFilter(AIDL_ADD_MAP_WIDGET));
}
use of net.osmand.plus.views.mapwidgets.MapWidgetRegistry.MapWidgetRegInfo in project Osmand by osmandapp.
the class OsmandAidlApi method registerWidgetControls.
public void registerWidgetControls(MapActivity mapActivity) {
for (AMapWidget widget : widgets.values()) {
MapInfoLayer layer = mapActivity.getMapLayers().getMapInfoLayer();
if (layer != null) {
TextInfoWidget control = createWidgetControl(mapActivity, widget.getId());
widgetControls.put(widget.getId(), control);
int menuIconId = getDrawableId(widget.getMenuIconName());
MapWidgetRegInfo widgetInfo = layer.registerSideWidget(control, menuIconId, widget.getMenuTitle(), "aidl_widget_" + widget.getId(), false, widget.getOrder());
if (!mapActivity.getMapLayers().getMapWidgetRegistry().isVisible(widgetInfo.key)) {
mapActivity.getMapLayers().getMapWidgetRegistry().setVisibility(widgetInfo, true, false);
}
}
}
}
Aggregations