diff --git a/OsmAnd/assets/webp/audio_video_notes.webp b/OsmAnd/res/drawable-xhdpi/audio_video_notes.webp
similarity index 100%
rename from OsmAnd/assets/webp/audio_video_notes.webp
rename to OsmAnd/res/drawable-xhdpi/audio_video_notes.webp
diff --git a/OsmAnd/assets/webp/contour_lines.webp b/OsmAnd/res/drawable-xhdpi/contour_lines.webp
similarity index 100%
rename from OsmAnd/assets/webp/contour_lines.webp
rename to OsmAnd/res/drawable-xhdpi/contour_lines.webp
diff --git a/OsmAnd/assets/webp/distance_calculator.webp b/OsmAnd/res/drawable-xhdpi/distance_calculator.webp
similarity index 100%
rename from OsmAnd/assets/webp/distance_calculator.webp
rename to OsmAnd/res/drawable-xhdpi/distance_calculator.webp
diff --git a/OsmAnd/assets/webp/nautical_map.webp b/OsmAnd/res/drawable-xhdpi/nautical_map.webp
similarity index 100%
rename from OsmAnd/assets/webp/nautical_map.webp
rename to OsmAnd/res/drawable-xhdpi/nautical_map.webp
diff --git a/OsmAnd/assets/webp/online_maps.webp b/OsmAnd/res/drawable-xhdpi/online_maps.webp
similarity index 100%
rename from OsmAnd/assets/webp/online_maps.webp
rename to OsmAnd/res/drawable-xhdpi/online_maps.webp
diff --git a/OsmAnd/assets/webp/osm_editing.webp b/OsmAnd/res/drawable-xhdpi/osm_editing.webp
similarity index 100%
rename from OsmAnd/assets/webp/osm_editing.webp
rename to OsmAnd/res/drawable-xhdpi/osm_editing.webp
diff --git a/OsmAnd/assets/webp/osmand_development.webp b/OsmAnd/res/drawable-xhdpi/osmand_development.webp
similarity index 100%
rename from OsmAnd/assets/webp/osmand_development.webp
rename to OsmAnd/res/drawable-xhdpi/osmand_development.webp
diff --git a/OsmAnd/assets/webp/osmo_monitoring.webp b/OsmAnd/res/drawable-xhdpi/osmo_monitoring.webp
similarity index 100%
rename from OsmAnd/assets/webp/osmo_monitoring.webp
rename to OsmAnd/res/drawable-xhdpi/osmo_monitoring.webp
diff --git a/OsmAnd/assets/webp/parking_position.webp b/OsmAnd/res/drawable-xhdpi/parking_position.webp
similarity index 100%
rename from OsmAnd/assets/webp/parking_position.webp
rename to OsmAnd/res/drawable-xhdpi/parking_position.webp
diff --git a/OsmAnd/assets/webp/ski_map.webp b/OsmAnd/res/drawable-xhdpi/ski_map.webp
similarity index 100%
rename from OsmAnd/assets/webp/ski_map.webp
rename to OsmAnd/res/drawable-xhdpi/ski_map.webp
diff --git a/OsmAnd/assets/webp/touring_map_view.webp b/OsmAnd/res/drawable-xhdpi/touring_map_view.webp
similarity index 100%
rename from OsmAnd/assets/webp/touring_map_view.webp
rename to OsmAnd/res/drawable-xhdpi/touring_map_view.webp
diff --git a/OsmAnd/assets/webp/trip_recording.webp b/OsmAnd/res/drawable-xhdpi/trip_recording.webp
similarity index 100%
rename from OsmAnd/assets/webp/trip_recording.webp
rename to OsmAnd/res/drawable-xhdpi/trip_recording.webp
diff --git a/OsmAnd/res/layout/plugin.xml b/OsmAnd/res/layout/plugin.xml
index 4325d4f845..0bb14c2a74 100644
--- a/OsmAnd/res/layout/plugin.xml
+++ b/OsmAnd/res/layout/plugin.xml
@@ -13,11 +13,13 @@
tools:context=".activities.PluginActivity">
diff --git a/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java b/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
index 608cedcd7a..cd02bc3a24 100644
--- a/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
+++ b/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
@@ -47,4 +47,14 @@ public class AccessibilityPlugin extends OsmandPlugin {
}
+ @Override
+ public int getAssetResourceName() {
+ return 0;
+ }
+
+ @Override
+ public int getLogoResourceId() {
+ // TODO
+ return super.getLogoResourceId();
+ }
}
diff --git a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
index 2340304cd3..bdf897bdd8 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
@@ -51,6 +51,8 @@ public abstract class OsmandPlugin {
public abstract String getDescription();
public abstract String getName();
+
+ public abstract int getAssetResourceName();
public int getLogoResourceId() {
return R.drawable.ic_extension_dark;
@@ -93,14 +95,14 @@ public abstract class OsmandPlugin {
public static void initPlugins(OsmandApplication app) {
OsmandSettings settings = app.getSettings();
- OsmandRasterMapsPlugin rasterMapsPlugin = new OsmandRasterMapsPlugin(app);
Set enabledPlugins = settings.getEnabledPlugins();
- allPlugins.add(rasterMapsPlugin);
+ allPlugins.add(new OsmandRasterMapsPlugin(app));
allPlugins.add(new OsmandMonitoringPlugin(app));
allPlugins.add(new OsMoPlugin(app));
checkMarketPlugin(app, new SRTMPlugin(app), true, SRTM_PLUGIN_COMPONENT_PAID, SRTM_PLUGIN_COMPONENT);
- checkMarketPlugin(app, new TouringViewPlugin(app), false, TouringViewPlugin.COMPONENT, null);
+ // ? questionable - definitely not market plugin
+// checkMarketPlugin(app, new TouringViewPlugin(app), false, TouringViewPlugin.COMPONENT, null);
checkMarketPlugin(app, new NauticalMapsPlugin(app), false, NauticalMapsPlugin.COMPONENT, null);
checkMarketPlugin(app, new SkiMapsPlugin(app), false, SkiMapsPlugin.COMPONENT, null);
diff --git a/OsmAnd/src/net/osmand/plus/activities/PluginActivity.java b/OsmAnd/src/net/osmand/plus/activities/PluginActivity.java
index 3f58bf5723..e8786813ce 100644
--- a/OsmAnd/src/net/osmand/plus/activities/PluginActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/PluginActivity.java
@@ -1,20 +1,21 @@
package net.osmand.plus.activities;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.OsmandPlugin;
+import net.osmand.plus.R;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
+import android.widget.ImageView;
import android.widget.TextView;
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.OsmandPlugin;
-import net.osmand.plus.R;
-
/**
* Created by Alexey Pelykh on 02.02.2015.
*/
@@ -55,6 +56,10 @@ public class PluginActivity extends OsmandActionBarActivity {
setContentView(R.layout.plugin);
getSupportActionBar().setTitle(plugin.getName());
+ if(plugin.getAssetResourceName() != 0 && Build.VERSION.SDK_INT >= 14) {
+ ImageView img = (ImageView) findViewById(R.id.plugin_image);
+ img.setImageResource(plugin.getAssetResourceName());
+ }
TextView descriptionView = (TextView)findViewById(R.id.plugin_description);
descriptionView.setText(plugin.getDescription());
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
index 1d8094f289..0353ed2794 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
@@ -21,7 +21,6 @@ import net.osmand.PlatformUtil;
import net.osmand.access.AccessibleAlertBuilder;
import net.osmand.access.AccessibleToast;
import net.osmand.data.DataTileManager;
-import net.osmand.data.Street;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
@@ -68,7 +67,6 @@ import android.media.MediaRecorder;
import android.media.SoundPool;
import android.net.Uri;
import android.os.Build;
-import android.os.Environment;
import android.provider.MediaStore;
import android.view.Display;
import android.view.KeyEvent;
@@ -1243,7 +1241,15 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
camera.release();
}
}
-
+ }
+
+ @Override
+ public int getLogoResourceId() {
+ return R.drawable.ic_type_video;
}
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.audio_video_notes;
+ }
}
diff --git a/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java b/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java
index 944095a77e..ef0a0bf67f 100644
--- a/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java
@@ -75,5 +75,16 @@ public class OsmandDevelopmentPlugin extends OsmandPlugin {
public Class extends Activity> getSettingsActivity() {
return SettingsDevelopmentActivity.class;
}
+
+ @Override
+ public int getLogoResourceId() {
+ // TODO
+ return super.getLogoResourceId();
+ }
+
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.osmand_development;
+ }
}
diff --git a/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java b/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java
index 077f54bfe7..3a461b026b 100644
--- a/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java
@@ -653,4 +653,13 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
return null;
}
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.distance_calculator;
+ }
+
+ @Override
+ public int getLogoResourceId() {
+ return R.drawable.ic_action_marker_dark;
+ }
}
diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java
index bc3eeb4151..78ddd96160 100644
--- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java
@@ -10,7 +10,6 @@ import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.NavigationService;
import net.osmand.plus.OsmAndFormatter;
-import net.osmand.plus.OsmAndTaskManager;
import net.osmand.plus.OsmAndTaskManager.OsmAndTaskRunnable;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
@@ -18,7 +17,6 @@ import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.SavingTrackHelper;
-import net.osmand.plus.activities.SettingsActivity;
import net.osmand.plus.views.MapInfoLayer;
import net.osmand.plus.views.MonitoringInfoControl;
import net.osmand.plus.views.MonitoringInfoControl.MonitoringInfoControlServices;
@@ -36,11 +34,7 @@ import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
-import android.preference.Preference;
-import android.preference.Preference.OnPreferenceClickListener;
-import android.preference.PreferenceScreen;
import android.util.DisplayMetrics;
-import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
@@ -48,8 +42,8 @@ import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.LinearLayout;
-import android.widget.SeekBar;
import android.widget.LinearLayout.LayoutParams;
+import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
@@ -73,6 +67,17 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn
public void updateLocation(Location location) {
liveMonitoringHelper.updateLocation(location);
}
+
+ @Override
+ public int getLogoResourceId() {
+ // TODO
+ return super.getLogoResourceId();
+ }
+
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.trip_recording;
+ }
@Override
public boolean init(OsmandApplication app, Activity activity) {
diff --git a/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java b/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java
index 9b77488b28..88cc559223 100644
--- a/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java
@@ -24,6 +24,17 @@ public class NauticalMapsPlugin extends OsmandPlugin {
public NauticalMapsPlugin(OsmandApplication app) {
this.app = app;
}
+
+ @Override
+ public int getLogoResourceId() {
+ // TODO
+ return super.getLogoResourceId();
+ }
+
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.nautical_map;
+ }
@Override
public String getDescription() {
diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java
index 19c09b8819..6f93efbadc 100644
--- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java
@@ -260,4 +260,13 @@ public class OsmEditingPlugin extends OsmandPlugin {
return app.getString(R.string.osm_settings);
}
+ @Override
+ public int getLogoResourceId() {
+ return R.drawable.ic_action_bug_dark;
+ }
+
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.osm_editing;
+ }
}
diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java
index ff2bda157b..ba96fef3ab 100644
--- a/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java
@@ -24,7 +24,6 @@ import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.activities.MapActivity;
-import net.osmand.plus.activities.SettingsActivity;
import net.osmand.plus.download.DownloadFileHelper;
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;
import net.osmand.plus.osmo.OsMoService.SessionInfo;
@@ -46,9 +45,6 @@ import android.content.Intent;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
-import android.preference.Preference;
-import android.preference.Preference.OnPreferenceClickListener;
-import android.preference.PreferenceScreen;
import android.view.View;
import android.widget.ArrayAdapter;
@@ -70,7 +66,11 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer
public OsMoPlugin(final OsmandApplication app) {
this.app = app;
-
+ }
+
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.osmo_monitoring;
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java
index 5c40691490..69a75da27f 100644
--- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java
@@ -514,4 +514,14 @@ public class ParkingPositionPlugin extends OsmandPlugin {
public Class extends Activity> getSettingsActivity() {
return null;
}
+
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.parking_position;
+ }
+
+ @Override
+ public int getLogoResourceId() {
+ return R.drawable.ic_action_parking_dark;
+ }
}
diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java
index 92506eff5e..c8eea4236e 100644
--- a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java
@@ -23,7 +23,6 @@ import net.osmand.plus.Version;
import net.osmand.plus.activities.DownloadTilesDialog;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.MapActivityLayers;
-import net.osmand.plus.activities.SettingsActivity;
import net.osmand.plus.views.MapTileLayer;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.util.Algorithms;
@@ -31,11 +30,7 @@ import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
-import android.content.Intent;
import android.os.AsyncTask;
-import android.preference.Preference;
-import android.preference.Preference.OnPreferenceClickListener;
-import android.preference.PreferenceScreen;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
@@ -63,6 +58,16 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
return true;
}
+ @Override
+ public int getLogoResourceId() {
+ return R.drawable.ic_world_globe_dark;
+ }
+
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.online_maps;
+ }
+
@Override
public String getId() {
return ID;
diff --git a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java
index 9b3d547b67..3da4230985 100644
--- a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsPlugin.java
@@ -66,6 +66,17 @@ public class RoutePointsPlugin extends OsmandPlugin {
public SelectedRouteGpxFile getCurrentRoute() {
return currentRoute;
}
+
+ @Override
+ public int getLogoResourceId() {
+ // TODO
+ return super.getLogoResourceId();
+ }
+
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.trip_recording;
+ }
public void setCurrentRoute(GPXFile gpx) {
if (gpx == null) {
diff --git a/OsmAnd/src/net/osmand/plus/skimapsplugin/SkiMapsPlugin.java b/OsmAnd/src/net/osmand/plus/skimapsplugin/SkiMapsPlugin.java
index 4f4f11696e..886bdcb82c 100644
--- a/OsmAnd/src/net/osmand/plus/skimapsplugin/SkiMapsPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/skimapsplugin/SkiMapsPlugin.java
@@ -26,6 +26,18 @@ public class SkiMapsPlugin extends OsmandPlugin {
public String getName() {
return app.getString(net.osmand.plus.R.string.plugin_ski_name);
}
+
+ @Override
+ public int getLogoResourceId() {
+ // TODO
+ return super.getLogoResourceId();
+ }
+
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.ski_map;
+ }
+
@Override
public boolean init(final OsmandApplication app, final Activity activity) {
if(activity != null) {
diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java
index c0a4970ef5..7f430c0566 100644
--- a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java
@@ -31,6 +31,17 @@ public class SRTMPlugin extends OsmandPlugin {
this.app = app;
}
+ @Override
+ public int getLogoResourceId() {
+ // TODO
+ return super.getLogoResourceId();
+ }
+
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.contour_lines;
+ }
+
@Override
public String getDescription() {
diff --git a/OsmAnd/src/net/osmand/plus/touringview/TouringViewPlugin.java b/OsmAnd/src/net/osmand/plus/touringview/TouringViewPlugin.java
index f0a16e7e83..acda40ad45 100644
--- a/OsmAnd/src/net/osmand/plus/touringview/TouringViewPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/touringview/TouringViewPlugin.java
@@ -21,6 +21,11 @@ public class TouringViewPlugin extends OsmandPlugin {
public String getDescription() {
return app.getString(net.osmand.plus.R.string.plugin_touringview_descr);
}
+
+ @Override
+ public int getAssetResourceName() {
+ return R.drawable.touring_map_view;
+ }
@Override
public String getName() {