Merge pull request #10758 from osmandapp/plugin_fixes

Fix image cards in plugins
This commit is contained in:
Vitaliy 2021-02-03 16:31:08 +00:00 committed by GitHub
commit f1cff27d62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 1 deletions

View file

@ -101,6 +101,14 @@ public class MapillaryPlugin extends OsmandPlugin {
return app.getString(R.string.mapillary);
}
@Override
public boolean init(@NonNull OsmandApplication app, Activity activity) {
if (activity instanceof MapActivity) {
mapActivity = (MapActivity) activity;
}
return true;
}
@Override
public void registerLayers(MapActivity activity) {
createLayers();

View file

@ -1,5 +1,6 @@
package net.osmand.plus.openplacereviews;
import android.app.Activity;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
@ -45,7 +46,6 @@ public class OpenPlaceReviewsPlugin extends OsmandPlugin {
return ID;
}
@Override
public String getName() {
return app.getString(R.string.open_place_reviews);
@ -171,6 +171,14 @@ public class OpenPlaceReviewsPlugin extends OsmandPlugin {
return arr;
}
@Override
public boolean init(@NonNull OsmandApplication app, Activity activity) {
if (activity instanceof MapActivity) {
mapActivity = (MapActivity) activity;
}
return true;
}
@Override
public void disable(OsmandApplication app) {
if (app.getSettings().OPR_USE_DEV_URL.get()) {

View file

@ -1,5 +1,6 @@
package net.osmand.plus.wikipedia;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.ArrayAdapter;
@ -106,6 +107,14 @@ public class WikipediaPlugin extends OsmandPlugin {
this.mapActivity = null;
}
@Override
public boolean init(@NonNull OsmandApplication app, Activity activity) {
if (activity instanceof MapActivity) {
mapActivity = (MapActivity) activity;
}
return true;
}
@Override
protected void registerLayerContextMenuActions(OsmandMapTileView mapView,
ContextMenuAdapter adapter,