Add profile dependent aidl widgets

This commit is contained in:
Chumva 2019-12-04 18:07:26 +02:00
parent bc6ba2ab35
commit c5311badcd
2 changed files with 4 additions and 0 deletions

View file

@ -225,6 +225,7 @@ public class ConnectedApp implements Comparable<ConnectedApp> {
Intent intent = new Intent();
intent.setAction(AIDL_ADD_MAP_WIDGET);
intent.putExtra(AIDL_OBJECT_ID, widget.getId());
intent.putExtra(AIDL_PACKAGE_NAME, pack);
app.sendBroadcast(intent);
}
app.getAidlApi().reloadMap();
@ -239,6 +240,7 @@ public class ConnectedApp implements Comparable<ConnectedApp> {
Intent intent = new Intent();
intent.setAction(AIDL_REMOVE_MAP_WIDGET);
intent.putExtra(AIDL_OBJECT_ID, widgetId);
intent.putExtra(AIDL_PACKAGE_NAME, pack);
app.sendBroadcast(intent);
return true;
}
@ -278,6 +280,7 @@ public class ConnectedApp implements Comparable<ConnectedApp> {
Intent intent = new Intent();
intent.setAction(AIDL_REMOVE_MAP_LAYER);
intent.putExtra(AIDL_OBJECT_ID, layerId);
intent.putExtra(AIDL_PACKAGE_NAME, pack);
app.sendBroadcast(intent);
return true;
}

View file

@ -325,6 +325,7 @@ public class OsmandAidlApi {
AidlMapWidgetWrapper widget = connectedApp.getWidgets().get(widgetId);
MapInfoLayer layer = mapActivity.getMapLayers().getMapInfoLayer();
if (widget != null && layer != null) {
ApplicationMode.regWidgetVisibility(widget.getId(), (ApplicationMode[]) null);
TextInfoWidget control = connectedApp.createWidgetControl(mapActivity, widgetId);
connectedApp.getWidgetControls().put(widgetId, control);
int menuIconId = AndroidUtils.getDrawableId(app, widget.getMenuIconName());