From f14dfc70c80f04df84ab74c89a3d32cea3b6298d Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Thu, 31 Aug 2017 17:37:04 +0300 Subject: [PATCH 01/84] Add notes to aidl --- .../net/osmand/aidl/IOsmAndAidlInterface.aidl | 10 ++ OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 138 ++++++++++++++++++ .../net/osmand/aidl/OsmandAidlService.java | 40 +++++ .../aidl/note/StartAudioRecordingParams.aidl | 3 + .../aidl/note/StartAudioRecordingParams.java | 56 +++++++ .../aidl/note/StartVideoRecordingParams.aidl | 3 + .../aidl/note/StartVideoRecordingParams.java | 56 +++++++ .../osmand/aidl/note/StopRecordingParams.aidl | 3 + .../osmand/aidl/note/StopRecordingParams.java | 42 ++++++ .../osmand/aidl/note/TakePhotoNoteParams.aidl | 3 + .../osmand/aidl/note/TakePhotoNoteParams.java | 56 +++++++ 11 files changed, 410 insertions(+) create mode 100644 OsmAnd/src/net/osmand/aidl/note/StartAudioRecordingParams.aidl create mode 100644 OsmAnd/src/net/osmand/aidl/note/StartAudioRecordingParams.java create mode 100644 OsmAnd/src/net/osmand/aidl/note/StartVideoRecordingParams.aidl create mode 100644 OsmAnd/src/net/osmand/aidl/note/StartVideoRecordingParams.java create mode 100644 OsmAnd/src/net/osmand/aidl/note/StopRecordingParams.aidl create mode 100644 OsmAnd/src/net/osmand/aidl/note/StopRecordingParams.java create mode 100644 OsmAnd/src/net/osmand/aidl/note/TakePhotoNoteParams.aidl create mode 100644 OsmAnd/src/net/osmand/aidl/note/TakePhotoNoteParams.java diff --git a/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl b/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl index 089f96c04c..04105f7ba0 100644 --- a/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl +++ b/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl @@ -41,6 +41,11 @@ import net.osmand.aidl.maplayer.AddMapLayerParams; import net.osmand.aidl.maplayer.RemoveMapLayerParams; import net.osmand.aidl.maplayer.UpdateMapLayerParams; +import net.osmand.aidl.note.TakePhotoNoteParams; +import net.osmand.aidl.note.StartVideoRecordingParams; +import net.osmand.aidl.note.StartAudioRecordingParams; +import net.osmand.aidl.note.StopRecordingParams; + // NOTE: Add new methods at the end of file!!! interface IOsmAndAidlInterface { @@ -82,4 +87,9 @@ interface IOsmAndAidlInterface { boolean startGpxRecording(in StartGpxRecordingParams params); boolean stopGpxRecording(in StopGpxRecordingParams params); + boolean takePhotoNote(in TakePhotoNoteParams params); + boolean startVideoRecording(in StartVideoRecordingParams params); + boolean startAudioRecording(in StartAudioRecordingParams params); + boolean stopRecording(in StopRecordingParams params); + } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index 7aaeff5eac..a9cfa2013e 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -33,6 +33,7 @@ import net.osmand.plus.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.audionotes.AudioVideoNotesPlugin; import net.osmand.plus.dialogs.ConfigureMapMenu; import net.osmand.plus.helpers.ColorDialogs; import net.osmand.plus.monitoring.OsmandMonitoringPlugin; @@ -73,6 +74,11 @@ public class OsmandAidlApi { private static final String AIDL_ADD_MAP_LAYER = "aidl_add_map_layer"; private static final String AIDL_REMOVE_MAP_LAYER = "aidl_remove_map_layer"; + private static final String AIDL_TAKE_PHOTO_NOTE = "aidl_take_photo_note"; + private static final String AIDL_START_VIDEO_RECORDING = "aidl_start_video_recording"; + private static final String AIDL_START_AUDIO_RECORDING = "aidl_start_audio_recording"; + private static final String AIDL_STOP_RECORDING = "aidl_stop_recording"; + private OsmandApplication app; private Map widgets = new ConcurrentHashMap<>(); private Map widgetControls = new ConcurrentHashMap<>(); @@ -85,6 +91,10 @@ public class OsmandAidlApi { private BroadcastReceiver removeMapWidgetReceiver; private BroadcastReceiver addMapLayerReceiver; private BroadcastReceiver removeMapLayerReceiver; + private BroadcastReceiver takePhotoNoteReceiver; + private BroadcastReceiver startVideoRecordingReceiver; + private BroadcastReceiver startAudioRecordingReceiver; + private BroadcastReceiver stopRecordingReceiver; public OsmandAidlApi(OsmandApplication app) { this.app = app; @@ -97,6 +107,10 @@ public class OsmandAidlApi { registerRemoveMapWidgetReceiver(mapActivity); registerAddMapLayerReceiver(mapActivity); registerRemoveMapLayerReceiver(mapActivity); + registerTakePhotoNoteReceiver(mapActivity); + registerStartVideoRecordingReceiver(mapActivity); + registerStartAudioRecordingReceiver(mapActivity); + registerStopRecordingReceiver(mapActivity); } public void onDestroyMapActivity(final MapActivity mapActivity) { @@ -151,6 +165,38 @@ public class OsmandAidlApi { } removeMapLayerReceiver = null; } + if (takePhotoNoteReceiver != null) { + try { + mapActivity.unregisterReceiver(takePhotoNoteReceiver); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + takePhotoNoteReceiver = null; + } + if (startVideoRecordingReceiver != null) { + try { + mapActivity.unregisterReceiver(startVideoRecordingReceiver); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + startVideoRecordingReceiver = null; + } + if (startAudioRecordingReceiver != null) { + try { + mapActivity.unregisterReceiver(startAudioRecordingReceiver); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + startAudioRecordingReceiver = null; + } + if (stopRecordingReceiver != null) { + try { + mapActivity.unregisterReceiver(stopRecordingReceiver); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + stopRecordingReceiver = null; + } } private void registerRefreshMapReceiver(final MapActivity mapActivity) { @@ -303,6 +349,64 @@ public class OsmandAidlApi { mapActivity.registerReceiver(removeMapLayerReceiver, new IntentFilter(AIDL_REMOVE_MAP_LAYER)); } + private void registerTakePhotoNoteReceiver(final MapActivity mapActivity) { + takePhotoNoteReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + final AudioVideoNotesPlugin plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class); + if (plugin != null) { + double lat = intent.getDoubleExtra(AIDL_LATITUDE, Double.NaN); + double lon = intent.getDoubleExtra(AIDL_LONGITUDE, Double.NaN); + plugin.takePhoto(lat, lon, mapActivity, false); + } + } + }; + mapActivity.registerReceiver(takePhotoNoteReceiver, new IntentFilter(AIDL_TAKE_PHOTO_NOTE)); + } + + private void registerStartVideoRecordingReceiver(final MapActivity mapActivity) { + startVideoRecordingReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + final AudioVideoNotesPlugin plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class); + if (plugin != null) { + double lat = intent.getDoubleExtra(AIDL_LATITUDE, Double.NaN); + double lon = intent.getDoubleExtra(AIDL_LONGITUDE, Double.NaN); + plugin.recordVideo(lat, lon, mapActivity); + } + } + }; + mapActivity.registerReceiver(startVideoRecordingReceiver, new IntentFilter(AIDL_START_VIDEO_RECORDING)); + } + + private void registerStartAudioRecordingReceiver(final MapActivity mapActivity) { + startVideoRecordingReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + final AudioVideoNotesPlugin plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class); + if (plugin != null) { + double lat = intent.getDoubleExtra(AIDL_LATITUDE, Double.NaN); + double lon = intent.getDoubleExtra(AIDL_LONGITUDE, Double.NaN); + plugin.recordAudio(lat, lon, mapActivity); + } + } + }; + mapActivity.registerReceiver(startVideoRecordingReceiver, new IntentFilter(AIDL_START_AUDIO_RECORDING)); + } + + private void registerStopRecordingReceiver(final MapActivity mapActivity) { + stopRecordingReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + final AudioVideoNotesPlugin plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class); + if (plugin != null) { + plugin.stopRecording(mapActivity, false); + } + } + }; + mapActivity.registerReceiver(stopRecordingReceiver, new IntentFilter(AIDL_STOP_RECORDING)); + } + public void registerMapLayers(MapActivity mapActivity) { for (AMapLayer layer : layers.values()) { OsmandMapLayer mapLayer = mapLayers.get(layer.getId()); @@ -865,4 +969,38 @@ public class OsmandAidlApi { } return false; } + + boolean takePhotoNote(double latitude, double longitude) { + Intent intent = new Intent(); + intent.setAction(AIDL_TAKE_PHOTO_NOTE); + intent.putExtra(AIDL_LATITUDE, latitude); + intent.putExtra(AIDL_LONGITUDE, longitude); + app.sendBroadcast(intent); + return true; + } + + boolean startVideoRecording(double latitude, double longitude) { + Intent intent = new Intent(); + intent.setAction(AIDL_START_VIDEO_RECORDING); + intent.putExtra(AIDL_LATITUDE, latitude); + intent.putExtra(AIDL_LONGITUDE, longitude); + app.sendBroadcast(intent); + return true; + } + + boolean startAudioRecording(double latitude, double longitude) { + Intent intent = new Intent(); + intent.setAction(AIDL_START_AUDIO_RECORDING); + intent.putExtra(AIDL_LATITUDE, latitude); + intent.putExtra(AIDL_LONGITUDE, longitude); + app.sendBroadcast(intent); + return true; + } + + boolean stopRecording() { + Intent intent = new Intent(); + intent.setAction(AIDL_STOP_RECORDING); + app.sendBroadcast(intent); + return true; + } } diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java index e1da642f59..42307f2625 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java @@ -31,6 +31,10 @@ import net.osmand.aidl.mapmarker.UpdateMapMarkerParams; import net.osmand.aidl.mapwidget.AddMapWidgetParams; import net.osmand.aidl.mapwidget.RemoveMapWidgetParams; import net.osmand.aidl.mapwidget.UpdateMapWidgetParams; +import net.osmand.aidl.note.StartAudioRecordingParams; +import net.osmand.aidl.note.StopRecordingParams; +import net.osmand.aidl.note.TakePhotoNoteParams; +import net.osmand.aidl.note.StartVideoRecordingParams; import net.osmand.plus.OsmandApplication; import net.osmand.util.Algorithms; @@ -340,5 +344,41 @@ public class OsmandAidlService extends Service { return false; } } + + @Override + public boolean takePhotoNote(TakePhotoNoteParams params) throws RemoteException { + try { + return params != null && getApi().takePhotoNote(params.getLatitude(), params.getLongitude()); + } catch (Exception e) { + return false; + } + } + + @Override + public boolean startVideoRecording(StartVideoRecordingParams params) throws RemoteException { + try { + return params != null && getApi().startVideoRecording(params.getLatitude(), params.getLongitude()); + } catch (Exception e) { + return false; + } + } + + @Override + public boolean startAudioRecording(StartAudioRecordingParams params) throws RemoteException { + try { + return params != null && getApi().startAudioRecording(params.getLatitude(), params.getLongitude()); + } catch (Exception e) { + return false; + } + } + + @Override + public boolean stopRecording(StopRecordingParams params) throws RemoteException { + try { + return getApi().stopRecording(); + } catch (Exception e) { + return false; + } + } }; } diff --git a/OsmAnd/src/net/osmand/aidl/note/StartAudioRecordingParams.aidl b/OsmAnd/src/net/osmand/aidl/note/StartAudioRecordingParams.aidl new file mode 100644 index 0000000000..bb16dea140 --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/note/StartAudioRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable StartAudioRecordingParams; \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/aidl/note/StartAudioRecordingParams.java b/OsmAnd/src/net/osmand/aidl/note/StartAudioRecordingParams.java new file mode 100644 index 0000000000..c2800feb9c --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/note/StartAudioRecordingParams.java @@ -0,0 +1,56 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StartAudioRecordingParams implements Parcelable { + + private double latitude; + private double longitude; + + public StartAudioRecordingParams(double latitude, double longitude) { + this.latitude = latitude; + this.longitude = longitude; + } + + public StartAudioRecordingParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StartAudioRecordingParams createFromParcel(Parcel in) { + return new StartAudioRecordingParams(in); + } + + @Override + public StartAudioRecordingParams[] newArray(int size) { + return new StartAudioRecordingParams[size]; + } + }; + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + } + + private void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd/src/net/osmand/aidl/note/StartVideoRecordingParams.aidl b/OsmAnd/src/net/osmand/aidl/note/StartVideoRecordingParams.aidl new file mode 100644 index 0000000000..082b68e09c --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/note/StartVideoRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable StartVideoRecordingParams; \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/aidl/note/StartVideoRecordingParams.java b/OsmAnd/src/net/osmand/aidl/note/StartVideoRecordingParams.java new file mode 100644 index 0000000000..aee86ea9de --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/note/StartVideoRecordingParams.java @@ -0,0 +1,56 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StartVideoRecordingParams implements Parcelable { + + private double latitude; + private double longitude; + + public StartVideoRecordingParams(double latitude, double longitude) { + this.latitude = latitude; + this.longitude = longitude; + } + + public StartVideoRecordingParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StartVideoRecordingParams createFromParcel(Parcel in) { + return new StartVideoRecordingParams(in); + } + + @Override + public StartVideoRecordingParams[] newArray(int size) { + return new StartVideoRecordingParams[size]; + } + }; + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + } + + private void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd/src/net/osmand/aidl/note/StopRecordingParams.aidl b/OsmAnd/src/net/osmand/aidl/note/StopRecordingParams.aidl new file mode 100644 index 0000000000..4111efbcb6 --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/note/StopRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable StopRecordingParams; \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/aidl/note/StopRecordingParams.java b/OsmAnd/src/net/osmand/aidl/note/StopRecordingParams.java new file mode 100644 index 0000000000..b56a42504b --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/note/StopRecordingParams.java @@ -0,0 +1,42 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StopRecordingParams implements Parcelable { + + public StopRecordingParams() { + + } + + public StopRecordingParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StopRecordingParams createFromParcel(Parcel in) { + return new StopRecordingParams(in); + } + + @Override + public StopRecordingParams[] newArray(int size) { + return new StopRecordingParams[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + + } + + private void readFromParcel(Parcel in) { + + } + + @Override + public int describeContents() { + return 0; + } + +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/aidl/note/TakePhotoNoteParams.aidl b/OsmAnd/src/net/osmand/aidl/note/TakePhotoNoteParams.aidl new file mode 100644 index 0000000000..3c09d62c41 --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/note/TakePhotoNoteParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable TakePhotoNoteParams; \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/aidl/note/TakePhotoNoteParams.java b/OsmAnd/src/net/osmand/aidl/note/TakePhotoNoteParams.java new file mode 100644 index 0000000000..254516e080 --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/note/TakePhotoNoteParams.java @@ -0,0 +1,56 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class TakePhotoNoteParams implements Parcelable { + + private double latitude; + private double longitude; + + public TakePhotoNoteParams(double latitude, double longitude) { + this.latitude = latitude; + this.longitude = longitude; + } + + public TakePhotoNoteParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public TakePhotoNoteParams createFromParcel(Parcel in) { + return new TakePhotoNoteParams(in); + } + + @Override + public TakePhotoNoteParams[] newArray(int size) { + return new TakePhotoNoteParams[size]; + } + }; + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + } + + private void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + } + + @Override + public int describeContents() { + return 0; + } + +} From d6d520dd4d2bf12db9f128a29fc475ecd4d61576 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 1 Sep 2017 12:13:47 +0300 Subject: [PATCH 02/84] Add navigate to aidl --- .../net/osmand/aidl/IOsmAndAidlInterface.aidl | 4 + OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 141 ++++++++++++++++++ .../net/osmand/aidl/OsmandAidlService.java | 10 ++ .../aidl/navigation/NavigateParams.aidl | 3 + .../aidl/navigation/NavigateParams.java | 104 +++++++++++++ 5 files changed, 262 insertions(+) create mode 100644 OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.aidl create mode 100644 OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.java diff --git a/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl b/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl index 04105f7ba0..bc6ac7d127 100644 --- a/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl +++ b/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl @@ -41,6 +41,8 @@ import net.osmand.aidl.maplayer.AddMapLayerParams; import net.osmand.aidl.maplayer.RemoveMapLayerParams; import net.osmand.aidl.maplayer.UpdateMapLayerParams; +import net.osmand.aidl.navigation.NavigateParams; + import net.osmand.aidl.note.TakePhotoNoteParams; import net.osmand.aidl.note.StartVideoRecordingParams; import net.osmand.aidl.note.StartAudioRecordingParams; @@ -92,4 +94,6 @@ interface IOsmAndAidlInterface { boolean startAudioRecording(in StartAudioRecordingParams params); boolean stopRecording(in StopRecordingParams params); + boolean navigate(in NavigateParams params); + } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index a9cfa2013e..a30fafa290 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -2,11 +2,13 @@ package net.osmand.aidl; import android.content.BroadcastReceiver; import android.content.Context; +import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.net.Uri; import android.os.AsyncTask; import android.os.ParcelFileDescriptor; +import android.support.v7.app.AlertDialog; import android.view.View; import net.osmand.IndexConstants; @@ -22,6 +24,7 @@ import net.osmand.aidl.mapwidget.AMapWidget; import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; +import net.osmand.plus.ApplicationMode; import net.osmand.plus.FavouritesDbHelper; import net.osmand.plus.GPXDatabase.GpxDataItem; import net.osmand.plus.GPXUtilities; @@ -32,11 +35,13 @@ import net.osmand.plus.MapMarkersHelper; import net.osmand.plus.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; +import net.osmand.plus.TargetPointsHelper; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.audionotes.AudioVideoNotesPlugin; import net.osmand.plus.dialogs.ConfigureMapMenu; import net.osmand.plus.helpers.ColorDialogs; import net.osmand.plus.monitoring.OsmandMonitoringPlugin; +import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.views.AidlMapLayer; import net.osmand.plus.views.MapInfoLayer; import net.osmand.plus.views.OsmandMapLayer; @@ -66,6 +71,15 @@ public class OsmandAidlApi { private static final String AIDL_ZOOM = "aidl_zoom"; private static final String AIDL_ANIMATED = "aidl_animated"; + private static final String AIDL_START_NAME = "aidl_start_name"; + private static final String AIDL_START_LAT = "aidl_start_lat"; + private static final String AIDL_START_LON = "aidl_start_lon"; + private static final String AIDL_DEST_NAME = "aidl_dest_name"; + private static final String AIDL_DEST_LAT = "aidl_dest_lat"; + private static final String AIDL_DEST_LON = "aidl_dest_lon"; + private static final String AIDL_PROFILE = "aidl_profile"; + private static final String AIDL_FORCE = "aidl_force"; + private static final String AIDL_OBJECT_ID = "aidl_object_id"; private static final String AIDL_ADD_MAP_WIDGET = "aidl_add_map_widget"; @@ -79,6 +93,16 @@ public class OsmandAidlApi { private static final String AIDL_START_AUDIO_RECORDING = "aidl_start_audio_recording"; private static final String AIDL_STOP_RECORDING = "aidl_stop_recording"; + private static final String AIDL_NAVIGATE = "aidl_navigate"; + + private static final ApplicationMode DEFAULT_PROFILE = ApplicationMode.CAR; + + private static final ApplicationMode[] VALID_PROFILES = new ApplicationMode[]{ + ApplicationMode.CAR, + ApplicationMode.BICYCLE, + ApplicationMode.PEDESTRIAN + }; + private OsmandApplication app; private Map widgets = new ConcurrentHashMap<>(); private Map widgetControls = new ConcurrentHashMap<>(); @@ -95,6 +119,7 @@ public class OsmandAidlApi { private BroadcastReceiver startVideoRecordingReceiver; private BroadcastReceiver startAudioRecordingReceiver; private BroadcastReceiver stopRecordingReceiver; + private BroadcastReceiver navigateReceiver; public OsmandAidlApi(OsmandApplication app) { this.app = app; @@ -111,6 +136,7 @@ public class OsmandAidlApi { registerStartVideoRecordingReceiver(mapActivity); registerStartAudioRecordingReceiver(mapActivity); registerStopRecordingReceiver(mapActivity); + registerNavigateReceiver(mapActivity); } public void onDestroyMapActivity(final MapActivity mapActivity) { @@ -197,6 +223,14 @@ public class OsmandAidlApi { } stopRecordingReceiver = null; } + if (navigateReceiver != null) { + try { + mapActivity.unregisterReceiver(navigateReceiver); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + navigateReceiver = null; + } } private void registerRefreshMapReceiver(final MapActivity mapActivity) { @@ -407,6 +441,98 @@ public class OsmandAidlApi { mapActivity.registerReceiver(stopRecordingReceiver, new IntentFilter(AIDL_STOP_RECORDING)); } + private void registerNavigateReceiver(final MapActivity mapActivity) { + navigateReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + String profileStr = intent.getStringExtra(AIDL_PROFILE); + final ApplicationMode profile = ApplicationMode.valueOfStringKey(profileStr, DEFAULT_PROFILE); + boolean validProfile = false; + for (ApplicationMode mode : VALID_PROFILES) { + if (mode == profile) { + validProfile = true; + break; + } + } + if (validProfile) { + String startName = intent.getStringExtra(AIDL_START_NAME); + if (Algorithms.isEmpty(startName)) { + startName = ""; + } + String destName = intent.getStringExtra(AIDL_DEST_NAME); + if (Algorithms.isEmpty(destName)) { + destName = ""; + } + + final LatLon start; + final PointDescription startDesc; + double startLat = intent.getDoubleExtra(AIDL_START_LAT, 0); + double startLon = intent.getDoubleExtra(AIDL_START_LON, 0); + if (startLat != 0 && startLon != 0) { + start = new LatLon(startLat, startLon); + startDesc = new PointDescription(PointDescription.POINT_TYPE_LOCATION, startName); + } else { + start = null; + startDesc = null; + } + + double destLat = intent.getDoubleExtra(AIDL_DEST_LAT, 0); + double destLon = intent.getDoubleExtra(AIDL_DEST_LON, 0); + final LatLon dest = new LatLon(destLat, destLon); + final PointDescription destDesc = new PointDescription(PointDescription.POINT_TYPE_LOCATION, destName); + + final RoutingHelper routingHelper = app.getRoutingHelper(); + boolean force = intent.getBooleanExtra(AIDL_FORCE, true); + if (routingHelper.isFollowingMode() && !force) { + AlertDialog dlg = mapActivity.getMapActions().stopNavigationActionConfirm(); + dlg.setOnDismissListener(new DialogInterface.OnDismissListener() { + + @Override + public void onDismiss(DialogInterface dialog) { + if (!routingHelper.isFollowingMode()) { + startNavigation(mapActivity, null, start, startDesc, dest, destDesc, profile); + } + } + }); + } else { + startNavigation(mapActivity, null, start, startDesc, dest, destDesc, profile); + } + } + } + }; + mapActivity.registerReceiver(navigateReceiver, new IntentFilter(AIDL_NAVIGATE)); + } + + private void startNavigation(MapActivity mapActivity, + GPXFile gpx, + LatLon from, PointDescription fromDesc, + LatLon to, PointDescription toDesc, + ApplicationMode mode) { + OsmandApplication app = mapActivity.getMyApplication(); + RoutingHelper routingHelper = app.getRoutingHelper(); + if (gpx == null) { + app.getSettings().APPLICATION_MODE.set(mode); + final TargetPointsHelper targets = mapActivity.getMyApplication().getTargetPointsHelper(); + targets.removeAllWayPoints(false, true); + targets.navigateToPoint(to, true, -1, toDesc); + } + mapActivity.getMapActions().enterRoutePlanningModeGivenGpx(gpx, from, fromDesc, true, false); + if (!app.getTargetPointsHelper().checkPointToNavigateShort()) { + mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu().show(); + } else { + if (app.getSettings().APPLICATION_MODE.get() != routingHelper.getAppMode()) { + app.getSettings().APPLICATION_MODE.set(routingHelper.getAppMode()); + } + mapActivity.getMapViewTrackingUtilities().backToLocationImpl(); + app.getSettings().FOLLOW_THE_ROUTE.set(true); + routingHelper.setFollowingMode(true); + routingHelper.setRoutePlanningMode(false); + mapActivity.getMapViewTrackingUtilities().switchToRoutePlanningMode(); + app.getRoutingHelper().notifyIfRouteIsCalculated(); + routingHelper.setCurrentLocation(app.getLocationProvider().getLastKnownLocation(), false); + } + } + public void registerMapLayers(MapActivity mapActivity) { for (AMapLayer layer : layers.values()) { OsmandMapLayer mapLayer = mapLayers.get(layer.getId()); @@ -1003,4 +1129,19 @@ public class OsmandAidlApi { app.sendBroadcast(intent); return true; } + + boolean navigate(String startName, double startLat, double startLon, String destName, double destLat, double destLon, String profile, boolean force) { + Intent intent = new Intent(); + intent.setAction(AIDL_NAVIGATE); + intent.putExtra(AIDL_START_NAME, startName); + intent.putExtra(AIDL_START_LAT, startLat); + intent.putExtra(AIDL_START_LON, startLon); + intent.putExtra(AIDL_DEST_NAME, destName); + intent.putExtra(AIDL_DEST_LAT, destLat); + intent.putExtra(AIDL_DEST_LON, destLon); + intent.putExtra(AIDL_PROFILE, profile); + intent.putExtra(AIDL_FORCE, force); + app.sendBroadcast(intent); + return true; + } } diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java index 42307f2625..a37ec32c41 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java @@ -31,6 +31,7 @@ import net.osmand.aidl.mapmarker.UpdateMapMarkerParams; import net.osmand.aidl.mapwidget.AddMapWidgetParams; import net.osmand.aidl.mapwidget.RemoveMapWidgetParams; import net.osmand.aidl.mapwidget.UpdateMapWidgetParams; +import net.osmand.aidl.navigation.NavigateParams; import net.osmand.aidl.note.StartAudioRecordingParams; import net.osmand.aidl.note.StopRecordingParams; import net.osmand.aidl.note.TakePhotoNoteParams; @@ -380,5 +381,14 @@ public class OsmandAidlService extends Service { return false; } } + + @Override + public boolean navigate(NavigateParams params) throws RemoteException { + try { + return params != null && getApi().navigate(params.getStartName(), params.getStartLat(), params.getStartLon(), params.getDestName(), params.getDestLat(), params.getDestLon(), params.getProfile(), params.getForce()); + } catch (Exception e) { + return false; + } + } }; } diff --git a/OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.aidl b/OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.aidl new file mode 100644 index 0000000000..f9b51d7a8c --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable NavigateParams; \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.java b/OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.java new file mode 100644 index 0000000000..6cba5de465 --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.java @@ -0,0 +1,104 @@ +package net.osmand.aidl.navigation; + +import android.os.Parcel; +import android.os.Parcelable; + +public class NavigateParams implements Parcelable { + + private String startName; + private double startLat; + private double startLon; + private String destName; + private double destLat; + private double destLon; + private String profile; + private boolean force; + + public NavigateParams(String startName, double startLat, double startLon, String destName, double destLat, double destLon, String profile, boolean force) { + this.startName = startName; + this.startLat = startLat; + this.startLon = startLon; + this.destName = destName; + this.destLat = destLat; + this.destLon = destLon; + this.profile = profile; + this.force = force; + } + + public NavigateParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public NavigateParams createFromParcel(Parcel in) { + return new NavigateParams(in); + } + + @Override + public NavigateParams[] newArray(int size) { + return new NavigateParams[size]; + } + }; + + public String getStartName() { + return startName; + } + + public double getStartLat() { + return startLat; + } + + public double getStartLon() { + return startLon; + } + + public String getDestName() { + return destName; + } + + public double getDestLat() { + return destLat; + } + + public double getDestLon() { + return destLon; + } + + public String getProfile() { + return profile; + } + + public boolean getForce() { + return force; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(startName); + out.writeDouble(startLat); + out.writeDouble(startLon); + out.writeString(destName); + out.writeDouble(destLat); + out.writeDouble(destLon); + out.writeString(profile); + out.writeByte((byte) (force ? 1 : 0)); + } + + private void readFromParcel(Parcel in) { + startName = in.readString(); + startLat = in.readDouble(); + startLon = in.readDouble(); + destName = in.readString(); + destLat = in.readDouble(); + destLon = in.readDouble(); + profile = in.readString(); + force = in.readByte() != 0; + } + + @Override + public int describeContents() { + return 0; + } + +} From 3cdda4773f84815a5027c981287975571e0826dc Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 1 Sep 2017 12:31:33 +0300 Subject: [PATCH 03/84] Fix taking photo with aidl --- OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 2 +- .../net/osmand/plus/audionotes/AudioVideoNotesPlugin.java | 8 ++++---- .../net/osmand/plus/audionotes/TakePhotoNoteAction.java | 2 +- OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index a30fafa290..407092e37a 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -391,7 +391,7 @@ public class OsmandAidlApi { if (plugin != null) { double lat = intent.getDoubleExtra(AIDL_LATITUDE, Double.NaN); double lon = intent.getDoubleExtra(AIDL_LONGITUDE, Double.NaN); - plugin.takePhoto(lat, lon, mapActivity, false); + plugin.takePhoto(lat, lon, mapActivity, false, true); } } }; diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index ed8850d105..6f645e537d 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -651,7 +651,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { .setListener(new ItemClickListener() { @Override public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int pos, boolean isChecked) { - takePhoto(latitude, longitude, mapActivity, false); + takePhoto(latitude, longitude, mapActivity, false, false); return true; } @@ -771,7 +771,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { if (action == AV_DEFAULT_ACTION_VIDEO) { recordVideo(lat, lon, mapActivity); } else if (action == AV_DEFAULT_ACTION_TAKEPICTURE) { - takePhoto(lat, lon, mapActivity, false); + takePhoto(lat, lon, mapActivity, false, false); } else if (action == AV_DEFAULT_ACTION_AUDIO) { recordAudio(lat, lon, mapActivity); } @@ -1192,10 +1192,10 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { } public void takePhoto(final double lat, final double lon, final MapActivity mapActivity, - final boolean forceInternal) { + final boolean forceInternal, final boolean forceExternal) { if (ActivityCompat.checkSelfPermission(mapActivity, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { - if (!AV_EXTERNAL_PHOTO_CAM.get() || forceInternal) { + if ((!AV_EXTERNAL_PHOTO_CAM.get() || forceInternal) && !forceExternal) { takePhotoInternalOrExternal(lat, lon, mapActivity); } else { takePhotoExternal(lat, lon, mapActivity); diff --git a/OsmAnd/src/net/osmand/plus/audionotes/TakePhotoNoteAction.java b/OsmAnd/src/net/osmand/plus/audionotes/TakePhotoNoteAction.java index 4b56929a2b..69fbbdab57 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/TakePhotoNoteAction.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/TakePhotoNoteAction.java @@ -31,7 +31,7 @@ public class TakePhotoNoteAction extends QuickAction { AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class); if (plugin != null) - plugin.takePhoto(latLon.getLatitude(), latLon.getLongitude(), activity, false); + plugin.takePhoto(latLon.getLatitude(), latLon.getLongitude(), activity, false, false); } @Override diff --git a/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java index 301454a2fb..d5e1475479 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java @@ -287,7 +287,7 @@ public class ExternalApiHelper { } else if (API_CMD_RECORD_VIDEO.equals(cmd)) { plugin.recordVideo(lat, lon, mapActivity); } else if (API_CMD_RECORD_PHOTO.equals(cmd)) { - plugin.takePhoto(lat, lon, mapActivity, true); + plugin.takePhoto(lat, lon, mapActivity, true, false); } } From 656c50be1dd174b35efe1abbfb9906b86e5ff46c Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 1 Sep 2017 12:47:25 +0300 Subject: [PATCH 04/84] Fix video recording with aidl --- OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 2 +- .../net/osmand/plus/audionotes/AudioVideoNotesPlugin.java | 8 ++++---- .../net/osmand/plus/audionotes/TakeVideoNoteAction.java | 2 +- OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index 407092e37a..e2755fbfc8 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -406,7 +406,7 @@ public class OsmandAidlApi { if (plugin != null) { double lat = intent.getDoubleExtra(AIDL_LATITUDE, Double.NaN); double lon = intent.getDoubleExtra(AIDL_LONGITUDE, Double.NaN); - plugin.recordVideo(lat, lon, mapActivity); + plugin.recordVideo(lat, lon, mapActivity, true); } } }; diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index 6f645e537d..2ddb27908a 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -641,7 +641,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { @Override public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int pos, boolean isChecked) { - recordVideo(latitude, longitude, mapActivity); + recordVideo(latitude, longitude, mapActivity, false); return true; } }) @@ -769,7 +769,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { private void takeAction(final MapActivity mapActivity, double lon, double lat, int action) { if (action == AV_DEFAULT_ACTION_VIDEO) { - recordVideo(lat, lon, mapActivity); + recordVideo(lat, lon, mapActivity, false); } else if (action == AV_DEFAULT_ACTION_TAKEPICTURE) { takePhoto(lat, lon, mapActivity, false, false); } else if (action == AV_DEFAULT_ACTION_AUDIO) { @@ -874,8 +874,8 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { } } - public void recordVideo(final double lat, final double lon, final MapActivity mapActivity) { - if (AV_EXTERNAL_RECORDER.get()) { + public void recordVideo(final double lat, final double lon, final MapActivity mapActivity, final boolean forceExternal) { + if (AV_EXTERNAL_RECORDER.get() || forceExternal) { captureVideoExternal(lat, lon, mapActivity); } else { if (ActivityCompat.checkSelfPermission(mapActivity, Manifest.permission.CAMERA) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/TakeVideoNoteAction.java b/OsmAnd/src/net/osmand/plus/audionotes/TakeVideoNoteAction.java index 17e917d74a..32c99cb178 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/TakeVideoNoteAction.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/TakeVideoNoteAction.java @@ -31,7 +31,7 @@ public class TakeVideoNoteAction extends QuickAction { AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class); if (plugin != null) - plugin.recordVideo(latLon.getLatitude(), latLon.getLongitude(), activity); + plugin.recordVideo(latLon.getLatitude(), latLon.getLongitude(), activity, false); } @Override diff --git a/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java index d5e1475479..bc3d21df22 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java @@ -285,7 +285,7 @@ public class ExternalApiHelper { if (API_CMD_RECORD_AUDIO.equals(cmd)) { plugin.recordAudio(lat, lon, mapActivity); } else if (API_CMD_RECORD_VIDEO.equals(cmd)) { - plugin.recordVideo(lat, lon, mapActivity); + plugin.recordVideo(lat, lon, mapActivity, false); } else if (API_CMD_RECORD_PHOTO.equals(cmd)) { plugin.takePhoto(lat, lon, mapActivity, true, false); } From fc3a6b9be48cba68569f92514d65767d76dc967e Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 1 Sep 2017 14:02:15 +0300 Subject: [PATCH 05/84] Add navigate gpx to aidl --- .../net/osmand/aidl/IOsmAndAidlInterface.aidl | 2 + OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 77 +++++++++++++++++++ .../net/osmand/aidl/OsmandAidlService.java | 10 +++ .../aidl/navigation/NavigateGpxParams.aidl | 3 + .../aidl/navigation/NavigateGpxParams.java | 69 +++++++++++++++++ 5 files changed, 161 insertions(+) create mode 100644 OsmAnd/src/net/osmand/aidl/navigation/NavigateGpxParams.aidl create mode 100644 OsmAnd/src/net/osmand/aidl/navigation/NavigateGpxParams.java diff --git a/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl b/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl index bc6ac7d127..78beb7ca96 100644 --- a/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl +++ b/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl @@ -42,6 +42,7 @@ import net.osmand.aidl.maplayer.RemoveMapLayerParams; import net.osmand.aidl.maplayer.UpdateMapLayerParams; import net.osmand.aidl.navigation.NavigateParams; +import net.osmand.aidl.navigation.NavigateGpxParams; import net.osmand.aidl.note.TakePhotoNoteParams; import net.osmand.aidl.note.StartVideoRecordingParams; @@ -95,5 +96,6 @@ interface IOsmAndAidlInterface { boolean stopRecording(in StopRecordingParams params); boolean navigate(in NavigateParams params); + boolean navigateGpx(in NavigateGpxParams params); } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index e2755fbfc8..a53c7d3ca4 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -7,6 +7,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.net.Uri; import android.os.AsyncTask; +import android.os.Build; import android.os.ParcelFileDescriptor; import android.support.v7.app.AlertDialog; import android.view.View; @@ -55,6 +56,7 @@ import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileDescriptor; import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -78,6 +80,8 @@ public class OsmandAidlApi { private static final String AIDL_DEST_LAT = "aidl_dest_lat"; private static final String AIDL_DEST_LON = "aidl_dest_lon"; private static final String AIDL_PROFILE = "aidl_profile"; + private static final String AIDL_DATA = "aidl_data"; + private static final String AIDL_URI = "aidl_uri"; private static final String AIDL_FORCE = "aidl_force"; private static final String AIDL_OBJECT_ID = "aidl_object_id"; @@ -94,6 +98,7 @@ public class OsmandAidlApi { private static final String AIDL_STOP_RECORDING = "aidl_stop_recording"; private static final String AIDL_NAVIGATE = "aidl_navigate"; + private static final String AIDL_NAVIGATE_GPX = "aidl_navigate_gpx"; private static final ApplicationMode DEFAULT_PROFILE = ApplicationMode.CAR; @@ -120,6 +125,7 @@ public class OsmandAidlApi { private BroadcastReceiver startAudioRecordingReceiver; private BroadcastReceiver stopRecordingReceiver; private BroadcastReceiver navigateReceiver; + private BroadcastReceiver navigateGpxReceiver; public OsmandAidlApi(OsmandApplication app) { this.app = app; @@ -137,6 +143,7 @@ public class OsmandAidlApi { registerStartAudioRecordingReceiver(mapActivity); registerStopRecordingReceiver(mapActivity); registerNavigateReceiver(mapActivity); + registerNavigateGpxReceiver(mapActivity); } public void onDestroyMapActivity(final MapActivity mapActivity) { @@ -231,6 +238,14 @@ public class OsmandAidlApi { } navigateReceiver = null; } + if (navigateGpxReceiver != null) { + try { + mapActivity.unregisterReceiver(navigateGpxReceiver); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + navigateGpxReceiver = null; + } } private void registerRefreshMapReceiver(final MapActivity mapActivity) { @@ -503,6 +518,58 @@ public class OsmandAidlApi { mapActivity.registerReceiver(navigateReceiver, new IntentFilter(AIDL_NAVIGATE)); } + private void registerNavigateGpxReceiver(final MapActivity mapActivity) { + navigateGpxReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + boolean force = intent.getBooleanExtra(AIDL_FORCE, false); + + GPXFile gpx = null; + if (intent.getStringExtra(AIDL_DATA) != null) { + String gpxStr = intent.getStringExtra(AIDL_DATA); + if (!Algorithms.isEmpty(gpxStr)) { + gpx = GPXUtilities.loadGPXFile(mapActivity, new ByteArrayInputStream(gpxStr.getBytes())); + } + } else if (intent.getParcelableExtra(AIDL_URI) != null) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + Uri gpxUri = intent.getParcelableExtra(AIDL_URI); + + ParcelFileDescriptor gpxParcelDescriptor = null; + try { + gpxParcelDescriptor = mapActivity.getContentResolver().openFileDescriptor(gpxUri, "r"); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + if (gpxParcelDescriptor != null) { + FileDescriptor fileDescriptor = gpxParcelDescriptor.getFileDescriptor(); + gpx = GPXUtilities.loadGPXFile(mapActivity, new FileInputStream(fileDescriptor)); + } + } + } + + if (gpx != null) { + final RoutingHelper routingHelper = app.getRoutingHelper(); + if (routingHelper.isFollowingMode() && !force) { + final GPXFile gpxFile = gpx; + AlertDialog dlg = mapActivity.getMapActions().stopNavigationActionConfirm(); + dlg.setOnDismissListener(new DialogInterface.OnDismissListener() { + + @Override + public void onDismiss(DialogInterface dialog) { + if (!routingHelper.isFollowingMode()) { + startNavigation(mapActivity, gpxFile, null, null, null, null, null); + } + } + }); + } else { + startNavigation(mapActivity, gpx, null, null, null, null, null); + } + } + } + }; + mapActivity.registerReceiver(navigateGpxReceiver, new IntentFilter(AIDL_NAVIGATE_GPX)); + } + private void startNavigation(MapActivity mapActivity, GPXFile gpx, LatLon from, PointDescription fromDesc, @@ -1144,4 +1211,14 @@ public class OsmandAidlApi { app.sendBroadcast(intent); return true; } + + boolean navigateGpx(String data, Uri uri, boolean force) { + Intent intent = new Intent(); + intent.setAction(AIDL_NAVIGATE_GPX); + intent.putExtra(AIDL_DATA, data); + intent.putExtra(AIDL_URI, uri); + intent.putExtra(AIDL_FORCE, force); + app.sendBroadcast(intent); + return true; + } } diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java index a37ec32c41..a01c4d133d 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java @@ -31,6 +31,7 @@ import net.osmand.aidl.mapmarker.UpdateMapMarkerParams; import net.osmand.aidl.mapwidget.AddMapWidgetParams; import net.osmand.aidl.mapwidget.RemoveMapWidgetParams; import net.osmand.aidl.mapwidget.UpdateMapWidgetParams; +import net.osmand.aidl.navigation.NavigateGpxParams; import net.osmand.aidl.navigation.NavigateParams; import net.osmand.aidl.note.StartAudioRecordingParams; import net.osmand.aidl.note.StopRecordingParams; @@ -390,5 +391,14 @@ public class OsmandAidlService extends Service { return false; } } + + @Override + public boolean navigateGpx(NavigateGpxParams params) throws RemoteException { + try { + return params != null && getApi().navigateGpx(params.getData(), params.getUri(), params.isForce()); + } catch (Exception e) { + return false; + } + } }; } diff --git a/OsmAnd/src/net/osmand/aidl/navigation/NavigateGpxParams.aidl b/OsmAnd/src/net/osmand/aidl/navigation/NavigateGpxParams.aidl new file mode 100644 index 0000000000..dea59ed048 --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/navigation/NavigateGpxParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable NavigateGpxParams; \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/aidl/navigation/NavigateGpxParams.java b/OsmAnd/src/net/osmand/aidl/navigation/NavigateGpxParams.java new file mode 100644 index 0000000000..6e8fb8efe7 --- /dev/null +++ b/OsmAnd/src/net/osmand/aidl/navigation/NavigateGpxParams.java @@ -0,0 +1,69 @@ +package net.osmand.aidl.navigation; + +import android.net.Uri; +import android.os.Parcel; +import android.os.Parcelable; + +public class NavigateGpxParams implements Parcelable { + + private String data; + private Uri uri; + private boolean force; + + public NavigateGpxParams(String data, boolean force) { + this.data = data; + this.force = force; + } + + public NavigateGpxParams(Uri uri, boolean force) { + this.uri = uri; + this.force = force; + } + + public NavigateGpxParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public NavigateGpxParams createFromParcel(Parcel in) { + return new NavigateGpxParams(in); + } + + @Override + public NavigateGpxParams[] newArray(int size) { + return new NavigateGpxParams[size]; + } + }; + + public String getData() { + return data; + } + + public Uri getUri() { + return uri; + } + + public boolean isForce() { + return force; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(data); + out.writeParcelable(uri, flags); + out.writeByte((byte) (force ? 1 : 0)); + } + + private void readFromParcel(Parcel in) { + data = in.readString(); + uri = in.readParcelable(Uri.class.getClassLoader()); + force = in.readByte() != 0; + } + + @Override + public int describeContents() { + return 0; + } + +} From 6af23994b072fcfd792f55fc72df3b1794565a76 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 1 Sep 2017 14:03:16 +0300 Subject: [PATCH 06/84] Fix boolean getter --- OsmAnd/src/net/osmand/aidl/OsmandAidlService.java | 2 +- OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java index a01c4d133d..d7826cdbd0 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java @@ -386,7 +386,7 @@ public class OsmandAidlService extends Service { @Override public boolean navigate(NavigateParams params) throws RemoteException { try { - return params != null && getApi().navigate(params.getStartName(), params.getStartLat(), params.getStartLon(), params.getDestName(), params.getDestLat(), params.getDestLon(), params.getProfile(), params.getForce()); + return params != null && getApi().navigate(params.getStartName(), params.getStartLat(), params.getStartLon(), params.getDestName(), params.getDestLat(), params.getDestLon(), params.getProfile(), params.isForce()); } catch (Exception e) { return false; } diff --git a/OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.java b/OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.java index 6cba5de465..8b0bdeb1eb 100644 --- a/OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.java +++ b/OsmAnd/src/net/osmand/aidl/navigation/NavigateParams.java @@ -69,7 +69,7 @@ public class NavigateParams implements Parcelable { return profile; } - public boolean getForce() { + public boolean isForce() { return force; } From 7bca3f285052a95ab8115123e5dfc963e6837932 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 1 Sep 2017 14:48:42 +0300 Subject: [PATCH 07/84] Add creation date to markers; add color to markers from history --- OsmAnd/res/layout/map_marker_item_new.xml | 3 +- OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 2 +- .../src/net/osmand/plus/MapMarkersHelper.java | 34 ++- .../src/net/osmand/plus/OsmandSettings.java | 275 ++++++++++++++++-- .../adapters/MapMarkersActiveAdapter.java | 2 + .../adapters/MapMarkersHistoryAdapter.java | 2 + 6 files changed, 281 insertions(+), 37 deletions(-) diff --git a/OsmAnd/res/layout/map_marker_item_new.xml b/OsmAnd/res/layout/map_marker_item_new.xml index db101331d0..036c88f58e 100644 --- a/OsmAnd/res/layout/map_marker_item_new.xml +++ b/OsmAnd/res/layout/map_marker_item_new.xml @@ -78,7 +78,8 @@ android:text="•" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_sub_text_size" - android:visibility="gone"/> + android:visibility="gone" + tools:visibility="visible"/> desc = settings.getMapMarkersPointDescriptions(ips.size()); List colors = settings.getMapMarkersColors(ips.size()); List selections = settings.getMapMarkersSelections(ips.size()); + List creationDates = settings.getMapMarkersCreationDates(ips.size()); int colorIndex = 0; for (int i = 0; i < ips.size(); i++) { if (colors.size() > i) { @@ -176,15 +179,21 @@ public class MapMarkersHelper { } MapMarker mapMarker = new MapMarker(ips.get(i), PointDescription.deserializeFromString(desc.get(i), ips.get(i)), colorIndex, - selections.get(i), i); + selections.get(i), creationDates.get(i), i); mapMarkers.add(mapMarker); } ips = settings.getMapMarkersHistoryPoints(); desc = settings.getMapMarkersHistoryPointDescriptions(ips.size()); + colors = settings.getMapMarkersHistoryColors(ips.size()); + creationDates = settings.getMapMarkersHistoryCreationDates(ips.size()); for (int i = 0; i < ips.size(); i++) { + if (colors.size() > i) { + colorIndex = colors.get(i); + } MapMarker mapMarker = new MapMarker(ips.get(i), - PointDescription.deserializeFromString(desc.get(i), ips.get(i)), 0, false, i); + PointDescription.deserializeFromString(desc.get(i), ips.get(i)), + colorIndex, false, creationDates.get(i), i); mapMarker.history = true; mapMarkersHistory.add(mapMarker); } @@ -207,10 +216,10 @@ public class MapMarkersHelper { } if (history) { settings.updateMapMarkerHistory(mapMarker.point.getLatitude(), mapMarker.point.getLongitude(), - mapMarker.pointDescription, mapMarker.colorIndex); + mapMarker.pointDescription, mapMarker.colorIndex, mapMarker.creationDate); } else { settings.updateMapMarker(mapMarker.point.getLatitude(), mapMarker.point.getLongitude(), - mapMarker.pointDescription, mapMarker.colorIndex, mapMarker.selected); + mapMarker.pointDescription, mapMarker.colorIndex, mapMarker.selected, mapMarker.creationDate); } updateMarker(mapMarker); } @@ -376,7 +385,7 @@ public class MapMarkersHelper { public void updateMapMarker(MapMarker marker, boolean refresh) { if (marker != null) { settings.updateMapMarker(marker.getLatitude(), marker.getLongitude(), - marker.pointDescription, marker.colorIndex, marker.selected); + marker.pointDescription, marker.colorIndex, marker.selected, marker.creationDate); if (refresh) { readFromSettings(); refresh(); @@ -387,7 +396,7 @@ public class MapMarkersHelper { public void moveMapMarker(@Nullable MapMarker marker, LatLon latLon) { if (marker != null) { settings.moveMapMarker(new LatLon(marker.getLatitude(), marker.getLongitude()), latLon, - marker.pointDescription, marker.colorIndex, marker.selected); + marker.pointDescription, marker.colorIndex, marker.selected, marker.creationDate); marker.point = new LatLon(latLon.getLatitude(), latLon.getLongitude()); readFromSettings(); refresh(); @@ -404,7 +413,8 @@ public class MapMarkersHelper { public void addMapMarkerHistory(MapMarker marker) { if (marker != null) { - settings.insertMapMarkerHistory(marker.getLatitude(), marker.getLongitude(), marker.pointDescription, marker.colorIndex, 0); + settings.insertMapMarkerHistory(marker.getLatitude(), marker.getLongitude(), + marker.pointDescription, marker.colorIndex, marker.creationDate, 0); readFromSettings(); refresh(); } @@ -424,25 +434,29 @@ public class MapMarkersHelper { List names = new ArrayList<>(markers.size()); List colors = new ArrayList<>(markers.size()); List selections = new ArrayList<>(markers.size()); + List creationDates = new ArrayList<>(markers.size()); for (MapMarker marker : markers) { ls.add(marker.point); names.add(PointDescription.serializeToString(marker.pointDescription)); colors.add(marker.colorIndex); selections.add(marker.selected); + creationDates.add(marker.creationDate); } - settings.saveMapMarkers(ls, names, colors, selections); + settings.saveMapMarkers(ls, names, colors, selections, creationDates); } if (markersHistory != null) { List ls = new ArrayList<>(markersHistory.size()); List names = new ArrayList<>(markersHistory.size()); List colors = new ArrayList<>(markersHistory.size()); + List creationDates = new ArrayList<>(markersHistory.size()); for (MapMarker marker : markersHistory) { ls.add(marker.point); names.add(PointDescription.serializeToString(marker.pointDescription)); colors.add(marker.colorIndex); + creationDates.add(marker.creationDate); } - settings.saveMapMarkersHistory(ls, names, colors); + settings.saveMapMarkersHistory(ls, names, colors, creationDates); } if (markers != null || markersHistory != null) { diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 8dcec70c60..6d98bfb771 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1783,8 +1783,11 @@ public class OsmandSettings { public final static String MAP_MARKERS_COLOR = "map_markers_color"; //$NON-NLS-1$ public final static String MAP_MARKERS_DESCRIPTION = "map_markers_description"; //$NON-NLS-1$ public final static String MAP_MARKERS_SELECTION = "map_markers_selection"; //$NON-NLS-1$ + public final static String MAP_MARKERS_CREATION_DATE = "map_markers_creation_date"; //$NON-NLS-1$ public final static String MAP_MARKERS_HISTORY_POINT = "map_markers_history_point"; //$NON-NLS-1$ + public final static String MAP_MARKERS_HISTORY_COLOR = "map_markers_history_color"; //$NON-NLS-1$ public final static String MAP_MARKERS_HISTORY_DESCRIPTION = "map_markers_history_description"; //$NON-NLS-1$ + public final static String MAP_MARKERS_HISTORY_CREATION_DATE = "map_markers_history_creation_date"; //$NON-NLS-1$ public final static int MAP_MARKERS_HISTORY_LIMIT = 30; private MapMarkersStorage mapMarkersStorage = new MapMarkersStorage(); private MapMarkersHistoryStorage mapMarkersHistoryStorage = new MapMarkersHistoryStorage(); @@ -1896,6 +1899,7 @@ public class OsmandSettings { .remove(MAP_MARKERS_DESCRIPTION) .remove(MAP_MARKERS_COLOR) .remove(MAP_MARKERS_SELECTION) + .remove(MAP_MARKERS_CREATION_DATE) .commit(); } @@ -1903,6 +1907,8 @@ public class OsmandSettings { return settingsAPI.edit(globalPreferences) .remove(MAP_MARKERS_HISTORY_POINT) .remove(MAP_MARKERS_HISTORY_DESCRIPTION) + .remove(MAP_MARKERS_HISTORY_COLOR) + .remove(MAP_MARKERS_HISTORY_CREATION_DATE) .commit(); } @@ -1927,18 +1933,175 @@ public class OsmandSettings { private class MapMarkersHistoryStorage extends MapPointsStorage { + protected String colorsKey; + protected String creationDatesKey; + public MapMarkersHistoryStorage() { pointsKey = MAP_MARKERS_HISTORY_POINT; descriptionsKey = MAP_MARKERS_HISTORY_DESCRIPTION; + colorsKey = MAP_MARKERS_HISTORY_COLOR; + creationDatesKey = MAP_MARKERS_HISTORY_CREATION_DATE; + } + + public List getColors(int sz) { + List list = new ArrayList<>(); + String ip = settingsAPI.getString(globalPreferences, colorsKey, ""); + if (ip.trim().length() > 0) { + StringTokenizer tok = new StringTokenizer(ip, ","); + while (tok.hasMoreTokens()) { + String colorStr = tok.nextToken(); + list.add(Integer.parseInt(colorStr)); + } + } + while (list.size() > sz) { + list.remove(list.size() - 1); + } + int i = 0; + while (list.size() < sz) { + list.add(i % MapMarkersHelper.MAP_MARKERS_COLORS_COUNT); + i++; + } + return list; + } + + public List getCreationDates(int sz) { + List list = new ArrayList<>(); + String ip = settingsAPI.getString(globalPreferences, creationDatesKey, ""); + if (ip.trim().length() > 0) { + StringTokenizer tok = new StringTokenizer(ip, ","); + while (tok.hasMoreTokens()) { + String creationDateStr = tok.nextToken(); + list.add(Long.parseLong(creationDateStr)); + } + } + while (list.size() > sz) { + list.remove(list.size() - 1); + } + while (list.size() < sz) { + list.add(0L); + } + return list; + } + + public boolean savePoints(List ps, List ds, List cs, List cds) { + while (ps.size() > MAP_MARKERS_HISTORY_LIMIT) { + ps.remove(ps.size() - 1); + ds.remove(ds.size() - 1); + cs.remove(cs.size() - 1); + cds.remove(cds.size() - 1); + } + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < ps.size(); i++) { + if (i > 0) { + sb.append(","); + } + sb.append(((float) ps.get(i).getLatitude() + "")).append(",").append(((float) ps.get(i).getLongitude() + "")); + } + StringBuilder tb = new StringBuilder(); + for (int i = 0; i < ds.size(); i++) { + if (i > 0) { + tb.append("--"); + } + if (ds.get(i) == null) { + tb.append(""); + } else { + tb.append(ds.get(i)); + } + } + StringBuilder cb = new StringBuilder(); + for (int i = 0; i < cs.size(); i++) { + if (i > 0) { + cb.append(","); + } + cb.append(Integer.toString(cs.get(i))); + } + StringBuilder cdb = new StringBuilder(); + if (cds != null) { + for (int i = 0; i < cds.size(); i++) { + if (i > 0) { + cdb.append(","); + } + cdb.append(Long.toString(cds.get(i))); + } + } + return settingsAPI.edit(globalPreferences) + .putString(pointsKey, sb.toString()) + .putString(descriptionsKey, tb.toString()) + .putString(colorsKey, cb.toString()) + .putString(creationDatesKey, cdb.toString()) + .commit(); + } + + public boolean insertPoint(double latitude, double longitude, + PointDescription historyDescription, int colorIndex, + long creationDate, int index) { + List ps = getPoints(); + List ds = getPointDescriptions(ps.size()); + List cs = getColors(ps.size()); + List cds = getCreationDates(ps.size()); + ps.add(index, new LatLon(latitude, longitude)); + ds.add(index, PointDescription.serializeToString(historyDescription)); + cs.add(index, colorIndex); + cds.add(index, creationDate); + if (historyDescription != null && !historyDescription.isSearchingAddress(ctx)) { + SearchHistoryHelper.getInstance(ctx).addNewItemToHistory(latitude, longitude, historyDescription); + } + return savePoints(ps, ds, cs, cds); + } + + public boolean updatePoint(double latitude, double longitude, + PointDescription historyDescription, int colorIndex, + long creationDate) { + List ps = getPoints(); + List ds = getPointDescriptions(ps.size()); + List cs = getColors(ps.size()); + List cds = getCreationDates(ps.size()); + int index = ps.indexOf(new LatLon(latitude, longitude)); + if (index != -1) { + ds.set(index, PointDescription.serializeToString(historyDescription)); + if (cs.size() > index) { + cs.set(index, colorIndex); + } + if (cds.size() > index) { + cds.set(index, creationDate); + } + if (historyDescription != null && !historyDescription.isSearchingAddress(ctx)) { + SearchHistoryHelper.getInstance(ctx).addNewItemToHistory(latitude, longitude, historyDescription); + } + return savePoints(ps, ds, cs, cds); + } else { + return false; + } + } + + @Override + public boolean deletePoint(int index) { + List ps = getPoints(); + List ds = getPointDescriptions(ps.size()); + List cs = getColors(ps.size()); + List cds = getCreationDates(ps.size()); + ps.remove(index); + ds.remove(index); + cds.remove(index); + if (cs.size() > index) { + cs.remove(index); + } + return savePoints(ps, ds, cs, cds); } @Override public boolean savePoints(List ps, List ds) { - while (ps.size() > MAP_MARKERS_HISTORY_LIMIT) { - ps.remove(ps.size() - 1); - ds.remove(ds.size() - 1); - } - return super.savePoints(ps, ds); + return false; + } + + @Override + public boolean insertPoint(double latitude, double longitude, PointDescription historyDescription, int index) { + return false; + } + + @Override + public boolean updatePoint(double latitude, double longitude, PointDescription historyDescription) { + return false; } } @@ -1946,12 +2109,14 @@ public class OsmandSettings { protected String colorsKey; protected String selectionKey; + protected String creationDatesKey; public MapMarkersStorage() { pointsKey = MAP_MARKERS_POINT; descriptionsKey = MAP_MARKERS_DESCRIPTION; colorsKey = MAP_MARKERS_COLOR; selectionKey = MAP_MARKERS_SELECTION; + creationDatesKey = MAP_MARKERS_CREATION_DATE; } public List getColors(int sz) { @@ -1994,6 +2159,25 @@ public class OsmandSettings { return list; } + public List getCreationDates(int sz) { + List list = new ArrayList<>(); + String ip = settingsAPI.getString(globalPreferences, creationDatesKey, ""); + if (ip.trim().length() > 0) { + StringTokenizer tok = new StringTokenizer(ip, ","); + while (tok.hasMoreTokens()) { + String creationDateStr = tok.nextToken(); + list.add(Long.parseLong(creationDateStr)); + } + } + while (list.size() > sz) { + list.remove(list.size() - 1); + } + while (list.size() < sz) { + list.add(0L); + } + return list; + } + public boolean insertPoint(double latitude, double longitude, PointDescription historyDescription, int colorIndex, int pos, boolean selected, int index) { @@ -2001,14 +2185,16 @@ public class OsmandSettings { List ds = getPointDescriptions(ps.size()); List cs = getColors(ps.size()); List bs = getSelections(ps.size()); + List cds = getCreationDates(ps.size()); ps.add(index, new LatLon(latitude, longitude)); ds.add(index, PointDescription.serializeToString(historyDescription)); cs.add(index, colorIndex); bs.add(index, selected); + cds.add(index, System.currentTimeMillis()); if (historyDescription != null && !historyDescription.isSearchingAddress(ctx)) { SearchHistoryHelper.getInstance(ctx).addNewItemToHistory(latitude, longitude, historyDescription); } - return savePoints(ps, ds, cs, bs); + return savePoints(ps, ds, cs, bs, cds); } public boolean insertPoints(double[] latitudes, double[] longitudes, @@ -2018,6 +2204,7 @@ public class OsmandSettings { List ds = getPointDescriptions(ps.size()); List cs = getColors(ps.size()); List bs = getSelections(ps.size()); + List cds = getCreationDates(ps.size()); for (int i = 0; i < latitudes.length; i++) { double latitude = latitudes[i]; double longitude = longitudes[i]; @@ -2029,20 +2216,22 @@ public class OsmandSettings { ds.add(index, PointDescription.serializeToString(historyDescription)); cs.add(index, colorIndex); bs.add(index, selected); + cds.add(index, System.currentTimeMillis()); if (historyDescription != null && !historyDescription.isSearchingAddress(ctx)) { SearchHistoryHelper.getInstance(ctx).addNewItemToHistory(latitude, longitude, historyDescription); } } - return savePoints(ps, ds, cs, bs); + return savePoints(ps, ds, cs, bs, cds); } public boolean updatePoint(double latitude, double longitude, PointDescription historyDescription, int colorIndex, - boolean selected) { + boolean selected, long creationDate) { List ps = getPoints(); List ds = getPointDescriptions(ps.size()); List cs = getColors(ps.size()); List bs = getSelections(ps.size()); + List cds = getCreationDates(ps.size()); int index = ps.indexOf(new LatLon(latitude, longitude)); if (index != -1) { ds.set(index, PointDescription.serializeToString(historyDescription)); @@ -2052,10 +2241,13 @@ public class OsmandSettings { if (bs.size() > index) { bs.set(index, selected); } + if (cds.size() > index) { + cds.set(index, creationDate); + } if (historyDescription != null && !historyDescription.isSearchingAddress(ctx)) { SearchHistoryHelper.getInstance(ctx).addNewItemToHistory(latitude, longitude, historyDescription); } - return savePoints(ps, ds, cs, bs); + return savePoints(ps, ds, cs, bs, cds); } else { return false; } @@ -2065,11 +2257,13 @@ public class OsmandSettings { LatLon latLonNew, PointDescription historyDescription, int colorIndex, - boolean selected) { + boolean selected, + long creationDate) { List ps = getPoints(); List ds = getPointDescriptions(ps.size()); List cs = getColors(ps.size()); List bs = getSelections(ps.size()); + List cds = getCreationDates(ps.size()); int index = ps.indexOf(latLonEx); if (index != -1) { if (ps.size() > index) { @@ -2082,12 +2276,15 @@ public class OsmandSettings { if (bs.size() > index) { bs.set(index, selected); } + if (cds.size() > index) { + cds.set(index, creationDate); + } if (historyDescription != null && !historyDescription.isSearchingAddress(ctx)) { double lat = latLonNew.getLatitude(); double lon = latLonNew.getLongitude(); SearchHistoryHelper.getInstance(ctx).addNewItemToHistory(lat, lon, historyDescription); } - return savePoints(ps, ds, cs, bs); + return savePoints(ps, ds, cs, bs, cds); } else { return false; } @@ -2099,19 +2296,21 @@ public class OsmandSettings { List ds = getPointDescriptions(ps.size()); List cs = getColors(ps.size()); List bs = getSelections(ps.size()); + List cds = getCreationDates(ps.size()); ps.remove(index); ds.remove(index); + cds.remove(index); if (cs.size() > index) { cs.remove(index); } if (bs.size() > index) { bs.remove(index); } - return savePoints(ps, ds, cs, bs); + return savePoints(ps, ds, cs, bs, cds); } public boolean savePoints(List ps, List ds, List cs, - List bs) { + List bs, List cds) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < ps.size(); i++) { if (i > 0) { @@ -2146,11 +2345,21 @@ public class OsmandSettings { bb.append(Boolean.toString(bs.get(i))); } } + StringBuilder cdb = new StringBuilder(); + if (cds != null) { + for (int i = 0; i < cds.size(); i++) { + if (i > 0) { + cdb.append(","); + } + cdb.append(Long.toString(cds.get(i))); + } + } return settingsAPI.edit(globalPreferences) .putString(pointsKey, sb.toString()) .putString(descriptionsKey, tb.toString()) .putString(colorsKey, cb.toString()) .putString(selectionKey, bb.toString()) + .putString(creationDatesKey, cdb.toString()) .commit(); } @@ -2344,6 +2553,10 @@ public class OsmandSettings { return mapMarkersStorage.getSelections(sz); } + public List getMapMarkersCreationDates(int sz) { + return mapMarkersStorage.getCreationDates(sz); + } + public List getMapMarkersPoints() { return mapMarkersStorage.getPoints(); } @@ -2363,24 +2576,27 @@ public class OsmandSettings { } public boolean updateMapMarker(double latitude, double longitude, - PointDescription historyDescription, int colorIndex, boolean selected) { - return mapMarkersStorage.updatePoint(latitude, longitude, historyDescription, colorIndex, selected); + PointDescription historyDescription, int colorIndex, boolean selected, + long creationDate) { + return mapMarkersStorage.updatePoint(latitude, longitude, historyDescription, colorIndex, selected, creationDate); } public boolean moveMapMarker(LatLon latLonEx, LatLon latLonNew, PointDescription historyDescription, int colorIndex, - boolean selected) { - return mapMarkersStorage.movePoint(latLonEx, latLonNew, historyDescription, colorIndex, selected); + boolean selected, + long creationDate) { + return mapMarkersStorage.movePoint(latLonEx, latLonNew, historyDescription, colorIndex, selected, creationDate); } public boolean deleteMapMarker(int index) { return mapMarkersStorage.deletePoint(index); } - public boolean saveMapMarkers(List ps, List ds, List cs, List bs) { - return mapMarkersStorage.savePoints(ps, ds, cs, bs); + public boolean saveMapMarkers(List ps, List ds, List cs, List bs, + List cds) { + return mapMarkersStorage.savePoints(ps, ds, cs, bs, cds); } @@ -2392,22 +2608,31 @@ public class OsmandSettings { return mapMarkersHistoryStorage.getPoints(); } + public List getMapMarkersHistoryCreationDates(int sz) { + return mapMarkersHistoryStorage.getCreationDates(sz); + } + + public List getMapMarkersHistoryColors(int sz) { + return mapMarkersHistoryStorage.getColors(sz); + } + public boolean insertMapMarkerHistory(double latitude, double longitude, - PointDescription historyDescription, int colorIndex, int index) { - return mapMarkersHistoryStorage.insertPoint(latitude, longitude, historyDescription, index); + PointDescription historyDescription, int colorIndex, + long creationDate, int index) { + return mapMarkersHistoryStorage.insertPoint(latitude, longitude, historyDescription, colorIndex, creationDate, index); } public boolean updateMapMarkerHistory(double latitude, double longitude, - PointDescription historyDescription, int colorIndex) { - return mapMarkersHistoryStorage.updatePoint(latitude, longitude, historyDescription); + PointDescription historyDescription, int colorIndex, long creationDate) { + return mapMarkersHistoryStorage.updatePoint(latitude, longitude, historyDescription, colorIndex, creationDate); } public boolean deleteMapMarkerHistory(int index) { return mapMarkersHistoryStorage.deletePoint(index); } - public boolean saveMapMarkersHistory(List ps, List ds, List cs) { - return mapMarkersHistoryStorage.savePoints(ps, ds); + public boolean saveMapMarkersHistory(List ps, List ds, List cs, List cds) { + return mapMarkersHistoryStorage.savePoints(ps, ds, cs, cds); } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java index 83014d6132..8888476f7f 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java @@ -87,6 +87,8 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter Date: Fri, 1 Sep 2017 17:07:52 +0300 Subject: [PATCH 08/84] Add possibility to move marker to history; add small changes --- OsmAnd/res/layout/map_marker_item_new.xml | 8 ++++---- .../plus/mapmarkers/MapMarkersActiveFragment.java | 6 ++++++ .../plus/mapmarkers/MapMarkersDialogFragment.java | 6 ++++++ .../plus/mapmarkers/MapMarkersHistoryFragment.java | 11 ++++++++++- .../mapmarkers/adapters/MapMarkerItemViewHolder.java | 4 ++-- .../mapmarkers/adapters/MapMarkersActiveAdapter.java | 12 ++++++++++++ .../adapters/MapMarkersHistoryAdapter.java | 2 -- 7 files changed, 40 insertions(+), 9 deletions(-) diff --git a/OsmAnd/res/layout/map_marker_item_new.xml b/OsmAnd/res/layout/map_marker_item_new.xml index 036c88f58e..7ae162e70d 100644 --- a/OsmAnd/res/layout/map_marker_item_new.xml +++ b/OsmAnd/res/layout/map_marker_item_new.xml @@ -102,12 +102,12 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" - android:layout_marginBottom="16dp" - android:layout_marginLeft="14dp" - android:layout_marginRight="14dp" - android:layout_marginTop="16dp" android:background="?attr/selectableItemBackground" android:focusableInTouchMode="true" + android:paddingBottom="16dp" + android:paddingLeft="14dp" + android:paddingRight="14dp" + android:paddingTop="16dp" tools:src="@drawable/ic_overflow_menu_white"/> diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java index e6cb7502e1..3b2fb3d96d 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java @@ -121,6 +121,12 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL return null; } + void updateAdapter() { + if (adapter != null) { + adapter.notifyDataSetChanged(); + } + } + private void updateLocationUi() { final MapActivity mapActivity = (MapActivity) getActivity(); if (mapActivity != null) { diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java index 0bdc11b5fb..99c05a9550 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java @@ -78,11 +78,17 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm switch (menuItem.getItemId()) { case R.id.action_active: ((MapMarkersActiveFragment) adapter.getItem(0)).startLocationUpdate(); + if (viewPager.getCurrentItem() != 0) { + ((MapMarkersActiveFragment) adapter.getItem(0)).updateAdapter(); + } viewPager.setCurrentItem(0); optionsButton.setVisibility(View.VISIBLE); return true; case R.id.action_history: ((MapMarkersActiveFragment) adapter.getItem(0)).stopLocationUpdate(); + if (viewPager.getCurrentItem() != 1) { + ((MapMarkersHistoryFragment) adapter.getItem(1)).updateAdapter(); + } viewPager.setCurrentItem(1); optionsButton.setVisibility(View.GONE); return true; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java index b84d42ba86..cb81e08396 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java @@ -14,6 +14,8 @@ import net.osmand.plus.mapmarkers.adapters.MapMarkersHistoryAdapter; public class MapMarkersHistoryFragment extends Fragment { + MapMarkersHistoryAdapter adapter; + @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { @@ -21,8 +23,15 @@ public class MapMarkersHistoryFragment extends Fragment { recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); final MapActivity mapActivity = (MapActivity) getActivity(); - recyclerView.setAdapter(new MapMarkersHistoryAdapter(mapActivity.getMyApplication())); + adapter = new MapMarkersHistoryAdapter(mapActivity.getMyApplication()); + recyclerView.setAdapter(adapter); return recyclerView; } + + void updateAdapter() { + if (adapter != null) { + adapter.notifyDataSetChanged(); + } + } } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java index 8775a599f9..d3042e2090 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java @@ -17,7 +17,7 @@ public class MapMarkerItemViewHolder extends RecyclerView.ViewHolder { final TextView distance; final TextView point; final TextView description; - final ImageButton options; + final ImageButton optionsBtn; public MapMarkerItemViewHolder(View view) { super(view); @@ -28,6 +28,6 @@ public class MapMarkerItemViewHolder extends RecyclerView.ViewHolder { distance = (TextView) view.findViewById(R.id.map_marker_distance); point = (TextView) view.findViewById(R.id.map_marker_point_text_view); description = (TextView) view.findViewById(R.id.map_marker_description); - options = (ImageButton) view.findViewById(R.id.map_marker_options_button); + optionsBtn = (ImageButton) view.findViewById(R.id.map_marker_options_button); } } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java index 8888476f7f..bf8e7d3f76 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java @@ -89,6 +89,18 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter Date: Fri, 1 Sep 2017 17:33:23 +0300 Subject: [PATCH 09/84] Show marker on map after click on history map markers list item --- .../mapmarkers/MapMarkersHistoryFragment.java | 15 ++++++++++++++ .../adapters/MapMarkersHistoryAdapter.java | 20 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java index cb81e08396..f5ef8026e3 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java @@ -2,6 +2,7 @@ package net.osmand.plus.mapmarkers; import android.os.Bundle; import android.support.annotation.Nullable; +import android.support.v4.app.DialogFragment; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; @@ -9,6 +10,8 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import net.osmand.data.PointDescription; +import net.osmand.plus.MapMarkersHelper.MapMarker; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.mapmarkers.adapters.MapMarkersHistoryAdapter; @@ -24,6 +27,18 @@ public class MapMarkersHistoryFragment extends Fragment { final MapActivity mapActivity = (MapActivity) getActivity(); adapter = new MapMarkersHistoryAdapter(mapActivity.getMyApplication()); + adapter.setAdapterListener(new MapMarkersHistoryAdapter.MapMarkersHistoryAdapterListener() { + @Override + public void onItemClick(View view) { + int pos = recyclerView.indexOfChild(view); + MapMarker marker = adapter.getItem(pos); + mapActivity.getMyApplication().getSettings().setMapLocationToShow(marker.getLatitude(), marker.getLongitude(), + 15, new PointDescription(PointDescription.POINT_TYPE_LOCATION, marker.getPointDescription(mapActivity).getName()), + false, null); + MapActivity.launchMapActivityMoveToTop(mapActivity); + ((DialogFragment) getParentFragment()).dismiss(); + } + }); recyclerView.setAdapter(adapter); return recyclerView; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java index ee9b3bdd86..2a0f8816d1 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java @@ -16,15 +16,26 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter markers; + private MapMarkersHistoryAdapterListener listener; public MapMarkersHistoryAdapter(OsmandApplication app) { this.app = app; markers = app.getMapMarkersHelper().getMapMarkersHistory(); } + public void setAdapterListener(MapMarkersHistoryAdapterListener listener) { + this.listener = listener; + } + @Override public MapMarkerItemViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.map_marker_item_new, viewGroup, false); + view.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + listener.onItemClick(view); + } + }); return new MapMarkerItemViewHolder(view); } @@ -45,4 +56,13 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter Date: Fri, 1 Sep 2017 18:23:56 +0300 Subject: [PATCH 10/84] Add possibility to restore marker from history --- OsmAnd/src/net/osmand/plus/MapMarkersHelper.java | 6 ++++++ OsmAnd/src/net/osmand/plus/OsmandSettings.java | 12 ++++++------ .../adapters/MapMarkersHistoryAdapter.java | 14 +++++++++++++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java index 25632fd823..ff4fab8f71 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java @@ -321,6 +321,12 @@ public class MapMarkersHelper { refresh(); } + public void addMapMarker(MapMarker marker) { + settings.insertMapMarker(marker.getLatitude(), marker.getLongitude(), marker.pointDescription, + marker.colorIndex, marker.selected, marker.creationDate, 0); + readFromSettings(); + } + public void addMapMarker(LatLon point, PointDescription historyName) { List points = new ArrayList<>(1); List historyNames = new ArrayList<>(1); diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 6d98bfb771..f2f6b625a2 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -2179,8 +2179,8 @@ public class OsmandSettings { } public boolean insertPoint(double latitude, double longitude, - PointDescription historyDescription, int colorIndex, int pos, - boolean selected, int index) { + PointDescription historyDescription, int colorIndex, + boolean selected, long creationDate, int index) { List ps = getPoints(); List ds = getPointDescriptions(ps.size()); List cs = getColors(ps.size()); @@ -2190,7 +2190,7 @@ public class OsmandSettings { ds.add(index, PointDescription.serializeToString(historyDescription)); cs.add(index, colorIndex); bs.add(index, selected); - cds.add(index, System.currentTimeMillis()); + cds.add(index, creationDate == 0 ? System.currentTimeMillis() : creationDate); if (historyDescription != null && !historyDescription.isSearchingAddress(ctx)) { SearchHistoryHelper.getInstance(ctx).addNewItemToHistory(latitude, longitude, historyDescription); } @@ -2562,10 +2562,10 @@ public class OsmandSettings { } public boolean insertMapMarker(double latitude, double longitude, - PointDescription historyDescription, int colorIndex, int pos, - boolean selected, int index) { + PointDescription historyDescription, int colorIndex, + boolean selected, long creationDate, int index) { return mapMarkersStorage.insertPoint(latitude, longitude, historyDescription, colorIndex, - index, selected, pos); + selected, creationDate, index); } public boolean insertMapMarkers(double[] latitudes, double[] longitudes, diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java index 2a0f8816d1..90b1a4abb4 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java @@ -40,7 +40,7 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter Date: Fri, 1 Sep 2017 19:05:48 +0300 Subject: [PATCH 11/84] Undo for removing active marker in progress --- OsmAnd/src/net/osmand/plus/MapMarkersHelper.java | 4 ++-- .../adapters/MapMarkersActiveAdapter.java | 16 ++++++++++++++-- .../adapters/MapMarkersHistoryAdapter.java | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java index ff4fab8f71..5b58d6e20e 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java @@ -321,9 +321,9 @@ public class MapMarkersHelper { refresh(); } - public void addMapMarker(MapMarker marker) { + public void addMapMarker(MapMarker marker, int index) { settings.insertMapMarker(marker.getLatitude(), marker.getLongitude(), marker.pointDescription, - marker.colorIndex, marker.selected, marker.creationDate, 0); + marker.colorIndex, marker.selected, marker.creationDate, index); readFromSettings(); } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java index bf8e7d3f76..972996a1b1 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java @@ -1,5 +1,6 @@ package net.osmand.plus.mapmarkers.adapters; +import android.support.design.widget.Snackbar; import android.support.v4.view.MotionEventCompat; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -93,8 +94,19 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter Date: Thu, 31 Aug 2017 15:48:58 +0000 Subject: [PATCH 12/84] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (2402 of 2402 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index eb8c1940e7..0a4c9c4c4c 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -2649,7 +2649,7 @@ OsmAnd (Automated Navigation Directions) 是一個地圖和導航的應用程式 停車選項 不要傳送匿名應用程式使用方式統計 不要在啟動時顯示訊息 - 隱匿顯示應用程式折扣和專用的在地事件訊息 + 封鎖顯示應用程式折扣和專用的在地事件訊息 OsmAnd 收集您開了應用程式哪些部件的資訊。絕不會傳送您所在的位置,也沒有您向應用程式輸入的任何內容或您所查看區域的詳細資料、搜尋或下載。 選擇街道 在 %1$s From d6b2f891da6527e88016aaa8e912cd5c3c295fd8 Mon Sep 17 00:00:00 2001 From: Verdulo Date: Thu, 31 Aug 2017 21:08:06 +0000 Subject: [PATCH 13/84] Translated using Weblate (Esperanto) Currently translated at 100.0% (2402 of 2402 strings) --- OsmAnd/res/values-eo/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index c628d5b598..2d989fae2b 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -2772,5 +2772,5 @@ Indikas lokon: %1$s x %2$s" Daŭre montri sur mapo Ĉu eliri sen konservi? Ne uzi movbildojn - Malaktivigi animaciojn en aplikaĵo + Malaktivigi animaciojn en la aplikaĵo From 3a4b8a98d2fd30b2f3f4639714b8a6866e24c087 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Thu, 31 Aug 2017 22:22:12 +0000 Subject: [PATCH 14/84] Translated using Weblate (French) Currently translated at 99.5% (2391 of 2402 strings) --- OsmAnd/res/values-fr/strings.xml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 595c84d8a6..4036a24360 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -685,7 +685,7 @@ Au-delà la navigation bascule automatiquement sur le service en ligne CloudMade Ce greffon permet d\'accéder à une grand nombre de cartes en ligne (aussi appelées tuiles ou cartes raster) qui vont de cartes OpenStreetMap (comme Mapnik) jusqu\'aux images satellites en passant par des cartes spécialisées comme des cartes météo, des cartes de climat, des cartes géologiques, des couches de relief, etc. \n -\nChacune de ces cartes est utilisable soit comme carte principale soit comme sur-couche ou sous-couche d\'une autre carte. Afin de gérer au mieux la superposition des cartes, vous pouvez masquer certains éléments des cartes vectorielles hors ligne depuis le menu \"Configurer la carte\". +\nChacune de ces cartes est utilisable, comme carte principale, sur-couche ou sous-couche d\'une autre carte. Afin de gérer au mieux la superposition des cartes, vous pouvez masquer certains éléments des cartes vectorielles hors ligne depuis le menu \"Configurer la carte\". \n \nLes cartes tuiles peuvent être obtenues directement en ligne ou peuvent être préparées pour un usage hors ligne grâce à des outils tiers puis copiées dans le dossier de données d\'OsmAnd sous forme de base de données SQLite. Affiche les préférences afin d\'activer le suivi et la navigation en tâche de fond (écran éteint) en réveillant périodiquement le GPS. @@ -1128,10 +1128,10 @@ Fonctionnalités principales : Sauvegarder comme une modification OSM Supprimer le point de mesure Point - * Appui bref sur la carte pour ajouter un point. -\n* Appui long sur la carte pour supprimer le point précédent. -\n* Appui long sur un point pour ajouter ou modifier une description. -\n* Appui sur le gadget de mesure pour voir plus d\'actions. + * Ajouter un point : appui bref sur la carte +\n* Supprimer le dernier point : appui long sur la carte +\n* Ajouter ou modifier la description d\'un point : appui long sur le point +\n* Autres actions : utilisez le gadget de mesure. Ajouter une nouvelle mesure Supprimer la mesure Téléchargement en cours @@ -1479,7 +1479,7 @@ Fonctionnalités principales : Trier par distance Trier par nom Aucun téléchargement trouvé, veuillez vérifier votre connexion Internet. - Aucun fichier GPX sélectionné. Pour sélectionner, presser longuement sur une trace disponible. + Aucun fichier GPX sélectionné. Pour sélectionner un fichier, pressez longuement sur une trace disponible. Sélectionnez pour afficher - Créez un groupe : donnez-lui un nom et indiquez une description @@ -2884,5 +2884,10 @@ Fonctionnalités principales : Quitter sans enregistrer ? Ne pas utiliser les animations Désactive les animations dans l\'application - Marche, randonnée, visite de la ville • La carte vous montre les sentiers pédestres et de randonnée • Wikipedia dans votre langue préférée peut vous en apprendre beaucoup durant votre visite de la ville • Arrêts de transport public (bus, tram, train), incluant les noms de lignes, aidant la navigation dans une nouvelle ville • La navigation GPS en mode piéton utilise les chemins piétons • Vous pouvez uploader et suivre une route GPX, enregistrer ou partager la vôtre + Marche, randonnée, visite guidée +\n• Carte des sentiers pédestres et de randonnée +\n• Articles Wikipedia dans la langue de votre choix pour découvrir les lieux visités +\n• Arrêts de transports publics (bus, tram, train), incluant les noms de lignes, pour vous aider dans vos déplacements en ville +\n• Guidage de navigation piéton en suivant les itinéraires piétons +\n• Vous pouvez charger et suivre une trace GPX existante; enregistrer et partager un nouvel itinéraire GPX From 5d983f05bcaf7911f73a2fe576522f2eac2ab15f Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Fri, 1 Sep 2017 05:41:22 +0000 Subject: [PATCH 15/84] Translated using Weblate (Italian) Currently translated at 98.4% (2365 of 2402 strings) --- OsmAnd/res/values-it/strings.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index 01c83be71d..489a056ea1 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -2689,7 +2689,7 @@ Rappresenta l\'area: %1$s x %2$s Non inviare statistiche anonime sull\'utilizzo dell\'app OsmAnd raccoglie informazioni su quale parti dell\'applicazione tu utilizzi. La tua geolocalizzazione non viene mai inviata, nemmeno qualsiasi dato che tu immetti nell\'app o dettagli sulle aree che visualizzi cerchi o scarichi. Non mostrare alcun messaggio all\'avvio - Mostra messaggi riguardo app in sconto ed eventi locali speciali + Elimina messaggi riguardo sconti dell\'app ed eventi speciali locali Opzioni parcheggio Grazie per avere acquistato la versione completa di OsmAnd! Caratteri della mappa @@ -2889,4 +2889,12 @@ Copertura e qualità approssimativamente: Non utilizzare le animazioni Disabilita le animazioni nell\'app Mantieni visualizzato nella mappa + Tempo cuscinetto per il tracciamento online + Specifica un tempo del cuscinetto per mantenere le localizzazioni quando non c\'è connessione + Riprova + Aggiungi nuovi punti al percorso + Aggiungi una linea + Salva il Punto Percorso + Punto Percorso 1 + Aggiungi e registra Tracce From 7296464079d0e71419a570760fafb356ae99b65b Mon Sep 17 00:00:00 2001 From: ace shadow Date: Fri, 1 Sep 2017 00:32:00 +0000 Subject: [PATCH 16/84] Translated using Weblate (Slovak) Currently translated at 99.2% (2384 of 2402 strings) --- OsmAnd/res/values-sk/strings.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 72237cde83..ab41e69dbc 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -2537,7 +2537,7 @@ Zodpovedá oblasti: %1$s x %2$s Neodosielať anonymné štatistiky o používaní aplikácie OsmAnd zbiera informácie o tom, ktoré časti aplikácie otvárate. Nikdy sa neodosiela vaša poloha ani nič čo zapíšete do aplikácie ani detaily o oblastiach, ktoré si prezeráte, hľadáte alebo sťahujete. Nezobrazovať oznamy pri štarte - Zobrazuje zľavy a oznamy o miestnych udalostiach + Zakáže zobrazovanie zľav aplikácie a oznamov o miestnych udalostiach Možnosti parkovania Ďakujeme za zakúpenie plnej verzie OsmAnd! Zvoľte fluktuáciu nadmorskej výšky @@ -2852,5 +2852,9 @@ Zodpovedá oblasti: %1$s x %2$s Importovať stopu Súbor %1$s neobsahuje body trasy, naimportovať ako stopu? Presunúť bod - Pridať do stopy - + Pridať do stopy GPX +Nepoužívať animácie + Vypne animácie v aplikácii + Zobrazovať ďalej na mape + Ukončiť bez uloženia? + From 6e3094cd80a89890abd93afdc6cee033a753d0bc Mon Sep 17 00:00:00 2001 From: Franco Date: Thu, 31 Aug 2017 19:58:57 +0000 Subject: [PATCH 17/84] Translated using Weblate (Spanish (American)) Currently translated at 100.0% (3167 of 3167 strings) --- OsmAnd/res/values-es-rUS/phrases.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-es-rUS/phrases.xml b/OsmAnd/res/values-es-rUS/phrases.xml index d1440d1eec..5cc3f6a46c 100644 --- a/OsmAnd/res/values-es-rUS/phrases.xml +++ b/OsmAnd/res/values-es-rUS/phrases.xml @@ -3276,8 +3276,8 @@ Barcos de alquiler Alquiler de barcos - Barcos a motor: Sí - Barcos a motor: No + Lanchas de motor: Sí + Lanchas de motor: No Casas flotantes: Sí Casas flotantes: No Barcos a pedal: Sí From 22a684d1a7b1b9e63dff5459c47579d8213487e3 Mon Sep 17 00:00:00 2001 From: ezjerry liao Date: Fri, 1 Sep 2017 17:11:54 +0000 Subject: [PATCH 18/84] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (2407 of 2407 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 0a4c9c4c4c..14b4266c9c 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -2843,4 +2843,9 @@ OsmAnd (Automated Navigation Directions) 是一個地圖和導航的應用程式 離開而不儲存嗎? 不使用動畫 停用在應用程式中的動畫 + 全部移動到歷程 + 建立路線 + 顯示方向 + 排序方式 + 標記選項 From 03130924f92cf69b6e85ede3983b41e29360f4e5 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Fri, 1 Sep 2017 20:36:45 +0300 Subject: [PATCH 19/84] Add phrase --- OsmAnd/res/values/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 59b99ac779..bb602b0966 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -3467,4 +3467,6 @@ Canoe: yes Canoe: no + Network + From c439f93d9c84ee0aaa7af6e351f4d1e1f7324467 Mon Sep 17 00:00:00 2001 From: Viktar Vauchkevich Date: Fri, 1 Sep 2017 17:38:59 +0000 Subject: [PATCH 20/84] Translated using Weblate (Belarusian) Currently translated at 100.0% (2407 of 2407 strings) --- OsmAnd/res/values-be/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index e2dc750d93..e7c1caefe4 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -2859,4 +2859,9 @@ Выйсці без захавання? Не ўжываць анімацыю Адключэньне анімацыі ў праграме + Перамясціць усё ў гісторыю + Пабудаваць маршрут + Паказаць напрамак + Сартаваць па + Налады маркера From d22ed6d4fea52c5800bb94416b311543e3ec80d5 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Fri, 1 Sep 2017 17:18:25 +0000 Subject: [PATCH 21/84] Translated using Weblate (Danish) Currently translated at 100.0% (2407 of 2407 strings) --- OsmAnd/res/values-da/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index bba7e3fc05..ab5fbc05b5 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -2861,4 +2861,9 @@ Tidligere destination bliver sidste mellemliggende punkt. Afslut uden at gemme? Brug ikke animationer Deaktiverer animationer i programmet + Flyt alle til historik + Byg rute + Vis retning + Sorter efter + Markør indstillinger From 1510d5b4b4e616a194eb2065e11e9a135ff10a7c Mon Sep 17 00:00:00 2001 From: Hakuchi Date: Fri, 1 Sep 2017 17:23:57 +0000 Subject: [PATCH 22/84] Translated using Weblate (German) Currently translated at 99.9% (2406 of 2407 strings) --- OsmAnd/res/values-de/strings.xml | 56 +++++++++++++++++--------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index d6021147ce..a07d083f81 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -115,32 +115,29 @@ Auf Straße einrasten OsmAnd Karten & Navigation Globale Landkarten- und Navigationsanwendung für Offline- und Online-OSM-Karten - " - OsmAnd (OSM Automated Navigation Directions) - -OsmAnd ist eine Open-Source-Navigationsanwendung mit Zugriff auf eine große Vielfalt öffentlich zugänglicher OpenStreetMap-(OSM)-Karten weltweit. Alle Karten (Vektor- oder Kachelformate) können lokal auf der Speicherkarte abgelegt und offline verwendet werden. OsmAnd bietet ferner eine Offline- und Online-Routing-Funktion inklusive Sprachnavigation. - -Einige der Kernfunktionen: -- Komplette Offline-Funktionalität (Kartenmaterial kann auf dem Gerät abgelegt werden) -- Kompakte Vektorkarten für die ganze Welt verfügbar -- Direktes Herunterladen von Länder- oder Regionenkarten aus der App heraus -- Darstellung mehrerer überlagerter Kartenschichten wie GPX oder Navigations-Tracks, POIs (Points of Interest), Favoriten, Höhenlinien, ÖPNV-Haltestellen, zusätzliche Karten mit wählbarer Transparenz -- Offline Adress- und POI-Suche -- Offlinenavigation für mittelstrecken Distanzen - -- Auto-, Fahrrad- und Fußgänger-Modus mit -- optionaler automatischer Tag-Nacht-Umschaltung der Anzeige -- optionalem geschwindigkeitsabhängigem Kartenmaßstab -- optionaler Kartenausrichtung nach Kompass oder Bewegungsrichtung -- optionaler Fahrspuranzeige, Geschwindigkeitswarnung, aufgenommene oder TTS-Sprachansagen - -Einschränkungen dieser kostenlosen Version von OsmAnd: -- Anzahl der Kartendownloads - -Kein Zugriff auf Wikipedia Offline-POIs - -OsmAnd wird aktiv weiterentwickelt und das Projekt benötigt Mittel für die Entwicklung, die Komplettierung und den Test (Fahrten) neuer Funktionen. -Bitte erwägen Sie den Kauf von OsmAnd+, die Förderung spezieller Funktionen oder eine allgemeine Spende auf osmand.net. - " + OsmAnd (OSM Automated Navigation Directions) +\n +\nOsmAnd ist eine Open-Source-Navigationsanwendung mit Zugriff auf eine große Vielfalt öffentlich zugänglicher OpenStreetMap-(OSM)-Karten weltweit. Alle Karten (Vektor- oder Kachelformate) können lokal auf der Speicherkarte abgelegt und offline verwendet werden. OsmAnd bietet ferner eine Offline- und Online-Routing-Funktion inklusive Sprachnavigation. +\n +\nEinige der Kernfunktionen: +\n- Komplette Offline-Funktionalität (Kartenmaterial kann auf dem Gerät abgelegt werden) +\n- Kompakte Vektorkarten für die ganze Welt verfügbar +\n- Direktes Herunterladen von Länder- oder Regionenkarten aus der App heraus +\n- Darstellung mehrerer überlagerter Kartenschichten wie GPX oder Navigations-Tracks, POIs (Points of Interest), Favoriten, Höhenlinien, ÖPNV-Haltestellen, zusätzliche Karten mit wählbarer Transparenz +\n- Offline Adress- und POI-Suche +\n- Offlinenavigation für mittelstrecken Distanzen +\n +\n- Auto-, Fahrrad- und Fußgänger-Modus mit +\n- optionaler automatischer Tag-Nacht-Umschaltung der Anzeige +\n- optionalem geschwindigkeitsabhängigem Kartenmaßstab - optionaler Kartenausrichtung nach Kompass oder Bewegungsrichtung +\n- optionaler Fahrspuranzeige, Geschwindigkeitswarnung, aufgenommene oder TTS-Sprachansagen +\n +\nEinschränkungen dieser kostenlosen Version von OsmAnd: +\n- Anzahl der Kartendownloads - +\nKein Zugriff auf Wikipedia Offline-POIs +\n +\nOsmAnd wird aktiv weiterentwickelt und das Projekt benötigt Mittel für die Entwicklung, die Komplettierung und den Test (Fahrten) neuer Funktionen. +\nBitte erwägen Sie den Kauf von OsmAnd+, die Förderung spezieller Funktionen oder eine allgemeine Spende auf osmand.net. OsmAnd+ Karten & Navigation Globale Landkarten- und Navigationsanwendung für Offline- und Online-OSM-Karten @@ -2620,7 +2617,7 @@ Abgedeckte Fläche: %1$s x %2$s Keine anonymen App-Nutzungsdaten versenden OsmAnd sammelt Informationen über durch Sie geöffnete App-Teile. Es wird niemals Ihre Position noch irgendeine Ihrer App-Eingaben oder Einzelheiten zu den von Ihnen betrachteten, gesuchten oder heruntergeladenen Gebieten versandt. Keine Meldungen beim App-Start einblenden - Es werden Meldungen zu App-Angeboten und besonderen lokalen Ereignissen angezeigt + Unterdrückt Meldungen zu App-Angeboten und besonde lokale Ereignisse Parkmöglichkeiten Vielen Dank, dass Sie die Vollversion von OsmAnd erworben haben! Bergig @@ -2814,4 +2811,9 @@ Abgedeckte Fläche: %1$s x %2$s Deaktiviert Animationen in der App Weiterhin auf der Karte anzeigen Beenden ohne zu speichern? + Alles zu Historie verschieben + Route erstellen + Richtung anzeigen + Sortieren nach + Marker-Optionen From 2174df67e369ef39d508208ff798095a6ea547ee Mon Sep 17 00:00:00 2001 From: Hakuchi Date: Fri, 1 Sep 2017 17:19:20 +0000 Subject: [PATCH 23/84] Translated using Weblate (German) Currently translated at 100.0% (3167 of 3167 strings) --- OsmAnd/res/values-de/phrases.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index c8b6dcc78c..60acfe5e09 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -2657,10 +2657,10 @@ Drachenfliegen Drachenfliegen: nein Strikt - Freies Fliegen strikt: nein + Freeflying starr: nein Freeflying Ausrichtung: N Freeflying Ausrichtung: NO - Freier Flugplatz Ausrichtung: O + Freeflying Standort Ausrichtung: O Freeflying Ausrichtung: SO Freeflying Ausrichtung: S Freeflying Ausrichtung: SW From 4f686edea620a2ea9a3e07dbf91c14385fb92aa2 Mon Sep 17 00:00:00 2001 From: Franco Date: Fri, 1 Sep 2017 17:53:01 +0000 Subject: [PATCH 24/84] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (2407 of 2407 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index b284a40191..6025598707 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -2737,4 +2737,9 @@ Proporciona un código completo ¿Salir sin guardar? No usar animaciones Desactiva las animaciones en la aplicación + Mover todo al historial + Crear ruta + Mostrar dirección + Ordenar por + Opciones del marcador From fd612e0c36df211f4141b2e8937146f32af8d4ac Mon Sep 17 00:00:00 2001 From: Franco Date: Wed, 23 Aug 2017 18:45:12 +0000 Subject: [PATCH 25/84] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3168 of 3168 strings) --- OsmAnd/res/values-es-rAR/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml index 6844708ed5..d6fb0e1f86 100644 --- a/OsmAnd/res/values-es-rAR/phrases.xml +++ b/OsmAnd/res/values-es-rAR/phrases.xml @@ -3531,4 +3531,6 @@ Canoas: Sí Canoas: No +Red + From c85245b16364ce60c56fd53ac4c4b4bcc11b3679 Mon Sep 17 00:00:00 2001 From: Franco Date: Thu, 31 Aug 2017 19:58:57 +0000 Subject: [PATCH 26/84] Translated using Weblate (Spanish (American)) Currently translated at 100.0% (3168 of 3168 strings) --- OsmAnd/res/values-es-rUS/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-es-rUS/phrases.xml b/OsmAnd/res/values-es-rUS/phrases.xml index 5cc3f6a46c..5ceede1d32 100644 --- a/OsmAnd/res/values-es-rUS/phrases.xml +++ b/OsmAnd/res/values-es-rUS/phrases.xml @@ -3293,4 +3293,6 @@ Canoas: Sí Canoas: No +Red + From ff0fe60a2d429d8091f23151e05b96cc64ba7b64 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Wed, 23 Aug 2017 15:20:19 +0000 Subject: [PATCH 27/84] Translated using Weblate (Danish) Currently translated at 100.0% (3168 of 3168 strings) --- OsmAnd/res/values-da/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml index 4551304433..5aff19184c 100644 --- a/OsmAnd/res/values-da/phrases.xml +++ b/OsmAnd/res/values-da/phrases.xml @@ -3565,4 +3565,6 @@ Kano: ja Kano: nej +Netværk + From f8d1b394d740d7497a8d2219ebb1103c0e18916d Mon Sep 17 00:00:00 2001 From: Franco Date: Fri, 1 Sep 2017 17:55:13 +0000 Subject: [PATCH 28/84] Translated using Weblate (Spanish (American)) Currently translated at 100.0% (2407 of 2407 strings) --- OsmAnd/res/values-es-rUS/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-es-rUS/strings.xml b/OsmAnd/res/values-es-rUS/strings.xml index cb3abbddf2..6a9467bec8 100644 --- a/OsmAnd/res/values-es-rUS/strings.xml +++ b/OsmAnd/res/values-es-rUS/strings.xml @@ -2738,4 +2738,9 @@ Proporciona un código completo ¿Salir sin guardar? No usar animaciones Desactiva las animaciones en la aplicación + Mover todo al historial + Crear ruta + Mostrar dirección + Ordenar por + Opciones del marcador From dd088a7246343ddb4e0a3e00c95683528e539aff Mon Sep 17 00:00:00 2001 From: Viktar Vauchkevich Date: Fri, 1 Sep 2017 18:01:06 +0000 Subject: [PATCH 29/84] Translated using Weblate (Belarusian (latin)) Currently translated at 100.0% (2407 of 2407 strings) --- OsmAnd/res/values-be-rBY/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-be-rBY/strings.xml b/OsmAnd/res/values-be-rBY/strings.xml index 58140131e6..116e531af2 100644 --- a/OsmAnd/res/values-be-rBY/strings.xml +++ b/OsmAnd/res/values-be-rBY/strings.xml @@ -2810,4 +2810,9 @@ U vypadku, kali vy lubіcie OsmAnd і OSM і chočacie padtrymać jaho, heta іd Vyjsci biez zachavańnia? Nie ŭžyvać animacyju Adklučeńnie animacyi ŭ prahramie + Pieramiascić usio ŭ historyju + Pabudavać maršrut + Pakazać napramak + Sartavać pa + Nalady markiera From daedaa2791757a6ea367225f44e0ef576fd8e487 Mon Sep 17 00:00:00 2001 From: Viktar Vauchkevich Date: Thu, 24 Aug 2017 09:31:58 +0000 Subject: [PATCH 30/84] Translated using Weblate (Belarusian) Currently translated at 100.0% (3168 of 3168 strings) --- OsmAnd/res/values-be/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-be/phrases.xml b/OsmAnd/res/values-be/phrases.xml index 204edda49a..e269d4cf2e 100644 --- a/OsmAnd/res/values-be/phrases.xml +++ b/OsmAnd/res/values-be/phrases.xml @@ -3520,4 +3520,6 @@ Каноэ: так Каноэ: не +Сетка + From d9f594891a23b62191485e2b946f0a8df159eff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus=20R=C3=BCdinger?= Date: Fri, 1 Sep 2017 21:34:16 +0000 Subject: [PATCH 31/84] Translated using Weblate (German) Currently translated at 99.9% (2406 of 2407 strings) --- OsmAnd/res/values-de/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index a07d083f81..ad7a988fc4 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -2617,7 +2617,7 @@ Abgedeckte Fläche: %1$s x %2$s Keine anonymen App-Nutzungsdaten versenden OsmAnd sammelt Informationen über durch Sie geöffnete App-Teile. Es wird niemals Ihre Position noch irgendeine Ihrer App-Eingaben oder Einzelheiten zu den von Ihnen betrachteten, gesuchten oder heruntergeladenen Gebieten versandt. Keine Meldungen beim App-Start einblenden - Unterdrückt Meldungen zu App-Angeboten und besonde lokale Ereignisse + Unterdrückt Meldungen zu App-Sonderangeboten und besonderen lokalen Ereignissen Parkmöglichkeiten Vielen Dank, dass Sie die Vollversion von OsmAnd erworben haben! Bergig From 4c8098dd95204b20d1c6bbbc1d94b0b7bc22b081 Mon Sep 17 00:00:00 2001 From: Hakuchi Date: Fri, 1 Sep 2017 17:19:20 +0000 Subject: [PATCH 32/84] Translated using Weblate (German) Currently translated at 100.0% (3168 of 3168 strings) --- OsmAnd/res/values-de/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index 60acfe5e09..d926f21698 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -3481,4 +3481,6 @@ Kanus: ja Kanus: nein +Netzwerk + From 4b901fdaf40c0b7b51b68bf97162da68d444ee36 Mon Sep 17 00:00:00 2001 From: ezjerry liao Date: Thu, 24 Aug 2017 04:32:52 +0000 Subject: [PATCH 33/84] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3168 of 3168 strings) --- OsmAnd/res/values-zh-rTW/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-zh-rTW/phrases.xml b/OsmAnd/res/values-zh-rTW/phrases.xml index e5a56a9516..7ba66b9e11 100644 --- a/OsmAnd/res/values-zh-rTW/phrases.xml +++ b/OsmAnd/res/values-zh-rTW/phrases.xml @@ -3509,4 +3509,6 @@ 獨木舟:有 獨木舟:無 +網路 + From a3cf1a664e3e68c033e82c5ceac7aba69335d700 Mon Sep 17 00:00:00 2001 From: Verdulo Date: Sat, 2 Sep 2017 12:24:44 +0000 Subject: [PATCH 34/84] Translated using Weblate (Esperanto) Currently translated at 100.0% (2407 of 2407 strings) --- OsmAnd/res/values-eo/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index 2d989fae2b..8038715a86 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -2773,4 +2773,9 @@ Indikas lokon: %1$s x %2$s" Ĉu eliri sen konservi? Ne uzi movbildojn Malaktivigi animaciojn en la aplikaĵo + Movi ĉiujn al historio + Kalkuli kurson + Montri direkton + Ordigi laŭ + Markaj agordoj From f00346bc8835785a14aafe74dc5b25265559100c Mon Sep 17 00:00:00 2001 From: Verdulo Date: Sun, 27 Aug 2017 21:08:17 +0000 Subject: [PATCH 35/84] Translated using Weblate (Polish) Currently translated at 100.0% (3168 of 3168 strings) --- OsmAnd/res/values-pl/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-pl/phrases.xml b/OsmAnd/res/values-pl/phrases.xml index d5295f4e74..ab4505ccef 100644 --- a/OsmAnd/res/values-pl/phrases.xml +++ b/OsmAnd/res/values-pl/phrases.xml @@ -3504,4 +3504,6 @@ Kanadyjki: tak Kanadyjki: nie +Sieć + From 90bbd25c4fd196c2b4fb97f62f569b728baca438 Mon Sep 17 00:00:00 2001 From: Jindrich Makovicka Date: Thu, 1 Jun 2017 20:47:19 +0200 Subject: [PATCH 36/84] Fix animation name attributes Needed for Gradle plugin 3.0-alpha2 and above --- OsmAnd/res/values/styles.xml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml index 6c312fb8a1..00c50f503c 100644 --- a/OsmAnd/res/values/styles.xml +++ b/OsmAnd/res/values/styles.xml @@ -392,53 +392,53 @@