diff --git a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java index 4c168306d1..9e891944db 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java +++ b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java @@ -24,7 +24,6 @@ import net.osmand.plus.monitoring.OsmandMonitoringPlugin; import net.osmand.plus.myplaces.FavoritesActivity; import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin; import net.osmand.plus.osmedit.OsmEditingPlugin; -import net.osmand.plus.osmo.OsMoPlugin; import net.osmand.plus.parkingpoint.ParkingPositionPlugin; import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin; import net.osmand.plus.skimapsplugin.SkiMapsPlugin; @@ -56,10 +55,6 @@ public abstract class OsmandPlugin { public abstract int getAssetResourceName(); - public boolean isStationary() { - return false; - } - @DrawableRes public int getLogoResourceId() { return R.drawable.ic_extension_dark; @@ -83,7 +78,7 @@ public abstract class OsmandPlugin { } public boolean isActive() { - return active || isStationary(); + return active; } public boolean needsInstallation() { @@ -284,16 +279,6 @@ public abstract class OsmandPlugin { return allPlugins; } - public static List getAdjustablePlugins() { - List res = new ArrayList<>(); - for (OsmandPlugin plugin : allPlugins) { - if (!plugin.isStationary()) { - res.add(plugin); - } - } - return res; - } - public static List getEnabledPlugins() { ArrayList lst = new ArrayList(allPlugins.size()); for (OsmandPlugin p : allPlugins) { diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index e92522cefb..ff0a1c971b 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -30,6 +30,7 @@ import net.osmand.plus.api.SettingsAPI; import net.osmand.plus.api.SettingsAPI.SettingsEditor; import net.osmand.plus.dialogs.RateUsBottomSheetDialog; import net.osmand.plus.helpers.SearchHistoryHelper; +import net.osmand.plus.mapillary.MapillaryPlugin; import net.osmand.plus.render.RendererRegistry; import net.osmand.plus.routing.RouteProvider.RouteService; import net.osmand.render.RenderingRulesStorage; @@ -604,7 +605,7 @@ public class OsmandSettings { ///////////// PREFERENCES classes //////////////// // this value string is synchronized with settings_pref.xml preference name - private final OsmandPreference PLUGINS = new StringPreference("enabled_plugins", "").makeGlobal(); + private final OsmandPreference PLUGINS = new StringPreference("enabled_plugins", MapillaryPlugin.ID).makeGlobal(); public Set getEnabledPlugins() { String plugs = PLUGINS.get(); diff --git a/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java b/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java index 02a7e0233e..5aee676aa4 100644 --- a/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java @@ -76,7 +76,7 @@ public class PluginsActivity extends OsmandListActivity { protected class PluginsListAdapter extends ArrayAdapter { public PluginsListAdapter() { super(PluginsActivity.this, R.layout.plugins_list_item, - OsmandPlugin.getAdjustablePlugins()); + OsmandPlugin.getAvailablePlugins()); } @Override diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MApillaryLayer.java b/OsmAnd/src/net/osmand/plus/mapillary/MApillaryLayer.java index e425b58ba1..84aa8ed2a3 100644 --- a/OsmAnd/src/net/osmand/plus/mapillary/MApillaryLayer.java +++ b/OsmAnd/src/net/osmand/plus/mapillary/MApillaryLayer.java @@ -1,8 +1,21 @@ package net.osmand.plus.mapillary; -/** - * Created by admin on 27/04/2017. - */ +import android.graphics.Canvas; -public class MApillaryLayer { +import net.osmand.data.RotatedTileBox; +import net.osmand.plus.views.MapTileLayer; +import net.osmand.plus.views.OsmandMapLayer; +import net.osmand.plus.views.OsmandMapTileView; + +public class MapillaryLayer extends MapTileLayer { + + public MapillaryLayer() { + super(false); + } + + @Override + public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings drawSettings) { + super.onPrepareBufferImage(canvas, tileBox, drawSettings); + // todo add + } } diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java index 4fba902081..d48c231afa 100644 --- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java +++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java @@ -22,7 +22,7 @@ public class MapillaryPlugin extends OsmandPlugin { private OsmandSettings settings; private OsmandApplication app; - private MapTileLayer rasterLayer; + private MapillaryLayer rasterLayer; public MapillaryPlugin(OsmandApplication app) { this.app = app; @@ -54,18 +54,13 @@ public class MapillaryPlugin extends OsmandPlugin { return app.getString(R.string.mapillary); } - @Override - public boolean isStationary() { - return true; - } - @Override public void registerLayers(MapActivity activity) { createLayers(); } private void createLayers() { - rasterLayer = new MapTileLayer(false); + rasterLayer = new MapillaryLayer(); } @Override