diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 89de5354fe..f96b692e5a 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -934,6 +934,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A Parking Position Plugin Mark as a parking position Delete a parking marker + Show route points Public Identifiable Trackable diff --git a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java index 754fe79ffa..43fee487d5 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java +++ b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java @@ -22,6 +22,7 @@ import net.osmand.plus.osmo.OsMoPlugin; import net.osmand.plus.osmodroid.OsMoDroidPlugin; import net.osmand.plus.parkingpoint.ParkingPositionPlugin; import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin; +import net.osmand.plus.routesteps.RouteStepsPlugin; import net.osmand.plus.srtmplugin.SRTMPlugin; import net.osmand.plus.views.OsmandMapTileView; import org.apache.commons.logging.Log; @@ -41,10 +42,11 @@ public abstract class OsmandPlugin { private static final String PARKING_PLUGIN_COMPONENT = "net.osmand.parkingPlugin"; //$NON-NLS-1$ private static final String SRTM_PLUGIN_COMPONENT_PAID = "net.osmand.srtmPlugin.paid"; //$NON-NLS-1$ private static final String SRTM_PLUGIN_COMPONENT = "net.osmand.srtmPlugin"; //$NON-NLS-1$ - + private static final String OSMODROID_PLUGIN_COMPONENT = "com.OsMoDroid"; //$NON-NLS-1$ - + private static final String ROUTE_STEPS_PLUGIN_COMPONENT = "net.osmand.routeStepsPlugin"; //$NON-NLS-1$ + public abstract String getId(); public abstract String getDescription(); @@ -82,6 +84,10 @@ public abstract class OsmandPlugin { if(!f && Version.isParkingPluginInlined(app)) { installedPlugins.add(parking); } + + final RouteStepsPlugin routeSteps = new RouteStepsPlugin(app); + installPlugin(ROUTE_STEPS_PLUGIN_COMPONENT, RouteStepsPlugin.ID, app, routeSteps); + installPlugin(OSMODROID_PLUGIN_COMPONENT, OsMoDroidPlugin.ID, app, new OsMoDroidPlugin(app)); installedPlugins.add(new OsmEditingPlugin(app)); installedPlugins.add(new OsmandDevelopmentPlugin(app)); diff --git a/OsmAnd/src/net/osmand/plus/routesteps/RouteStepsLayer.java b/OsmAnd/src/net/osmand/plus/routesteps/RouteStepsLayer.java new file mode 100644 index 0000000000..c35697a71b --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/routesteps/RouteStepsLayer.java @@ -0,0 +1,67 @@ +package net.osmand.plus.routesteps; + +import android.graphics.Canvas; +import android.graphics.PointF; +import net.osmand.data.LatLon; +import net.osmand.data.RotatedTileBox; +import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.views.ContextMenuLayer; +import net.osmand.plus.views.OsmandMapLayer; +import net.osmand.plus.views.OsmandMapTileView; + +import java.util.List; + +/** + * Created by Barsik on 10.06.2014. + */ +public class RouteStepsLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider { + + private final MapActivity map; + private RouteStepsPlugin plugin; + + public RouteStepsLayer(MapActivity map, RouteStepsPlugin plugin){ + this.map = map; + this.plugin = plugin; + } + + + @Override + public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List o) { + + } + + @Override + public LatLon getObjectLocation(Object o) { + return null; + } + + @Override + public String getObjectDescription(Object o) { + return null; + } + + @Override + public String getObjectName(Object o) { + return null; + } + + @Override + public void initLayer(OsmandMapTileView view) { + + } + + @Override + public void onDraw(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) { + + } + + @Override + public void destroyLayer() { + + } + + @Override + public boolean drawInScreenPixels() { + return false; + } +} diff --git a/OsmAnd/src/net/osmand/plus/routesteps/RouteStepsPlugin.java b/OsmAnd/src/net/osmand/plus/routesteps/RouteStepsPlugin.java new file mode 100644 index 0000000000..0e1aebc241 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/routesteps/RouteStepsPlugin.java @@ -0,0 +1,235 @@ +package net.osmand.plus.routesteps; + +import android.app.AlertDialog; +import android.app.Dialog; +import android.content.DialogInterface; +import net.osmand.plus.*; +import net.osmand.plus.activities.MapActivity; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * Created by Barsik on 10.06.2014. + */ +public class RouteStepsPlugin extends OsmandPlugin { + + public static final String ID = "osmand.route.stepsPlugin"; + + private static final String VISITED_KEY = "IsVisited"; + private static final String POINT_KEY = "Point"; + private static final String CURRENT_ROUTE_KEY = "CurrentRoute"; + private int routeKey; + + + private OsmandApplication app; + private GPXUtilities.GPXFile gpx; + private File file; + private GPXUtilities.Route currentRoute; + private GPXUtilities.WptPt currentPoint; + private int currentPointPos; + private RouteStepsLayer routeStepsLayer; + private List pointsList; + private List pointsStatus; + + + + public RouteStepsPlugin(OsmandApplication app){ + this.app = app; + this.file = new File("/storage/emulated/0/osmand/tracks/","504.gpx"); + gpx = GPXUtilities.loadGPXFile(app, file); + loadCurrentRoute(); + pointsList = currentRoute.points; + pointsStatus = new ArrayList(pointsList.size()); + getAllPointsStatus(); + } + + public void setGpxFile(GPXUtilities.GPXFile file){ this.gpx = file;} + + public void saveGPXFile(){ GPXUtilities.writeGpxFile(file,gpx,app); } + + public void setCurrentPoint(GPXUtilities.WptPt point){ + currentPoint = point; + int number = findPointPosition(point); + currentPointPos = number; + } + + public void setCurrentPoint(int number){ + currentPoint = pointsList.get(number); + currentPointPos = number; + } + + @Override + public String getId() { + return ID; + } + + @Override + public String getDescription() { + return "This plugin allows you to view key positions of your route..."; + } + + @Override + public String getName() { + return "Tour Point Plugin"; + } + + @Override + public boolean init(OsmandApplication app) { + return true; + } + + @Override + public void registerLayers(MapActivity activity) { + // remove old if existing after turn + if(routeStepsLayer != null) { + activity.getMapView().removeLayer(routeStepsLayer); + } + routeStepsLayer = new RouteStepsLayer(activity, this); + activity.getMapView().addLayer(routeStepsLayer, 5.5f); + //registerWidget(activity); + } + + public List getPoints() {return currentRoute.points;} + + public boolean getPointStatus(int numberOfPoint){ + Map map = gpx.getExtensionsToRead(); + + String mapKey = routeKey + POINT_KEY + numberOfPoint + VISITED_KEY; + if (map.containsKey(mapKey)){ + String value = map.get(mapKey); + return (value.equals("true")); + } + + return false; + } + + //saves point status value to gpx extention file + public void setPointStatus(int numberOfPoint, boolean status){ + Map map = gpx.getExtensionsToWrite(); + + String mapKey = routeKey + POINT_KEY + numberOfPoint + VISITED_KEY; + if (status){ + map.put(mapKey, "true"); + } else { + map.put(mapKey, "false"); + } + } + + public GPXUtilities.WptPt getNextPoint(){ + if (pointsList.size() > currentPointPos +1){ + return pointsList.get(currentPointPos+1); + } else{ + return null; + } + } + + private void loadCurrentRoute() { + if (gpx.routes.size() < 1){ + return; + } + + Map map = gpx.getExtensionsToRead(); + if (map.containsKey(CURRENT_ROUTE_KEY)){ + String routeName = map.get(CURRENT_ROUTE_KEY); + int i = 0; + for(GPXUtilities.Route route : gpx.routes){ + if (route.name.equals(routeName)){ + currentRoute = route; + routeKey = i; + return; + } + i++; + } + } + + routeKey = 0; + currentRoute = gpx.routes.get(0); + } + + @Override + public void registerMapContextMenuActions(final MapActivity mapActivity, + final double latitude, final double longitude, + ContextMenuAdapter adapter, Object selectedObj) { + + ContextMenuAdapter.OnContextMenuClick addListener = new ContextMenuAdapter.OnContextMenuClick() { + @Override + public void onContextMenuClick(int resId, int pos, + boolean isChecked, DialogInterface dialog) { + if (resId == R.string.context_menu_item_show_route_points) { + showStepsDialog(mapActivity); + } + } + }; + adapter.item(R.string.context_menu_item_show_route_points) + .icons( R.drawable.ic_action_parking_dark, R.drawable.ic_action_parking_light).listen(addListener).reg(); + + } + + private void getAllPointsStatus(){ + for(int i=0; i< pointsList.size(); i++){ + pointsStatus.add(getPointStatus(i)); + } + } + + private void showStepsDialog(MapActivity mapActivity){ + + List pointNames = new ArrayList(); + //this array need to collect user selection during dialogue + final List pointsIntermediateState = new ArrayList(pointsStatus); + for(GPXUtilities.WptPt point : pointsList){ + pointNames.add(point.name); + } + + AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity); + builder.setTitle("All available points"); + builder.setMultiChoiceItems(pointNames.toArray(new String[pointNames.size()]), toPrimitiveArray(pointsIntermediateState), new DialogInterface.OnMultiChoiceClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i, boolean isChecked) { + //saving user choice + pointsIntermediateState.set(i,isChecked); + } + }); + builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + for (int j=0; j< pointsIntermediateState.size(); j++){ + boolean newValue = pointsIntermediateState.get(j); + //if values is the same - there's no need to save data + if (newValue != pointsStatus.get(j)){ + setPointStatus(j,newValue); + } + } + pointsStatus = new ArrayList(pointsIntermediateState); + } + }); + builder.setNegativeButton("Cancel", null); + + builder.show(); + + } + + private boolean[] toPrimitiveArray(final List booleanList) { + final boolean[] primitives = new boolean[booleanList.size()]; + int index = 0; + for (Boolean object : booleanList) { + primitives[index++] = object; + } + return primitives; + } + + + private int findPointPosition(GPXUtilities.WptPt point){ + int i = 0; + for (GPXUtilities.WptPt item : pointsList){ + if (item.equals(point)){ + return i; + } + i++; + } + return -1; + } + +} diff --git a/plugins/Osmand-ParkingPlugin/.gitignore b/plugins/Osmand-ParkingPlugin/.gitignore index 36986d81cf..5978954c17 100644 --- a/plugins/Osmand-ParkingPlugin/.gitignore +++ b/plugins/Osmand-ParkingPlugin/.gitignore @@ -2,3 +2,4 @@ bin gen raw obj +*.iml diff --git a/plugins/Osmand-RouteSteps/.classpath b/plugins/Osmand-RouteSteps/.classpath new file mode 100644 index 0000000000..7bc01d9a9c --- /dev/null +++ b/plugins/Osmand-RouteSteps/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/plugins/Osmand-RouteSteps/.gitignore b/plugins/Osmand-RouteSteps/.gitignore new file mode 100644 index 0000000000..85bd1cacd6 --- /dev/null +++ b/plugins/Osmand-RouteSteps/.gitignore @@ -0,0 +1,5 @@ +bin +gen +raw +obj +*.iml \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/.project b/plugins/Osmand-RouteSteps/.project new file mode 100644 index 0000000000..1c708327e5 --- /dev/null +++ b/plugins/Osmand-RouteSteps/.project @@ -0,0 +1,33 @@ + + + Osmand-ParkingPlugin + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/plugins/Osmand-RouteSteps/AndroidManifest.xml b/plugins/Osmand-RouteSteps/AndroidManifest.xml new file mode 100644 index 0000000000..4937306599 --- /dev/null +++ b/plugins/Osmand-RouteSteps/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/proguard-project.txt b/plugins/Osmand-RouteSteps/proguard-project.txt new file mode 100644 index 0000000000..f2fe1559a2 --- /dev/null +++ b/plugins/Osmand-RouteSteps/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/plugins/Osmand-RouteSteps/project.properties b/plugins/Osmand-RouteSteps/project.properties new file mode 100644 index 0000000000..4ab125693c --- /dev/null +++ b/plugins/Osmand-RouteSteps/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-19 diff --git a/plugins/Osmand-RouteSteps/res/drawable-hdpi/ic_launcher.png b/plugins/Osmand-RouteSteps/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000000..96a442e5b8 Binary files /dev/null and b/plugins/Osmand-RouteSteps/res/drawable-hdpi/ic_launcher.png differ diff --git a/plugins/Osmand-RouteSteps/res/drawable-hdpi/icon.png b/plugins/Osmand-RouteSteps/res/drawable-hdpi/icon.png new file mode 100644 index 0000000000..1426adff51 Binary files /dev/null and b/plugins/Osmand-RouteSteps/res/drawable-hdpi/icon.png differ diff --git a/plugins/Osmand-RouteSteps/res/drawable-ldpi/ic_launcher.png b/plugins/Osmand-RouteSteps/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 0000000000..99238729d8 Binary files /dev/null and b/plugins/Osmand-RouteSteps/res/drawable-ldpi/ic_launcher.png differ diff --git a/plugins/Osmand-RouteSteps/res/drawable-ldpi/icon.png b/plugins/Osmand-RouteSteps/res/drawable-ldpi/icon.png new file mode 100644 index 0000000000..c99e8a25f7 Binary files /dev/null and b/plugins/Osmand-RouteSteps/res/drawable-ldpi/icon.png differ diff --git a/plugins/Osmand-RouteSteps/res/drawable-mdpi/ic_launcher.png b/plugins/Osmand-RouteSteps/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000000..359047dfa4 Binary files /dev/null and b/plugins/Osmand-RouteSteps/res/drawable-mdpi/ic_launcher.png differ diff --git a/plugins/Osmand-RouteSteps/res/drawable-mdpi/icon.png b/plugins/Osmand-RouteSteps/res/drawable-mdpi/icon.png new file mode 100644 index 0000000000..15eeaf60c2 Binary files /dev/null and b/plugins/Osmand-RouteSteps/res/drawable-mdpi/icon.png differ diff --git a/plugins/Osmand-RouteSteps/res/drawable-xhdpi/ic_launcher.png b/plugins/Osmand-RouteSteps/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..71c6d760f0 Binary files /dev/null and b/plugins/Osmand-RouteSteps/res/drawable-xhdpi/ic_launcher.png differ diff --git a/plugins/Osmand-RouteSteps/res/drawable-xhdpi/icon.png b/plugins/Osmand-RouteSteps/res/drawable-xhdpi/icon.png new file mode 100644 index 0000000000..8c9caab40c Binary files /dev/null and b/plugins/Osmand-RouteSteps/res/drawable-xhdpi/icon.png differ diff --git a/plugins/Osmand-RouteSteps/res/layout/main.xml b/plugins/Osmand-RouteSteps/res/layout/main.xml new file mode 100644 index 0000000000..97ef22b8eb --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/layout/main.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/res/values-af/strings.xml b/plugins/Osmand-RouteSteps/res/values-af/strings.xml new file mode 100644 index 0000000000..00f84ee5f0 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-af/strings.xml @@ -0,0 +1,7 @@ + +Nee + Ja + OsmAnd is nie geïnstalleer nie + OsmAnd Parkering + OsmAnd Parkering inlegmodule is geïnstalleer en aangeskakel in OsmAnd verstellings. + diff --git a/plugins/Osmand-RouteSteps/res/values-ar/strings.xml b/plugins/Osmand-RouteSteps/res/values-ar/strings.xml new file mode 100644 index 0000000000..66b615414f --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-ar/strings.xml @@ -0,0 +1,7 @@ + +ليس + نعم + لم يتم تثبيت OsmAnd + وقوف السيارات + يتم تثبيت البرنامج المساعد OsmAnd وقوف السيارات وتمكينها في إعدادات OsmAnd + diff --git a/plugins/Osmand-RouteSteps/res/values-bg/strings.xml b/plugins/Osmand-RouteSteps/res/values-bg/strings.xml new file mode 100644 index 0000000000..60cea88590 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-bg/strings.xml @@ -0,0 +1,8 @@ + + + Не + Да + Приложението OsmAnd не е инсталирано + Добавка Parking за OsmAnd + Добавката Parking е инсталирана и включена в настройките на OsmAnd. + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/res/values-bs/strings.xml b/plugins/Osmand-RouteSteps/res/values-bs/strings.xml new file mode 100644 index 0000000000..7ebdef8fd4 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-bs/strings.xml @@ -0,0 +1,8 @@ + + + Ne + Da + OsmAnd is not installed + OsmAnd Parking Plugin + OsmAnd Parking Plugin is installed and enabled in OsmAnd settings. + diff --git a/plugins/Osmand-RouteSteps/res/values-ca/strings.xml b/plugins/Osmand-RouteSteps/res/values-ca/strings.xml new file mode 100644 index 0000000000..c9bc1274ce --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-ca/strings.xml @@ -0,0 +1,7 @@ + + +No +L\'OsmAnd no està instal·lat +OsmAnd Aparcament +El connector OsmAnd Aparcament està instal·lat i activat a la configuració de l\'OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-cs/strings.xml b/plugins/Osmand-RouteSteps/res/values-cs/strings.xml new file mode 100644 index 0000000000..e3df9fb7f7 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-cs/strings.xml @@ -0,0 +1,8 @@ + + + Ne + Ano + OsmAnd není nainstalován + OsmAnd parkování + OsmAnd modul parkování je nainstalován a aktivován v nastavení OsmAnd. + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/res/values-cy/strings.xml b/plugins/Osmand-RouteSteps/res/values-cy/strings.xml new file mode 100644 index 0000000000..81fcead2f0 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-cy/strings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/res/values-da/strings.xml b/plugins/Osmand-RouteSteps/res/values-da/strings.xml new file mode 100644 index 0000000000..973e1604b5 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-da/strings.xml @@ -0,0 +1,7 @@ + +Nej + Ja + OsmAnd er ikke installeret + OsmAnd parkering + OsmAnd udvidelsen Parkering er installeret og aktiveret i OsmAnd indstillinger. + diff --git a/plugins/Osmand-RouteSteps/res/values-de/strings.xml b/plugins/Osmand-RouteSteps/res/values-de/strings.xml new file mode 100644 index 0000000000..f37e97c596 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-de/strings.xml @@ -0,0 +1,7 @@ + +Nein + Ja + OsmAnd ist nicht installiert + OsmAnd Parkplatz-Plugin + OsmAnd Parkplatz-Plugin wurde installiert und in den OsmAnd-Einstellungen aktiviert. + diff --git a/plugins/Osmand-RouteSteps/res/values-es/strings.xml b/plugins/Osmand-RouteSteps/res/values-es/strings.xml new file mode 100644 index 0000000000..cefb255837 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-es/strings.xml @@ -0,0 +1,7 @@ + +No + + OsmAnd no está instalado + Aparcamiento de OsmAnd + El Plugin Aparcamiento de OsmAnd está instalado y activado en la configuración de OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-eu/strings.xml b/plugins/Osmand-RouteSteps/res/values-eu/strings.xml new file mode 100644 index 0000000000..d248d687b0 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-eu/strings.xml @@ -0,0 +1,7 @@ + +Ez + Bai + OsmAnd ez dago instalatuta + OsmAnd Parking Plugin + OsmAnd Parking Plugin instalatuta eta aktibatuta dago OsmAnd-en konfigurazioan. + diff --git a/plugins/Osmand-RouteSteps/res/values-fa/strings.xml b/plugins/Osmand-RouteSteps/res/values-fa/strings.xml new file mode 100644 index 0000000000..70e3a99dc6 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-fa/strings.xml @@ -0,0 +1,7 @@ + +بله + خیر + OsmAnd نصب نشده است + پارکینگ OsmAnd + افزونه پارکینگ OsmAnd نصب شده و در تنظیمات OsmAnd فعال شده است. + diff --git a/plugins/Osmand-RouteSteps/res/values-fi/strings.xml b/plugins/Osmand-RouteSteps/res/values-fi/strings.xml new file mode 100644 index 0000000000..b77225eed0 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-fi/strings.xml @@ -0,0 +1,8 @@ + + +Ei + Kyllä + OsmAnd ei ole asennettu + OsmAnd Parking + OsmAnd Parking lisäosa on asennettu ja aktivoitu OsmAnd:in asetuksista. + diff --git a/plugins/Osmand-RouteSteps/res/values-fr/strings.xml b/plugins/Osmand-RouteSteps/res/values-fr/strings.xml new file mode 100644 index 0000000000..9b7e9a2a5e --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-fr/strings.xml @@ -0,0 +1,7 @@ + +Non + Oui + OsmAnd n\'est pas installé + Greffon Parking pour OsmAnd + Le greffon Parking est installé et activé dans les paramètres de OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-he/strings.xml b/plugins/Osmand-RouteSteps/res/values-he/strings.xml new file mode 100644 index 0000000000..bd9bf023f8 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-he/strings.xml @@ -0,0 +1,8 @@ + + +לא + כן + התכנית OsmAnd אינה מותקנת + חנייה עם OsmAnd + תוסף החנייה של OsmAnd מותקן ומופעל בהגדרות של OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-hi/strings.xml b/plugins/Osmand-RouteSteps/res/values-hi/strings.xml new file mode 100644 index 0000000000..c247215176 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-hi/strings.xml @@ -0,0 +1,8 @@ + + + नही + हा + OsmAnd is not installed + ओएसएमएएनडी पार्किंग प्लगिन + OsmAnd Parking Plugin is installed and enabled in OsmAnd settings. + diff --git a/plugins/Osmand-RouteSteps/res/values-hr/strings.xml b/plugins/Osmand-RouteSteps/res/values-hr/strings.xml new file mode 100644 index 0000000000..34253e4f3d --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-hr/strings.xml @@ -0,0 +1,8 @@ + + +Ne + Da + OsmAnd nije instaliran + OsmAnd Parkiralište + OsmAnd dodatak za parkirališta je instaliran i omogućen u OsmAnd postavkama. + diff --git a/plugins/Osmand-RouteSteps/res/values-hu/strings.xml b/plugins/Osmand-RouteSteps/res/values-hu/strings.xml new file mode 100644 index 0000000000..126b300b69 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-hu/strings.xml @@ -0,0 +1,8 @@ + + + Nem + Igen + Az OsmAnd nincs feltelepítve + OsmAnd Parkolás + OsmAnd Parkolási Bővítmény feltelepítve és engedélyezve az OsmAnd beállításaiban. + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/res/values-hy/strings.xml b/plugins/Osmand-RouteSteps/res/values-hy/strings.xml new file mode 100644 index 0000000000..5d916d6389 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-hy/strings.xml @@ -0,0 +1,8 @@ + + + No + Yes + OsmAnd is not installed + OsmAnd Parking Plugin + OsmAnd Parking Plugin is installed and enabled in OsmAnd settings. + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/res/values-id/strings.xml b/plugins/Osmand-RouteSteps/res/values-id/strings.xml new file mode 100644 index 0000000000..5d916d6389 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-id/strings.xml @@ -0,0 +1,8 @@ + + + No + Yes + OsmAnd is not installed + OsmAnd Parking Plugin + OsmAnd Parking Plugin is installed and enabled in OsmAnd settings. + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/res/values-it/strings.xml b/plugins/Osmand-RouteSteps/res/values-it/strings.xml new file mode 100644 index 0000000000..0bc0d6a835 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-it/strings.xml @@ -0,0 +1,7 @@ + +No + Si + OsmAnd non è installato + OsmAnd Parking + Il Plugin Parcheggio per OsmAnd è installato e abilitato nelle impostazioni di OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-ja/strings.xml b/plugins/Osmand-RouteSteps/res/values-ja/strings.xml new file mode 100644 index 0000000000..603d75d5d5 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-ja/strings.xml @@ -0,0 +1,7 @@ + +いいえ + はい + OsmAndがインストールされていません + OsmAnd駐車場 + OsmAnd駐車場プラグインはインストールされており、設定は有効です。 + diff --git a/plugins/Osmand-RouteSteps/res/values-ka/strings.xml b/plugins/Osmand-RouteSteps/res/values-ka/strings.xml new file mode 100644 index 0000000000..0120525c58 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-ka/strings.xml @@ -0,0 +1,8 @@ + + + არა + დიახ + OsmAnd ჩადგმული არაა + OsmAnd პარკინგი + OsmAnd-ის პარკინგის დამატება ჩადგმულია და ჩართულია პარამეტრებში. + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/res/values-lt/strings.xml b/plugins/Osmand-RouteSteps/res/values-lt/strings.xml new file mode 100644 index 0000000000..c7640f8192 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-lt/strings.xml @@ -0,0 +1,7 @@ + +Ne + Taip + OsmAnd programa neįdiegta + OsmAnd parkavimo įskiepis + OsmAnd Parkavimo įskiepis įdiegiamas ir aktyvuojamas OsmAnd nustatymuose. + diff --git a/plugins/Osmand-RouteSteps/res/values-lv/strings.xml b/plugins/Osmand-RouteSteps/res/values-lv/strings.xml new file mode 100644 index 0000000000..4341d84c65 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-lv/strings.xml @@ -0,0 +1,8 @@ + + + + + OsmAnd nav instalēts + OsmAnd Parkošanās + OsmAnd parkošanās spraudnis ir instalēts un iespējots OsmAnd uzstādījumos. + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/res/values-mn/strings.xml b/plugins/Osmand-RouteSteps/res/values-mn/strings.xml new file mode 100644 index 0000000000..9c5ad89af1 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-mn/strings.xml @@ -0,0 +1,3 @@ + + + diff --git a/plugins/Osmand-RouteSteps/res/values-mr/strings.xml b/plugins/Osmand-RouteSteps/res/values-mr/strings.xml new file mode 100644 index 0000000000..bb2f935183 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-mr/strings.xml @@ -0,0 +1,8 @@ + + + नाही + हो + ओएसएमएएनडि इन्स्टॉल केलेले नाही + ओएसएमएएनडि पार्किंग + ओएसएमएएनडि पार्किंग प्लगिन इन्स्टॉल आणि चालू केले आहे. + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/res/values-nb/strings.xml b/plugins/Osmand-RouteSteps/res/values-nb/strings.xml new file mode 100644 index 0000000000..d4623fe95f --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-nb/strings.xml @@ -0,0 +1,7 @@ + +Ja + Nei + OsmAnd er ikke installert + OsmAnd - parkering + OsmAnd-pluginen er installert og aktivert i innstillingene for OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-nl/strings.xml b/plugins/Osmand-RouteSteps/res/values-nl/strings.xml new file mode 100644 index 0000000000..7386549e61 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-nl/strings.xml @@ -0,0 +1,7 @@ + +Nee + Ja + OsmAnd is niet geïnstalleerd + OsmAnd parkeerplugin + OsmAnd parkeerplugin is geïnstalleerd en geactiveerd in de OsmAnd-instellingen. + diff --git a/plugins/Osmand-RouteSteps/res/values-pl/strings.xml b/plugins/Osmand-RouteSteps/res/values-pl/strings.xml new file mode 100644 index 0000000000..ae0f030549 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-pl/strings.xml @@ -0,0 +1,7 @@ + +Nie + Tak + Osmand nie jest zainstalowany + Wtyczka parkowania dla OsmAnd + Wtyczka parkowania jest zainstalowana i włączona w ustawieniach OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-pt/strings.xml b/plugins/Osmand-RouteSteps/res/values-pt/strings.xml new file mode 100644 index 0000000000..9d28f8d8c6 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-pt/strings.xml @@ -0,0 +1,7 @@ + +Não + Sim + Osmand não está instalado + OsmAnd Parking Plugin + OsmAnd Parking Plugin está instalado e activado nas opções OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-ro/strings.xml b/plugins/Osmand-RouteSteps/res/values-ro/strings.xml new file mode 100644 index 0000000000..5d0369ee36 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-ro/strings.xml @@ -0,0 +1,7 @@ + +Nu + Da + OsmAnd nu este instalat + OsmAnd Parking + Plugin-ul OsmAnd Parking este instalat și activat în setările OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-ru/strings.xml b/plugins/Osmand-RouteSteps/res/values-ru/strings.xml new file mode 100644 index 0000000000..b70765b9e5 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-ru/strings.xml @@ -0,0 +1,8 @@ + + + Нет + Да + OsmAnd не установлен + Плагин парковки OsmAnd + Плагин парковки установлен и включен в настройках OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-sc/strings.xml b/plugins/Osmand-RouteSteps/res/values-sc/strings.xml new file mode 100644 index 0000000000..058296440b --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-sc/strings.xml @@ -0,0 +1,7 @@ + +Nono + Eja + OsmAnd no est installau + OsmAnd Parchezu + OsmAnd Parchezu est installau e insertau in sas impostaduras de OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-sk/strings.xml b/plugins/Osmand-RouteSteps/res/values-sk/strings.xml new file mode 100644 index 0000000000..0b3b5ad7f5 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-sk/strings.xml @@ -0,0 +1,8 @@ + + + Nie + Áno + Aplikácia OsmAnd nie je nainštalovaná + OsmAnd parkovanie + Parkovací zásuvný modul pre OsmAnd je nainštalovaný a povolený v nastaveniach aplikácie OsmAnd. + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/res/values-sl/strings.xml b/plugins/Osmand-RouteSteps/res/values-sl/strings.xml new file mode 100644 index 0000000000..d457d4abbb --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-sl/strings.xml @@ -0,0 +1,8 @@ + + +Da + Ne + OsmAnd ni nameščen + OsmAnd parkiranje + Vtičnik OsmAnd parkiranje je nameščen in omogočen v OsmAnd nastavitvah. + diff --git a/plugins/Osmand-RouteSteps/res/values-sq/strings.xml b/plugins/Osmand-RouteSteps/res/values-sq/strings.xml new file mode 100644 index 0000000000..46ade86e72 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-sq/strings.xml @@ -0,0 +1,7 @@ + +Jo + Po + OsmAnd nuk është instaluar + OsmAnd Parkim + Plugini OsmAnd Parkim është instaluar dhe aktivizuar në OsmAnd settings. + diff --git a/plugins/Osmand-RouteSteps/res/values-sr/strings.xml b/plugins/Osmand-RouteSteps/res/values-sr/strings.xml new file mode 100644 index 0000000000..9c5ad89af1 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-sr/strings.xml @@ -0,0 +1,3 @@ + + + diff --git a/plugins/Osmand-RouteSteps/res/values-sv/strings.xml b/plugins/Osmand-RouteSteps/res/values-sv/strings.xml new file mode 100644 index 0000000000..669e231fa1 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-sv/strings.xml @@ -0,0 +1,8 @@ + + +Nej + Ja + OsmAnd är inte installerad + OsmAnd - parkering + OsmAnd-pluginen Parkering är installerad och aktiverad i inställningarna för OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-tl/strings.xml b/plugins/Osmand-RouteSteps/res/values-tl/strings.xml new file mode 100644 index 0000000000..9c5ad89af1 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-tl/strings.xml @@ -0,0 +1,3 @@ + + + diff --git a/plugins/Osmand-RouteSteps/res/values-tr/strings.xml b/plugins/Osmand-RouteSteps/res/values-tr/strings.xml new file mode 100644 index 0000000000..01b39afda6 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-tr/strings.xml @@ -0,0 +1,5 @@ + + +Evet + Hayır + diff --git a/plugins/Osmand-RouteSteps/res/values-uk/strings.xml b/plugins/Osmand-RouteSteps/res/values-uk/strings.xml new file mode 100644 index 0000000000..a675bde927 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-uk/strings.xml @@ -0,0 +1,7 @@ + +Ні + Так + Osmand не встановлено + Паркування OsmAnd + Плагін Паркування OsmAnd встановлено та увімкнено у налаштуваннях OsmAnd. + diff --git a/plugins/Osmand-RouteSteps/res/values-zh-rCN/strings.xml b/plugins/Osmand-RouteSteps/res/values-zh-rCN/strings.xml new file mode 100644 index 0000000000..bc5d807565 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-zh-rCN/strings.xml @@ -0,0 +1,7 @@ + + + 没有 + OsmAnd 未安装 + OsmAnd 停车场 + OsmAnd 停车场插件已安装,并已在 OsmAnd 设置中启用。 + diff --git a/plugins/Osmand-RouteSteps/res/values-zh-rTW/strings.xml b/plugins/Osmand-RouteSteps/res/values-zh-rTW/strings.xml new file mode 100644 index 0000000000..1d42543909 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values-zh-rTW/strings.xml @@ -0,0 +1,7 @@ + + + + OsmAnd 並未安裝 + OsmAnd 停車場外掛元件已安裝,並且已在 OsmAnd 設定裡啟用。 +OsmAnd 停車場 + diff --git a/plugins/Osmand-RouteSteps/res/values/strings.xml b/plugins/Osmand-RouteSteps/res/values/strings.xml new file mode 100644 index 0000000000..29cf78cf31 --- /dev/null +++ b/plugins/Osmand-RouteSteps/res/values/strings.xml @@ -0,0 +1,8 @@ + + + No + Yes + OsmAnd is not installed + OsmAnd Route steps + OsmAnd Route Steps Plugin is installed and enabled in OsmAnd settings. + \ No newline at end of file diff --git a/plugins/Osmand-RouteSteps/src/net/osmand/routeStepsPlugin/RouteStepsActivity.java b/plugins/Osmand-RouteSteps/src/net/osmand/routeStepsPlugin/RouteStepsActivity.java new file mode 100644 index 0000000000..df52d215a0 --- /dev/null +++ b/plugins/Osmand-RouteSteps/src/net/osmand/routeStepsPlugin/RouteStepsActivity.java @@ -0,0 +1,61 @@ +package net.osmand.routeStepsPlugin; + +import android.app.Activity; +import android.app.AlertDialog; +import android.content.ActivityNotFoundException; +import android.content.ComponentName; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.net.Uri; +import android.os.Bundle; +import net.osmand.routeSteps.R; + +public class RouteStepsActivity extends Activity { + private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$ + private static final String OSMAND_COMPONENT_PLUS = "net.osmand.plus"; //$NON-NLS-1$ + private static final String OSMAND_ACTIVITY = "net.osmand.plus.activities.MainMenuActivity"; //$NON-NLS-1$ + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + + Intent intentPlus = new Intent(); + intentPlus.setComponent(new ComponentName(OSMAND_COMPONENT_PLUS, OSMAND_ACTIVITY)); + intentPlus.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); + ResolveInfo resolved = getPackageManager().resolveActivity(intentPlus, PackageManager.MATCH_DEFAULT_ONLY); + if(resolved != null) { + stopService(intentPlus); + startActivity(intentPlus); + } else { + Intent intentNormal = new Intent(); + intentNormal.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); + intentNormal.setComponent(new ComponentName(OSMAND_COMPONENT, OSMAND_ACTIVITY)); + resolved = getPackageManager().resolveActivity(intentNormal, PackageManager.MATCH_DEFAULT_ONLY); + if (resolved != null) { + stopService(intentNormal); + startActivity(intentNormal); + } else { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setMessage(getString(R.string.osmand_app_not_found)); + builder.setPositiveButton(getString(R.string.default_buttons_yes), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + OSMAND_COMPONENT_PLUS)); + try { + stopService(intent); + startActivity(intent); + } catch (ActivityNotFoundException e) { + } + } + }); + builder.setNegativeButton(getString(R.string.default_buttons_no), null); + builder.show(); + } + } + } + +} \ No newline at end of file