Merge branch 'master' into patch-19

This commit is contained in:
Hardy 2019-10-31 21:24:01 +01:00 committed by GitHub
commit 06a3e62cfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
577 changed files with 19124 additions and 7009 deletions

10
OsmAnd-api/.gitignore vendored Normal file
View file

@ -0,0 +1,10 @@
# Android Studio
*/.idea
*/*.iml
# Gradle
*/.gradle
*/local.properties
# Output files
*/build

View file

@ -0,0 +1 @@
<manifest package="net.osmand.aidlapi" />

41
OsmAnd-api/build.gradle Normal file
View file

@ -0,0 +1,41 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.osmandapp.osmand'
version = '2.0.0'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 2
versionName "2.0"
}
lintOptions {
abortOnError false
}
sourceSets {
main {
manifest.srcFile "AndroidManifest.xml"
aidl.srcDirs = ["src"]
java.srcDirs = ["src"]
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-annotations:27.1.1'
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives sourcesJar
}

View file

@ -0,0 +1,3 @@
<resources>
<string name="app_name">OsmAnd-api</string>
</resources>

View file

@ -0,0 +1,35 @@
package net.osmand.aidlapi;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
public abstract class AidlParams implements Parcelable {
@Override
public final void writeToParcel(Parcel dest, int flags) {
Bundle bundle = new Bundle();
writeToBundle(bundle);
dest.writeBundle(bundle);
}
public final void readFromParcel(Parcel in) {
Bundle bundle = in.readBundle(getClass().getClassLoader());
if (bundle != null) {
readFromBundle(bundle);
}
}
protected void writeToBundle(Bundle bundle) {
}
protected void readFromBundle(Bundle bundle) {
}
@Override
public int describeContents() {
return 0;
}
}

View file

@ -1,9 +1,9 @@
package net.osmand.aidl; package net.osmand.aidlapi;
import net.osmand.aidl.search.SearchResult; import net.osmand.aidlapi.search.SearchResult;
import net.osmand.aidl.gpx.AGpxBitmap; import net.osmand.aidlapi.gpx.AGpxBitmap;
import net.osmand.aidl.navigation.ADirectionInfo; import net.osmand.aidlapi.navigation.ADirectionInfo;
import net.osmand.aidl.navigation.OnVoiceNavigationParams; import net.osmand.aidlapi.navigation.OnVoiceNavigationParams;
interface IOsmAndAidlCallback { interface IOsmAndAidlCallback {

View file

@ -1,97 +1,96 @@
package net.osmand.aidl; package net.osmand.aidlapi;
import net.osmand.aidl.map.ALatLon; import net.osmand.aidlapi.map.ALatLon;
import net.osmand.aidl.map.SetMapLocationParams; import net.osmand.aidlapi.map.SetMapLocationParams;
import net.osmand.aidl.favorite.group.AFavoriteGroup; import net.osmand.aidlapi.favorite.group.AFavoriteGroup;
import net.osmand.aidl.favorite.group.AddFavoriteGroupParams; import net.osmand.aidlapi.favorite.group.AddFavoriteGroupParams;
import net.osmand.aidl.favorite.group.RemoveFavoriteGroupParams; import net.osmand.aidlapi.favorite.group.RemoveFavoriteGroupParams;
import net.osmand.aidl.favorite.group.UpdateFavoriteGroupParams; import net.osmand.aidlapi.favorite.group.UpdateFavoriteGroupParams;
import net.osmand.aidl.favorite.AFavorite; import net.osmand.aidlapi.favorite.AFavorite;
import net.osmand.aidl.favorite.AddFavoriteParams; import net.osmand.aidlapi.favorite.AddFavoriteParams;
import net.osmand.aidl.favorite.RemoveFavoriteParams; import net.osmand.aidlapi.favorite.RemoveFavoriteParams;
import net.osmand.aidl.favorite.UpdateFavoriteParams; import net.osmand.aidlapi.favorite.UpdateFavoriteParams;
import net.osmand.aidl.mapmarker.AMapMarker; import net.osmand.aidlapi.mapmarker.AMapMarker;
import net.osmand.aidl.mapmarker.AddMapMarkerParams; import net.osmand.aidlapi.mapmarker.AddMapMarkerParams;
import net.osmand.aidl.mapmarker.RemoveMapMarkerParams; import net.osmand.aidlapi.mapmarker.RemoveMapMarkerParams;
import net.osmand.aidl.mapmarker.UpdateMapMarkerParams; import net.osmand.aidlapi.mapmarker.UpdateMapMarkerParams;
import net.osmand.aidl.calculateroute.CalculateRouteParams; import net.osmand.aidlapi.calculateroute.CalculateRouteParams;
import net.osmand.aidl.gpx.ImportGpxParams; import net.osmand.aidlapi.gpx.ImportGpxParams;
import net.osmand.aidl.gpx.ShowGpxParams; import net.osmand.aidlapi.gpx.ShowGpxParams;
import net.osmand.aidl.gpx.StartGpxRecordingParams; import net.osmand.aidlapi.gpx.StartGpxRecordingParams;
import net.osmand.aidl.gpx.StopGpxRecordingParams; import net.osmand.aidlapi.gpx.StopGpxRecordingParams;
import net.osmand.aidl.gpx.HideGpxParams; import net.osmand.aidlapi.gpx.HideGpxParams;
import net.osmand.aidl.gpx.ASelectedGpxFile; import net.osmand.aidlapi.gpx.ASelectedGpxFile;
import net.osmand.aidl.mapwidget.AMapWidget; import net.osmand.aidlapi.mapwidget.AMapWidget;
import net.osmand.aidl.mapwidget.AddMapWidgetParams; import net.osmand.aidlapi.mapwidget.AddMapWidgetParams;
import net.osmand.aidl.mapwidget.RemoveMapWidgetParams; import net.osmand.aidlapi.mapwidget.RemoveMapWidgetParams;
import net.osmand.aidl.mapwidget.UpdateMapWidgetParams; import net.osmand.aidlapi.mapwidget.UpdateMapWidgetParams;
import net.osmand.aidl.maplayer.point.AMapPoint; import net.osmand.aidlapi.maplayer.point.AMapPoint;
import net.osmand.aidl.maplayer.point.AddMapPointParams; import net.osmand.aidlapi.maplayer.point.AddMapPointParams;
import net.osmand.aidl.maplayer.point.RemoveMapPointParams; import net.osmand.aidlapi.maplayer.point.RemoveMapPointParams;
import net.osmand.aidl.maplayer.point.UpdateMapPointParams; import net.osmand.aidlapi.maplayer.point.UpdateMapPointParams;
import net.osmand.aidl.maplayer.AMapLayer; import net.osmand.aidlapi.maplayer.AMapLayer;
import net.osmand.aidl.maplayer.AddMapLayerParams; import net.osmand.aidlapi.maplayer.AddMapLayerParams;
import net.osmand.aidl.maplayer.RemoveMapLayerParams; import net.osmand.aidlapi.maplayer.RemoveMapLayerParams;
import net.osmand.aidl.maplayer.UpdateMapLayerParams; import net.osmand.aidlapi.maplayer.UpdateMapLayerParams;
import net.osmand.aidl.navigation.NavigateParams; import net.osmand.aidlapi.navigation.NavigateParams;
import net.osmand.aidl.navigation.NavigateGpxParams; import net.osmand.aidlapi.navigation.NavigateGpxParams;
import net.osmand.aidl.note.TakePhotoNoteParams; import net.osmand.aidlapi.note.TakePhotoNoteParams;
import net.osmand.aidl.note.StartVideoRecordingParams; import net.osmand.aidlapi.note.StartVideoRecordingParams;
import net.osmand.aidl.note.StartAudioRecordingParams; import net.osmand.aidlapi.note.StartAudioRecordingParams;
import net.osmand.aidl.note.StopRecordingParams; import net.osmand.aidlapi.note.StopRecordingParams;
import net.osmand.aidl.gpx.RemoveGpxParams; import net.osmand.aidlapi.gpx.RemoveGpxParams;
import net.osmand.aidl.maplayer.point.ShowMapPointParams; import net.osmand.aidlapi.maplayer.point.ShowMapPointParams;
import net.osmand.aidl.navdrawer.SetNavDrawerItemsParams; import net.osmand.aidlapi.navdrawer.SetNavDrawerItemsParams;
import net.osmand.aidl.navdrawer.NavDrawerFooterParams; import net.osmand.aidlapi.navdrawer.NavDrawerFooterParams;
import net.osmand.aidl.navdrawer.NavDrawerHeaderParams; import net.osmand.aidlapi.navdrawer.NavDrawerHeaderParams;
import net.osmand.aidl.navigation.PauseNavigationParams; import net.osmand.aidlapi.navigation.PauseNavigationParams;
import net.osmand.aidl.navigation.ResumeNavigationParams; import net.osmand.aidlapi.navigation.ResumeNavigationParams;
import net.osmand.aidl.navigation.StopNavigationParams; import net.osmand.aidlapi.navigation.StopNavigationParams;
import net.osmand.aidl.navigation.MuteNavigationParams; import net.osmand.aidlapi.navigation.MuteNavigationParams;
import net.osmand.aidl.navigation.UnmuteNavigationParams; import net.osmand.aidlapi.navigation.UnmuteNavigationParams;
import net.osmand.aidl.IOsmAndAidlCallback; import net.osmand.aidlapi.IOsmAndAidlCallback;
import net.osmand.aidl.search.SearchResult; import net.osmand.aidlapi.search.SearchResult;
import net.osmand.aidl.search.SearchParams; import net.osmand.aidlapi.search.SearchParams;
import net.osmand.aidl.navigation.NavigateSearchParams; import net.osmand.aidlapi.navigation.NavigateSearchParams;
import net.osmand.aidl.customization.SetWidgetsParams; import net.osmand.aidlapi.customization.SetWidgetsParams;
import net.osmand.aidl.customization.OsmandSettingsParams; import net.osmand.aidlapi.customization.OsmandSettingsParams;
import net.osmand.aidl.customization.OsmandSettingsInfoParams; import net.osmand.aidlapi.customization.OsmandSettingsInfoParams;
import net.osmand.aidl.customization.CustomizationInfoParams; import net.osmand.aidlapi.customization.CustomizationInfoParams;
import net.osmand.aidl.gpx.AGpxFile; import net.osmand.aidlapi.gpx.AGpxFile;
import net.osmand.aidl.gpx.AGpxFileDetails; import net.osmand.aidlapi.gpx.AGpxFileDetails;
import net.osmand.aidl.gpx.CreateGpxBitmapParams; import net.osmand.aidlapi.gpx.CreateGpxBitmapParams;
import net.osmand.aidl.gpx.GpxColorParams;
import net.osmand.aidl.tiles.ASqliteDbFile; import net.osmand.aidlapi.tiles.ASqliteDbFile;
import net.osmand.aidl.plugins.PluginParams; import net.osmand.aidlapi.plugins.PluginParams;
import net.osmand.aidl.copyfile.CopyFileParams; import net.osmand.aidlapi.copyfile.CopyFileParams;
import net.osmand.aidl.navigation.ANavigationUpdateParams; import net.osmand.aidlapi.navigation.ANavigationUpdateParams;
import net.osmand.aidl.navigation.ANavigationVoiceRouterMessageParams; import net.osmand.aidlapi.navigation.ANavigationVoiceRouterMessageParams;
import net.osmand.aidl.contextmenu.ContextMenuButtonsParams; import net.osmand.aidlapi.contextmenu.ContextMenuButtonsParams;
import net.osmand.aidl.contextmenu.UpdateContextMenuButtonsParams; import net.osmand.aidlapi.contextmenu.UpdateContextMenuButtonsParams;
import net.osmand.aidl.contextmenu.RemoveContextMenuButtonsParams; import net.osmand.aidlapi.contextmenu.RemoveContextMenuButtonsParams;
import net.osmand.aidl.mapmarker.RemoveMapMarkersParams; import net.osmand.aidlapi.mapmarker.RemoveMapMarkersParams;
// NOTE: Add new methods at the end of file!!! // NOTE: Add new methods at the end of file!!!
@ -305,6 +304,13 @@ interface IOsmAndAidlInterface {
*/ */
boolean addFavoriteGroup(in AddFavoriteGroupParams params); boolean addFavoriteGroup(in AddFavoriteGroupParams params);
/**
* Remove favorite group with given name.
*
* @param name (String) - name of favorite group.
*/
boolean removeFavoriteGroup(in RemoveFavoriteGroupParams params);
/** /**
* Update favorite group with given params. * Update favorite group with given params.
* *
@ -315,13 +321,6 @@ interface IOsmAndAidlInterface {
* @param colorNew (String) - group color (new). * @param colorNew (String) - group color (new).
* @param visibleNew (boolean) - group visibility (new). * @param visibleNew (boolean) - group visibility (new).
*/ */
boolean removeFavoriteGroup(in RemoveFavoriteGroupParams params);
/**
* Remove favorite group with given name.
*
* @param name (String) - name of favorite group.
*/
boolean updateFavoriteGroup(in UpdateFavoriteGroupParams params); boolean updateFavoriteGroup(in UpdateFavoriteGroupParams params);
/** /**
@ -338,6 +337,16 @@ interface IOsmAndAidlInterface {
*/ */
boolean addFavorite(in AddFavoriteParams params); boolean addFavorite(in AddFavoriteParams params);
/**
* Remove favorite at given location with given params.
*
* @param lat (double) - latitude.
* @param lon (double) - longitude.
* @param name (String) - name of favorite item.
* @param category (String) - category of favorite item.
*/
boolean removeFavorite(in RemoveFavoriteParams params);
/** /**
* Update favorite at given location with given params. * Update favorite at given location with given params.
* *
@ -356,16 +365,6 @@ interface IOsmAndAidlInterface {
* "lightgreen", "green", "lightblue", "blue", "purple", "pink", "brown". * "lightgreen", "green", "lightblue", "blue", "purple", "pink", "brown".
* @param visibleNew (boolean) - should new category be visible after creation. * @param visibleNew (boolean) - should new category be visible after creation.
*/ */
boolean removeFavorite(in RemoveFavoriteParams params);
/**
* Remove favorite at given location with given params.
*
* @param lat (double) - latitude.
* @param lon (double) - longitude.
* @param name (String) - name of favorite item.
* @param category (String) - category of favorite item.
*/
boolean updateFavorite(in UpdateFavoriteParams params); boolean updateFavorite(in UpdateFavoriteParams params);
/** /**
@ -832,18 +831,4 @@ interface IOsmAndAidlInterface {
* Empty class of params * Empty class of params
*/ */
boolean removeAllActiveMapMarkers(in RemoveMapMarkersParams params); boolean removeAllActiveMapMarkers(in RemoveMapMarkersParams params);
/**
* Method to get color name for gpx.
*
* @param fileName (String) - name of gpx file.
*
* @param gpxColor (String) - color name of gpx. Can be one of: "red", "orange", "lightblue",
* "blue", "purple", "translucent_red", "translucent_orange",
* "translucent_lightblue", "translucent_blue", "translucent_purple"
* Which used in {@link #importGpx(in ImportGpxParams params) importGpx}
* Or color hex if gpx has custom color.
*
*/
boolean getGpxColor(inout GpxColorParams params);
} }

View file

@ -1,9 +1,8 @@
package net.osmand.plus; package net.osmand.aidlapi;
public interface OsmAndCustomizationConstants { public interface OsmAndCustomizationConstants {
// Navigation Drawer: // Navigation Drawer:
String DRAWER_ITEM_ID_SCHEME = "drawer.action."; String DRAWER_ITEM_ID_SCHEME = "drawer.action.";
String DRAWER_DASHBOARD_ID = DRAWER_ITEM_ID_SCHEME + "dashboard"; String DRAWER_DASHBOARD_ID = DRAWER_ITEM_ID_SCHEME + "dashboard";
String DRAWER_MAP_MARKERS_ID = DRAWER_ITEM_ID_SCHEME + "map_markers"; String DRAWER_MAP_MARKERS_ID = DRAWER_ITEM_ID_SCHEME + "map_markers";
@ -23,7 +22,6 @@ public interface OsmAndCustomizationConstants {
String DRAWER_DIVIDER_ID = DRAWER_ITEM_ID_SCHEME + "divider"; String DRAWER_DIVIDER_ID = DRAWER_ITEM_ID_SCHEME + "divider";
// Configure Map: // Configure Map:
String CONFIGURE_MAP_ITEM_ID_SCHEME = "map.configure."; String CONFIGURE_MAP_ITEM_ID_SCHEME = "map.configure.";
String SHOW_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "show."; String SHOW_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "show.";
String RENDERING_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "rendering."; String RENDERING_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "rendering.";
@ -42,6 +40,7 @@ public interface OsmAndCustomizationConstants {
String RECORDING_LAYER = SHOW_ITEMS_ID_SCHEME + "recording_layer"; String RECORDING_LAYER = SHOW_ITEMS_ID_SCHEME + "recording_layer";
String MAPILLARY = SHOW_ITEMS_ID_SCHEME + "mapillary"; String MAPILLARY = SHOW_ITEMS_ID_SCHEME + "mapillary";
String OSM_NOTES = SHOW_ITEMS_ID_SCHEME + "osm_notes"; String OSM_NOTES = SHOW_ITEMS_ID_SCHEME + "osm_notes";
String OSM_EDITS = SHOW_ITEMS_ID_SCHEME + "osm_edits";
String OVERLAY_MAP = SHOW_ITEMS_ID_SCHEME + "overlay_map"; String OVERLAY_MAP = SHOW_ITEMS_ID_SCHEME + "overlay_map";
String UNDERLAY_MAP = SHOW_ITEMS_ID_SCHEME + "underlay_map"; String UNDERLAY_MAP = SHOW_ITEMS_ID_SCHEME + "underlay_map";
String CONTOUR_LINES = SHOW_ITEMS_ID_SCHEME + "contour_lines"; String CONTOUR_LINES = SHOW_ITEMS_ID_SCHEME + "contour_lines";
@ -60,7 +59,6 @@ public interface OsmAndCustomizationConstants {
String ROUTES_ID = RENDERING_ITEMS_ID_SCHEME + "routes"; String ROUTES_ID = RENDERING_ITEMS_ID_SCHEME + "routes";
// Map Controls: // Map Controls:
String HUD_BTN_ID_SCHEME = "map.view."; String HUD_BTN_ID_SCHEME = "map.view.";
String LAYERS_HUD_ID = HUD_BTN_ID_SCHEME + "layers"; String LAYERS_HUD_ID = HUD_BTN_ID_SCHEME + "layers";
String COMPASS_HUD_ID = HUD_BTN_ID_SCHEME + "compass"; String COMPASS_HUD_ID = HUD_BTN_ID_SCHEME + "compass";
@ -99,5 +97,4 @@ public interface OsmAndCustomizationConstants {
String PLUGIN_RASTER_MAPS = "osmand.rastermaps"; String PLUGIN_RASTER_MAPS = "osmand.rastermaps";
String PLUGIN_SKI_MAPS = "skimaps.plugin"; String PLUGIN_SKI_MAPS = "skimaps.plugin";
String PLUGIN_SRTM = "osmand.srtm"; String PLUGIN_SRTM = "osmand.srtm";
} }

View file

@ -0,0 +1,36 @@
package net.osmand.aidlapi;
public interface OsmandAidlConstants {
int OK_RESPONSE = 0;
int MIN_UPDATE_TIME_MS = 1000;
long COPY_FILE_PART_SIZE_LIMIT = 256 * 1024;
long COPY_FILE_MAX_LOCK_TIME_MS = 10000;
int CANNOT_ACCESS_API_ERROR = -5;
int UNKNOWN_API_ERROR = -2;
int MIN_UPDATE_TIME_MS_ERROR = -1;
int COPY_FILE_PARAMS_ERROR = -1001;
int COPY_FILE_PART_SIZE_LIMIT_ERROR = -1002;
int COPY_FILE_WRITE_LOCK_ERROR = -1003;
int COPY_FILE_IO_ERROR = -1004;
int COPY_FILE_UNSUPPORTED_FILE_TYPE_ERROR = -1005;
int TURN_TYPE_C = 1; //"C"; // continue (go straight)
int TURN_TYPE_TL = 2; // turn left
int TURN_TYPE_TSLL = 3; // turn slightly left
int TURN_TYPE_TSHL = 4; // turn sharply left
int TURN_TYPE_TR = 5; // turn right
int TURN_TYPE_TSLR = 6; // turn slightly right
int TURN_TYPE_TSHR = 7; // turn sharply right
int TURN_TYPE_KL = 8; // keep left
int TURN_TYPE_KR = 9; // keep right
int TURN_TYPE_TU = 10; // U-turn
int TURN_TYPE_TRU = 11; // Right U-turn
int TURN_TYPE_OFFR = 12; // Off route
int TURN_TYPE_RNDB = 13; // Roundabout
int TURN_TYPE_RNLB = 14; // Roundabout left
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.calculateroute;
parcelable CalculateRouteParams;

View file

@ -0,0 +1,101 @@
package net.osmand.aidlapi.calculateroute;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import net.osmand.aidlapi.map.ALatLon;
import java.util.ArrayList;
import java.util.List;
public class CalculateRouteParams extends AidlParams {
private ALatLon startPoint;
private String startPointName;
private ALatLon endPoint;
private String endPointName;
private ArrayList<ALatLon> intermediatePoints = new ArrayList<>();
private ArrayList<String> intermediateNames = new ArrayList<>();
public CalculateRouteParams(ALatLon startPoint, String startPointName,
ALatLon endPoint, String endPointName,
List<ALatLon> intermediatePoints, List<String> intermediateNames) {
if (endPoint == null) {
throw new IllegalArgumentException("endPoint cannot be null");
}
this.startPoint = startPoint;
this.startPointName = startPointName;
this.endPoint = endPoint;
this.endPointName = endPointName;
if (intermediatePoints != null) {
this.intermediatePoints.addAll(intermediatePoints);
}
if (intermediateNames != null) {
this.intermediateNames.addAll(intermediateNames);
}
}
public CalculateRouteParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<CalculateRouteParams> CREATOR = new Creator<CalculateRouteParams>() {
@Override
public CalculateRouteParams createFromParcel(Parcel in) {
return new CalculateRouteParams(in);
}
@Override
public CalculateRouteParams[] newArray(int size) {
return new CalculateRouteParams[size];
}
};
public ALatLon getStartPoint() {
return startPoint;
}
public String getStartPointName() {
return startPointName;
}
public ALatLon getEndPoint() {
return endPoint;
}
public String getEndPointName() {
return endPointName;
}
public List<ALatLon> getIntermediatePoints() {
return intermediatePoints;
}
public List<String> getIntermediateNames() {
return intermediateNames;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("startPoint", startPoint);
bundle.putString("startPointName", startPointName);
bundle.putParcelable("endPoint", endPoint);
bundle.putString("endPointName", endPointName);
bundle.putParcelableArrayList("intermediatePoints", intermediatePoints);
bundle.putStringArrayList("intermediateNames", intermediateNames);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(ALatLon.class.getClassLoader());
startPoint = bundle.getParcelable("startPoint");
startPointName = bundle.getString("startPointName");
endPoint = bundle.getParcelable("endPoint");
endPointName = bundle.getString("endPointName");
intermediatePoints = bundle.getParcelableArrayList("intermediatePoints");
intermediateNames = bundle.getStringArrayList("intermediateNames");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.contextmenu;
parcelable AContextMenuButton;

View file

@ -1,9 +1,11 @@
package net.osmand.aidl.contextmenu; package net.osmand.aidlapi.contextmenu;
import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
public class AContextMenuButton implements Parcelable { import net.osmand.aidlapi.AidlParams;
public class AContextMenuButton extends AidlParams {
private int buttonId; private int buttonId;
@ -61,7 +63,7 @@ public class AContextMenuButton implements Parcelable {
return rightIconName; return rightIconName;
} }
public boolean isNeedColorizeIcon() { public boolean isTintIcon() {
return needColorizeIcon; return needColorizeIcon;
} }
@ -69,33 +71,25 @@ public class AContextMenuButton implements Parcelable {
return enabled; return enabled;
} }
public static Creator<AContextMenuButton> getCREATOR() { @Override
return CREATOR; public void writeToBundle(Bundle bundle) {
bundle.putInt("buttonId", buttonId);
bundle.putString("leftTextCaption", leftTextCaption);
bundle.putString("rightTextCaption", rightTextCaption);
bundle.putString("leftIconName", leftIconName);
bundle.putString("rightIconName", rightIconName);
bundle.putBoolean("needColorizeIcon", needColorizeIcon);
bundle.putBoolean("enabled", enabled);
} }
@Override @Override
public void writeToParcel(Parcel dest, int f) { protected void readFromBundle(Bundle bundle) {
dest.writeInt(buttonId); buttonId = bundle.getInt("buttonId");
dest.writeString(leftTextCaption); leftTextCaption = bundle.getString("leftTextCaption");
dest.writeString(rightTextCaption); rightTextCaption = bundle.getString("rightTextCaption");
dest.writeString(leftIconName); leftIconName = bundle.getString("leftIconName");
dest.writeString(rightIconName); rightIconName = bundle.getString("rightIconName");
dest.writeInt(needColorizeIcon ? 1 : 0); needColorizeIcon = bundle.getBoolean("needColorizeIcon");
dest.writeInt(enabled ? 1 : 0); enabled = bundle.getBoolean("enabled");
}
private void readFromParcel(Parcel in) {
buttonId = in.readInt();
leftTextCaption = in.readString();
rightTextCaption = in.readString();
leftIconName = in.readString();
rightIconName = in.readString();
needColorizeIcon = in.readInt() != 0;
enabled = in.readInt() != 0;
}
@Override
public int describeContents() {
return 0;
} }
} }

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.contextmenu;
parcelable ContextMenuButtonsParams;

View file

@ -1,12 +1,14 @@
package net.osmand.aidl.contextmenu; package net.osmand.aidlapi.contextmenu;
import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
import net.osmand.aidlapi.AidlParams;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class ContextMenuButtonsParams implements Parcelable { public class ContextMenuButtonsParams extends AidlParams {
private AContextMenuButton leftButton; private AContextMenuButton leftButton;
private AContextMenuButton rightButton; private AContextMenuButton rightButton;
@ -17,7 +19,7 @@ public class ContextMenuButtonsParams implements Parcelable {
private long callbackId = -1L; private long callbackId = -1L;
private List<String> pointsIds = new ArrayList<>(); private ArrayList<String> pointsIds = new ArrayList<>();
public ContextMenuButtonsParams(AContextMenuButton leftButton, AContextMenuButton rightButton, String id, String appPackage, String layerId, long callbackId, List<String> pointsIds) { public ContextMenuButtonsParams(AContextMenuButton leftButton, AContextMenuButton rightButton, String id, String appPackage, String layerId, long callbackId, List<String> pointsIds) {
this.leftButton = leftButton; this.leftButton = leftButton;
@ -26,7 +28,9 @@ public class ContextMenuButtonsParams implements Parcelable {
this.appPackage = appPackage; this.appPackage = appPackage;
this.layerId = layerId; this.layerId = layerId;
this.callbackId = callbackId; this.callbackId = callbackId;
this.pointsIds = pointsIds; if (pointsIds != null) {
this.pointsIds.addAll(pointsIds);
}
} }
public ContextMenuButtonsParams(Parcel in) { public ContextMenuButtonsParams(Parcel in) {
@ -78,28 +82,25 @@ public class ContextMenuButtonsParams implements Parcelable {
} }
@Override @Override
public void writeToParcel(Parcel dest, int flags) { public void writeToBundle(Bundle bundle) {
dest.writeParcelable(leftButton, flags); bundle.putParcelable("leftButton", leftButton);
dest.writeParcelable(rightButton, flags); bundle.putParcelable("rightButton", rightButton);
dest.writeString(id); bundle.putString("id", id);
dest.writeString(appPackage); bundle.putString("appPackage", appPackage);
dest.writeString(layerId); bundle.putString("layerId", layerId);
dest.writeLong(callbackId); bundle.putLong("callbackId", callbackId);
dest.writeStringList(pointsIds); bundle.putStringArrayList("pointsIds", pointsIds);
}
private void readFromParcel(Parcel in) {
leftButton = in.readParcelable(AContextMenuButton.class.getClassLoader());
rightButton = in.readParcelable(AContextMenuButton.class.getClassLoader());
id = in.readString();
appPackage = in.readString();
layerId = in.readString();
callbackId = in.readLong();
in.readStringList(pointsIds);
} }
@Override @Override
public int describeContents() { protected void readFromBundle(Bundle bundle) {
return 0; bundle.setClassLoader(AContextMenuButton.class.getClassLoader());
leftButton = bundle.getParcelable("leftButton");
rightButton = bundle.getParcelable("rightButton");
id = bundle.getString("id");
appPackage = bundle.getString("appPackage");
layerId = bundle.getString("layerId");
callbackId = bundle.getLong("callbackId");
pointsIds = bundle.getStringArrayList("pointsIds");
} }
} }

View file

@ -1,3 +1,3 @@
package net.osmand.aidl.contextmenu; package net.osmand.aidlapi.contextmenu;
parcelable RemoveContextMenuButtonsParams; parcelable RemoveContextMenuButtonsParams;

View file

@ -0,0 +1,53 @@
package net.osmand.aidlapi.contextmenu;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveContextMenuButtonsParams extends AidlParams {
private String paramsId;
private long callbackId = -1L;
public RemoveContextMenuButtonsParams(String paramsId, long callbackId) {
this.paramsId = paramsId;
this.callbackId = callbackId;
}
public RemoveContextMenuButtonsParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveContextMenuButtonsParams> CREATOR = new Creator<RemoveContextMenuButtonsParams>() {
@Override
public RemoveContextMenuButtonsParams createFromParcel(Parcel in) {
return new RemoveContextMenuButtonsParams(in);
}
@Override
public RemoveContextMenuButtonsParams[] newArray(int size) {
return new RemoveContextMenuButtonsParams[size];
}
};
public String getParamsId() {
return paramsId;
}
public long getCallbackId() {
return callbackId;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("paramsId", paramsId);
bundle.putLong("callbackId", callbackId);
}
@Override
protected void readFromBundle(Bundle bundle) {
paramsId = bundle.getString("paramsId");
callbackId = bundle.getLong("callbackId");
}
}

View file

@ -1,3 +1,3 @@
package net.osmand.aidl.contextmenu; package net.osmand.aidlapi.contextmenu;
parcelable UpdateContextMenuButtonsParams; parcelable UpdateContextMenuButtonsParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.contextmenu;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class UpdateContextMenuButtonsParams extends AidlParams {
private ContextMenuButtonsParams buttonsParams;
public UpdateContextMenuButtonsParams(ContextMenuButtonsParams widget) {
this.buttonsParams = widget;
}
public UpdateContextMenuButtonsParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<UpdateContextMenuButtonsParams> CREATOR = new Creator<UpdateContextMenuButtonsParams>() {
@Override
public UpdateContextMenuButtonsParams createFromParcel(Parcel in) {
return new UpdateContextMenuButtonsParams(in);
}
@Override
public UpdateContextMenuButtonsParams[] newArray(int size) {
return new UpdateContextMenuButtonsParams[size];
}
};
public ContextMenuButtonsParams getContextMenuButtonsParams() {
return buttonsParams;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("buttonsParams", buttonsParams);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(ContextMenuButtonsParams.class.getClassLoader());
buttonsParams = bundle.getParcelable("buttonsParams");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.copyfile;
parcelable CopyFileParams;

View file

@ -1,10 +1,13 @@
package net.osmand.aidl.copyfile; package net.osmand.aidlapi.copyfile;
import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
public class CopyFileParams implements Parcelable { import net.osmand.aidlapi.AidlParams;
public class CopyFileParams extends AidlParams {
private String fileName; private String fileName;
private byte[] filePartData; private byte[] filePartData;
private long startTime; private long startTime;
@ -17,6 +20,22 @@ public class CopyFileParams implements Parcelable {
this.done = done; this.done = done;
} }
protected CopyFileParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<CopyFileParams> CREATOR = new Creator<CopyFileParams>() {
@Override
public CopyFileParams createFromParcel(Parcel in) {
return new CopyFileParams(in);
}
@Override
public CopyFileParams[] newArray(int size) {
return new CopyFileParams[size];
}
};
public String getFileName() { public String getFileName() {
return fileName; return fileName;
} }
@ -33,29 +52,20 @@ public class CopyFileParams implements Parcelable {
return startTime; return startTime;
} }
protected CopyFileParams(Parcel in) { @Override
fileName = in.readString(); public void writeToBundle(Bundle bundle) {
filePartData = in.createByteArray(); bundle.putString("fileName", fileName);
startTime = in.readLong(); bundle.putByteArray("filePartData", filePartData);
done = in.readByte() == 0; bundle.putLong("startTime", startTime);
bundle.putBoolean("done", done);
} }
public static final Creator<CopyFileParams> CREATOR = new Creator<CopyFileParams>() {
@Override
public CopyFileParams createFromParcel(Parcel in) {
return new CopyFileParams(in);
}
@Override
public CopyFileParams[] newArray(int size) {
return new CopyFileParams[size];
}
};
@Override @Override
public int describeContents() { protected void readFromBundle(Bundle bundle) {
return 0; fileName = bundle.getString("fileName");
filePartData = bundle.getByteArray("filePartData");
startTime = bundle.getLong("startTime");
done = bundle.getBoolean("done");
} }
@Override @Override
@ -67,12 +77,4 @@ public class CopyFileParams implements Parcelable {
", done=" + done + ", done=" + done +
" }"; " }";
} }
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(fileName);
dest.writeByteArray(filePartData);
dest.writeLong(startTime);
dest.writeByte((byte) (done ? 0 : 1));
}
} }

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.customization;
parcelable CustomizationInfoParams;

View file

@ -1,18 +1,18 @@
package net.osmand.aidl.customization; package net.osmand.aidlapi.customization;
import android.annotation.SuppressLint; import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
import net.osmand.aidl.navdrawer.NavDrawerFooterParams; import net.osmand.aidlapi.AidlParams;
import net.osmand.aidl.navdrawer.NavDrawerHeaderParams; import net.osmand.aidlapi.navdrawer.NavDrawerFooterParams;
import net.osmand.aidl.navdrawer.SetNavDrawerItemsParams; import net.osmand.aidlapi.navdrawer.NavDrawerHeaderParams;
import net.osmand.aidl.plugins.PluginParams; import net.osmand.aidlapi.navdrawer.SetNavDrawerItemsParams;
import net.osmand.aidlapi.plugins.PluginParams;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class CustomizationInfoParams implements Parcelable { public class CustomizationInfoParams extends AidlParams {
private OsmandSettingsParams settingsParams; private OsmandSettingsParams settingsParams;
@ -25,10 +25,10 @@ public class CustomizationInfoParams implements Parcelable {
private ArrayList<PluginParams> pluginsParams = new ArrayList<>(); private ArrayList<PluginParams> pluginsParams = new ArrayList<>();
private List<String> featuresEnabledIds = new ArrayList<>(); private ArrayList<String> featuresEnabledIds = new ArrayList<>();
private List<String> featuresDisabledIds = new ArrayList<>(); private ArrayList<String> featuresDisabledIds = new ArrayList<>();
private List<String> featuresEnabledPatterns = new ArrayList<>(); private ArrayList<String> featuresEnabledPatterns = new ArrayList<>();
private List<String> featuresDisabledPatterns = new ArrayList<>(); private ArrayList<String> featuresDisabledPatterns = new ArrayList<>();
public CustomizationInfoParams(OsmandSettingsParams settingsParams, public CustomizationInfoParams(OsmandSettingsParams settingsParams,
NavDrawerHeaderParams navDrawerHeaderParams, NavDrawerHeaderParams navDrawerHeaderParams,
@ -130,43 +130,44 @@ public class CustomizationInfoParams implements Parcelable {
} }
@Override @Override
public void writeToParcel(Parcel out, int flags) { public void writeToBundle(Bundle bundle) {
out.writeParcelable(settingsParams, flags); bundle.putParcelable("settingsParams", settingsParams);
out.writeParcelable(navDrawerHeaderParams, flags); bundle.putParcelable("navDrawerHeaderParams", navDrawerHeaderParams);
out.writeParcelable(navDrawerFooterParams, flags); bundle.putParcelable("navDrawerFooterParams", navDrawerFooterParams);
out.writeParcelable(navDrawerItemsParams, flags); bundle.putParcelable("navDrawerItemsParams", navDrawerItemsParams);
out.writeTypedList(visibilityWidgetsParams); bundle.putParcelableArrayList("visibilityWidgetsParams", visibilityWidgetsParams);
out.writeTypedList(availabilityWidgetsParams); bundle.putParcelableArrayList("availabilityWidgetsParams", availabilityWidgetsParams);
out.writeTypedList(pluginsParams); bundle.putParcelableArrayList("pluginsParams", pluginsParams);
out.writeStringList(featuresEnabledIds); bundle.putStringArrayList("featuresEnabledIds", featuresEnabledIds);
out.writeStringList(featuresDisabledIds); bundle.putStringArrayList("featuresDisabledIds", featuresDisabledIds);
out.writeStringList(featuresEnabledPatterns); bundle.putStringArrayList("featuresEnabledPatterns", featuresEnabledPatterns);
out.writeStringList(featuresDisabledPatterns); bundle.putStringArrayList("featuresDisabledPatterns", featuresDisabledPatterns);
}
@SuppressLint("ParcelClassLoader")
private void readFromParcel(Parcel in) {
settingsParams = in.readParcelable(OsmandSettingsParams.class.getClassLoader());
navDrawerHeaderParams = in.readParcelable(NavDrawerHeaderParams.class.getClassLoader());
navDrawerFooterParams = in.readParcelable(NavDrawerFooterParams.class.getClassLoader());
navDrawerItemsParams = in.readParcelable(SetNavDrawerItemsParams.class.getClassLoader());
in.readTypedList(visibilityWidgetsParams, SetWidgetsParams.CREATOR);
in.readTypedList(availabilityWidgetsParams, SetWidgetsParams.CREATOR);
in.readTypedList(pluginsParams, PluginParams.CREATOR);
in.readStringList(featuresEnabledIds);
in.readStringList(featuresDisabledIds);
in.readStringList(featuresEnabledPatterns);
in.readStringList(featuresDisabledPatterns);
} }
@Override @Override
public int describeContents() { protected void readFromBundle(Bundle bundle) {
return 0; bundle.setClassLoader(OsmandSettingsParams.class.getClassLoader());
settingsParams = bundle.getParcelable("settingsParams");
bundle.setClassLoader(NavDrawerHeaderParams.class.getClassLoader());
navDrawerHeaderParams = bundle.getParcelable("navDrawerHeaderParams");
bundle.setClassLoader(NavDrawerFooterParams.class.getClassLoader());
navDrawerFooterParams = bundle.getParcelable("navDrawerFooterParams");
bundle.setClassLoader(SetNavDrawerItemsParams.class.getClassLoader());
navDrawerItemsParams = bundle.getParcelable("navDrawerItemsParams");
bundle.setClassLoader(SetWidgetsParams.class.getClassLoader());
visibilityWidgetsParams = bundle.getParcelableArrayList("visibilityWidgetsParams");
availabilityWidgetsParams = bundle.getParcelableArrayList("availabilityWidgetsParams");
bundle.setClassLoader(PluginParams.class.getClassLoader());
pluginsParams = bundle.getParcelableArrayList("pluginsParams");
featuresEnabledIds = bundle.getStringArrayList("featuresEnabledIds");
featuresDisabledIds = bundle.getStringArrayList("featuresDisabledIds");
featuresEnabledPatterns = bundle.getStringArrayList("featuresEnabledPatterns");
featuresDisabledPatterns = bundle.getStringArrayList("featuresDisabledPatterns");
} }
} }

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.customization;
parcelable OsmandSettingsInfoParams;

View file

@ -1,11 +1,12 @@
package net.osmand.aidl.customization; package net.osmand.aidlapi.customization;
import android.annotation.SuppressLint; import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
public class OsmandSettingsInfoParams implements Parcelable { import net.osmand.aidlapi.AidlParams;
public class OsmandSettingsInfoParams extends AidlParams {
private String sharedPreferencesName; private String sharedPreferencesName;
@ -34,17 +35,12 @@ public class OsmandSettingsInfoParams implements Parcelable {
} }
@Override @Override
public void writeToParcel(Parcel out, int flags) { public void writeToBundle(Bundle bundle) {
out.writeString(sharedPreferencesName); bundle.putString("sharedPreferencesName", sharedPreferencesName);
}
@SuppressLint("ParcelClassLoader")
private void readFromParcel(Parcel in) {
sharedPreferencesName = in.readString();
} }
@Override @Override
public int describeContents() { protected void readFromBundle(Bundle bundle) {
return 0; sharedPreferencesName = bundle.getString("sharedPreferencesName");
} }
} }

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.customization;
parcelable OsmandSettingsParams;

View file

@ -1,20 +1,20 @@
package net.osmand.aidl.customization; package net.osmand.aidlapi.customization;
import android.annotation.SuppressLint;
import android.os.Bundle; import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
public class OsmandSettingsParams implements Parcelable { import net.osmand.aidlapi.AidlParams;
public class OsmandSettingsParams extends AidlParams {
private String sharedPreferencesName; private String sharedPreferencesName;
private Bundle bundle; private Bundle bundleSettings;
public OsmandSettingsParams(@NonNull String sharedPreferencesName, @Nullable Bundle bundle) { public OsmandSettingsParams(@NonNull String sharedPreferencesName, @Nullable Bundle bundle) {
this.sharedPreferencesName = sharedPreferencesName; this.sharedPreferencesName = sharedPreferencesName;
this.bundle = bundle; this.bundleSettings = bundle;
} }
public OsmandSettingsParams(Parcel in) { public OsmandSettingsParams(Parcel in) {
@ -38,23 +38,18 @@ public class OsmandSettingsParams implements Parcelable {
} }
public Bundle getBundle() { public Bundle getBundle() {
return bundle; return bundleSettings;
} }
@Override @Override
public void writeToParcel(Parcel out, int flags) { public void writeToBundle(Bundle bundle) {
out.writeString(sharedPreferencesName); bundle.putString("sharedPreferencesName", sharedPreferencesName);
out.writeBundle(bundle); bundle.putBundle("bundleSettings", bundleSettings);
}
@SuppressLint("ParcelClassLoader")
private void readFromParcel(Parcel in) {
sharedPreferencesName = in.readString();
bundle = in.readBundle();
} }
@Override @Override
public int describeContents() { protected void readFromBundle(Bundle bundle) {
return 0; sharedPreferencesName = bundle.getString("sharedPreferencesName");
bundleSettings = bundle.getBundle("bundleSettings");
} }
} }

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.customization;
parcelable SetWidgetsParams;

View file

@ -0,0 +1,59 @@
package net.osmand.aidlapi.customization;
import android.os.Bundle;
import android.os.Parcel;
import android.support.annotation.Nullable;
import net.osmand.aidlapi.AidlParams;
import java.util.ArrayList;
import java.util.List;
public class SetWidgetsParams extends AidlParams {
private String widgetKey;
private ArrayList<String> appModesKeys = new ArrayList<>();
public SetWidgetsParams(String widgetKey, @Nullable List<String> appModesKeys) {
this.widgetKey = widgetKey;
if (appModesKeys != null) {
this.appModesKeys.addAll(appModesKeys);
}
}
public SetWidgetsParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<SetWidgetsParams> CREATOR = new Creator<SetWidgetsParams>() {
@Override
public SetWidgetsParams createFromParcel(Parcel in) {
return new SetWidgetsParams(in);
}
@Override
public SetWidgetsParams[] newArray(int size) {
return new SetWidgetsParams[size];
}
};
public String getWidgetKey() {
return widgetKey;
}
public List<String> getAppModesKeys() {
return appModesKeys;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("widgetKey", widgetKey);
bundle.putStringArrayList("appModesKeys", appModesKeys);
}
@Override
protected void readFromBundle(Bundle bundle) {
widgetKey = bundle.getString("widgetKey");
appModesKeys = bundle.getStringArrayList("appModesKeys");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite;
parcelable AFavorite;

View file

@ -0,0 +1,94 @@
package net.osmand.aidlapi.favorite;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AFavorite extends AidlParams {
private double lat;
private double lon;
private String name;
private String description;
private String category;
private String color;
private boolean visible;
public AFavorite(double lat, double lon, String name, String description,
String category, String color, boolean visible) {
this.lat = lat;
this.lon = lon;
this.name = name;
this.description = description;
this.category = category;
this.color = color;
this.visible = visible;
}
public AFavorite(Parcel in) {
readFromParcel(in);
}
public static final Creator<AFavorite> CREATOR = new Creator<AFavorite>() {
@Override
public AFavorite createFromParcel(Parcel in) {
return new AFavorite(in);
}
@Override
public AFavorite[] newArray(int size) {
return new AFavorite[size];
}
};
public double getLat() {
return lat;
}
public double getLon() {
return lon;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public String getCategory() {
return category;
}
public String getColor() {
return color;
}
public boolean isVisible() {
return visible;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putDouble("lat", lat);
bundle.putDouble("lon", lon);
bundle.putString("name", name);
bundle.putString("description", description);
bundle.putString("category", category);
bundle.putString("color", color);
bundle.putBoolean("visible", visible);
}
@Override
protected void readFromBundle(Bundle bundle) {
lat = bundle.getDouble("lat");
lon = bundle.getDouble("lon");
name = bundle.getString("name");
description = bundle.getString("description");
category = bundle.getString("category");
color = bundle.getString("color");
visible = bundle.getBoolean("visible");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite;
parcelable AddFavoriteParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.favorite;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AddFavoriteParams extends AidlParams {
private AFavorite favorite;
public AddFavoriteParams(AFavorite favorite) {
this.favorite = favorite;
}
public AddFavoriteParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AddFavoriteParams> CREATOR = new Creator<AddFavoriteParams>() {
@Override
public AddFavoriteParams createFromParcel(Parcel in) {
return new AddFavoriteParams(in);
}
@Override
public AddFavoriteParams[] newArray(int size) {
return new AddFavoriteParams[size];
}
};
public AFavorite getFavorite() {
return favorite;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favorite", favorite);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavorite.class.getClassLoader());
favorite = bundle.getParcelable("favorite");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite;
parcelable RemoveFavoriteParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.favorite;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveFavoriteParams extends AidlParams {
private AFavorite favorite;
public RemoveFavoriteParams(AFavorite favorite) {
this.favorite = favorite;
}
public RemoveFavoriteParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveFavoriteParams> CREATOR = new Creator<RemoveFavoriteParams>() {
@Override
public RemoveFavoriteParams createFromParcel(Parcel in) {
return new RemoveFavoriteParams(in);
}
@Override
public RemoveFavoriteParams[] newArray(int size) {
return new RemoveFavoriteParams[size];
}
};
public AFavorite getFavorite() {
return favorite;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favorite", favorite);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavorite.class.getClassLoader());
favorite = bundle.getParcelable("favorite");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite;
parcelable UpdateFavoriteParams;

View file

@ -0,0 +1,54 @@
package net.osmand.aidlapi.favorite;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class UpdateFavoriteParams extends AidlParams {
private AFavorite favoritePrev;
private AFavorite favoriteNew;
public UpdateFavoriteParams(AFavorite favoritePrev, AFavorite favoriteNew) {
this.favoritePrev = favoritePrev;
this.favoriteNew = favoriteNew;
}
public UpdateFavoriteParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<UpdateFavoriteParams> CREATOR = new Creator<UpdateFavoriteParams>() {
@Override
public UpdateFavoriteParams createFromParcel(Parcel in) {
return new UpdateFavoriteParams(in);
}
@Override
public UpdateFavoriteParams[] newArray(int size) {
return new UpdateFavoriteParams[size];
}
};
public AFavorite getFavoritePrev() {
return favoritePrev;
}
public AFavorite getFavoriteNew() {
return favoriteNew;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favoritePrev", favoritePrev);
bundle.putParcelable("favoriteNew", favoriteNew);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavorite.class.getClassLoader());
favoritePrev = bundle.getParcelable("favoritePrev");
favoriteNew = bundle.getParcelable("favoriteNew");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite.group;
parcelable AFavoriteGroup;

View file

@ -0,0 +1,61 @@
package net.osmand.aidlapi.favorite.group;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AFavoriteGroup extends AidlParams {
private String name;
private String color;
private boolean visible;
public AFavoriteGroup(String name, String color, boolean visible) {
this.name = name;
this.color = color;
this.visible = visible;
}
public AFavoriteGroup(Parcel in) {
readFromParcel(in);
}
public static final Creator<AFavoriteGroup> CREATOR = new Creator<AFavoriteGroup>() {
@Override
public AFavoriteGroup createFromParcel(Parcel in) {
return new AFavoriteGroup(in);
}
@Override
public AFavoriteGroup[] newArray(int size) {
return new AFavoriteGroup[size];
}
};
public String getName() {
return name;
}
public String getColor() {
return color;
}
public boolean isVisible() {
return visible;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("name", name);
bundle.putString("color", color);
bundle.putBoolean("visible", visible);
}
@Override
protected void readFromBundle(Bundle bundle) {
name = bundle.getString("name");
color = bundle.getString("color");
visible = bundle.getBoolean("visible");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite.group;
parcelable AddFavoriteGroupParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.favorite.group;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AddFavoriteGroupParams extends AidlParams {
private AFavoriteGroup favoriteGroup;
public AddFavoriteGroupParams(AFavoriteGroup favoriteGroup) {
this.favoriteGroup = favoriteGroup;
}
public AddFavoriteGroupParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AddFavoriteGroupParams> CREATOR = new Creator<AddFavoriteGroupParams>() {
@Override
public AddFavoriteGroupParams createFromParcel(Parcel in) {
return new AddFavoriteGroupParams(in);
}
@Override
public AddFavoriteGroupParams[] newArray(int size) {
return new AddFavoriteGroupParams[size];
}
};
public AFavoriteGroup getFavoriteGroup() {
return favoriteGroup;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favoriteGroup", favoriteGroup);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavoriteGroup.class.getClassLoader());
favoriteGroup = bundle.getParcelable("favoriteGroup");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite.group;
parcelable RemoveFavoriteGroupParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.favorite.group;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveFavoriteGroupParams extends AidlParams {
private AFavoriteGroup favoriteGroup;
public RemoveFavoriteGroupParams(AFavoriteGroup favoriteGroup) {
this.favoriteGroup = favoriteGroup;
}
public RemoveFavoriteGroupParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveFavoriteGroupParams> CREATOR = new Creator<RemoveFavoriteGroupParams>() {
@Override
public RemoveFavoriteGroupParams createFromParcel(Parcel in) {
return new RemoveFavoriteGroupParams(in);
}
@Override
public RemoveFavoriteGroupParams[] newArray(int size) {
return new RemoveFavoriteGroupParams[size];
}
};
public AFavoriteGroup getFavoriteGroup() {
return favoriteGroup;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favoriteGroup", favoriteGroup);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavoriteGroup.class.getClassLoader());
favoriteGroup = bundle.getParcelable("favoriteGroup");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite.group;
parcelable UpdateFavoriteGroupParams;

View file

@ -0,0 +1,54 @@
package net.osmand.aidlapi.favorite.group;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class UpdateFavoriteGroupParams extends AidlParams {
private AFavoriteGroup favoriteGroupPrev;
private AFavoriteGroup favoriteGroupNew;
public UpdateFavoriteGroupParams(AFavoriteGroup favoriteGroup, AFavoriteGroup favoriteGroupNew) {
this.favoriteGroupPrev = favoriteGroup;
this.favoriteGroupNew = favoriteGroupNew;
}
public UpdateFavoriteGroupParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<UpdateFavoriteGroupParams> CREATOR = new Creator<UpdateFavoriteGroupParams>() {
@Override
public UpdateFavoriteGroupParams createFromParcel(Parcel in) {
return new UpdateFavoriteGroupParams(in);
}
@Override
public UpdateFavoriteGroupParams[] newArray(int size) {
return new UpdateFavoriteGroupParams[size];
}
};
public AFavoriteGroup getFavoriteGroupPrev() {
return favoriteGroupPrev;
}
public AFavoriteGroup getFavoriteGroupNew() {
return favoriteGroupNew;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favoriteGroupPrev", favoriteGroupPrev);
bundle.putParcelable("favoriteGroupNew", favoriteGroupNew);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavoriteGroup.class.getClassLoader());
favoriteGroupPrev = bundle.getParcelable("favoriteGroupPrev");
favoriteGroupNew = bundle.getParcelable("favoriteGroupNew");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable AGpxBitmap;

View file

@ -0,0 +1,48 @@
package net.osmand.aidlapi.gpx;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Parcel;
import android.support.annotation.NonNull;
import net.osmand.aidlapi.AidlParams;
public class AGpxBitmap extends AidlParams {
private Bitmap bitmap;
public AGpxBitmap(@NonNull Bitmap bitmap) {
this.bitmap = bitmap;
}
public AGpxBitmap(Parcel in) {
readFromParcel(in);
}
public Bitmap getBitmap() {
return bitmap;
}
public static final Creator<AGpxBitmap> CREATOR = new Creator<AGpxBitmap>() {
@Override
public AGpxBitmap createFromParcel(Parcel in) {
return new AGpxBitmap(in);
}
@Override
public AGpxBitmap[] newArray(int size) {
return new AGpxBitmap[size];
}
};
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("bitmap", bitmap);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(Bitmap.class.getClassLoader());
bitmap = bundle.getParcelable("bitmap");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable AGpxFile;

View file

@ -0,0 +1,88 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import net.osmand.aidlapi.AidlParams;
public class AGpxFile extends AidlParams {
private String fileName;
private long modifiedTime;
private long fileSize;
private boolean active;
private String color;
private AGpxFileDetails details;
public AGpxFile(@NonNull String fileName, long modifiedTime, long fileSize, boolean active, String color, @Nullable AGpxFileDetails details) {
this.fileName = fileName;
this.modifiedTime = modifiedTime;
this.fileSize = fileSize;
this.active = active;
this.color = color;
this.details = details;
}
public AGpxFile(Parcel in) {
readFromParcel(in);
}
public static final Creator<AGpxFile> CREATOR = new Creator<AGpxFile>() {
@Override
public AGpxFile createFromParcel(Parcel in) {
return new AGpxFile(in);
}
@Override
public AGpxFile[] newArray(int size) {
return new AGpxFile[size];
}
};
public String getFileName() {
return fileName;
}
public long getModifiedTime() {
return modifiedTime;
}
public long getFileSize() {
return fileSize;
}
public boolean isActive() {
return active;
}
public String getColor() {
return color;
}
public AGpxFileDetails getDetails() {
return details;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("fileName", fileName);
bundle.putLong("modifiedTime", modifiedTime);
bundle.putLong("fileSize", fileSize);
bundle.putBoolean("active", active);
bundle.putParcelable("details", details);
bundle.putString("color", color);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AGpxFileDetails.class.getClassLoader());
fileName = bundle.getString("fileName");
modifiedTime = bundle.getLong("modifiedTime");
fileSize = bundle.getLong("fileSize");
active = bundle.getBoolean("active");
details = bundle.getParcelable("details");
color = bundle.getString("color");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable AGpxFileDetails;

View file

@ -0,0 +1,197 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public class AGpxFileDetails extends AidlParams {
private float totalDistance = 0;
private int totalTracks = 0;
private long startTime = Long.MAX_VALUE;
private long endTime = Long.MIN_VALUE;
private long timeSpan = 0;
private long timeMoving = 0;
private float totalDistanceMoving = 0;
private double diffElevationUp = 0;
private double diffElevationDown = 0;
private double avgElevation = 0;
private double minElevation = 99999;
private double maxElevation = -100;
private float minSpeed = Float.MAX_VALUE;
private float maxSpeed = 0;
private float avgSpeed;
private int points;
private int wptPoints = 0;
private ArrayList<String> wptCategoryNames = new ArrayList<>();
public AGpxFileDetails(float totalDistance, int totalTracks,
long startTime, long endTime,
long timeSpan, long timeMoving, float totalDistanceMoving,
double diffElevationUp, double diffElevationDown,
double avgElevation, double minElevation, double maxElevation,
float minSpeed, float maxSpeed, float avgSpeed,
int points, int wptPoints, Set<String> wptCategoryNames) {
this.totalDistance = totalDistance;
this.totalTracks = totalTracks;
this.startTime = startTime;
this.endTime = endTime;
this.timeSpan = timeSpan;
this.timeMoving = timeMoving;
this.totalDistanceMoving = totalDistanceMoving;
this.diffElevationUp = diffElevationUp;
this.diffElevationDown = diffElevationDown;
this.avgElevation = avgElevation;
this.minElevation = minElevation;
this.maxElevation = maxElevation;
this.minSpeed = minSpeed;
this.maxSpeed = maxSpeed;
this.avgSpeed = avgSpeed;
this.points = points;
this.wptPoints = wptPoints;
if (wptCategoryNames != null) {
this.wptCategoryNames.addAll(wptCategoryNames);
}
}
public AGpxFileDetails(Parcel in) {
readFromParcel(in);
}
public static final Creator<AGpxFileDetails> CREATOR = new Creator<AGpxFileDetails>() {
@Override
public AGpxFileDetails createFromParcel(Parcel in) {
return new AGpxFileDetails(in);
}
@Override
public AGpxFileDetails[] newArray(int size) {
return new AGpxFileDetails[size];
}
};
public float getTotalDistance() {
return totalDistance;
}
public int getTotalTracks() {
return totalTracks;
}
public long getStartTime() {
return startTime;
}
public long getEndTime() {
return endTime;
}
public long getTimeSpan() {
return timeSpan;
}
public long getTimeMoving() {
return timeMoving;
}
public float getTotalDistanceMoving() {
return totalDistanceMoving;
}
public double getDiffElevationUp() {
return diffElevationUp;
}
public double getDiffElevationDown() {
return diffElevationDown;
}
public double getAvgElevation() {
return avgElevation;
}
public double getMinElevation() {
return minElevation;
}
public double getMaxElevation() {
return maxElevation;
}
public float getMinSpeed() {
return minSpeed;
}
public float getMaxSpeed() {
return maxSpeed;
}
public float getAvgSpeed() {
return avgSpeed;
}
public int getPoints() {
return points;
}
public int getWptPoints() {
return wptPoints;
}
public List<String> getWptCategoryNames() {
return wptCategoryNames;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putFloat("totalDistance", totalDistance);
bundle.putInt("totalTracks", totalTracks);
bundle.putLong("startTime", startTime);
bundle.putLong("endTime", endTime);
bundle.putLong("timeSpan", timeSpan);
bundle.putLong("timeMoving", timeMoving);
bundle.putFloat("totalDistanceMoving", totalDistanceMoving);
bundle.putDouble("diffElevationUp", diffElevationUp);
bundle.putDouble("diffElevationDown", diffElevationDown);
bundle.putDouble("avgElevation", avgElevation);
bundle.putDouble("minElevation", minElevation);
bundle.putDouble("maxElevation", maxElevation);
bundle.putFloat("minSpeed", minSpeed);
bundle.putFloat("maxSpeed", maxSpeed);
bundle.putFloat("avgSpeed", avgSpeed);
bundle.putInt("points", points);
bundle.putInt("wptPoints", wptPoints);
bundle.putStringArrayList("wptCategoryNames", wptCategoryNames);
}
@Override
protected void readFromBundle(Bundle bundle) {
totalDistance = bundle.getFloat("totalDistance");
totalTracks = bundle.getInt("totalTracks");
startTime = bundle.getLong("startTime");
endTime = bundle.getLong("endTime");
timeSpan = bundle.getLong("timeSpan");
timeMoving = bundle.getLong("timeMoving");
totalDistanceMoving = bundle.getFloat("totalDistanceMoving");
diffElevationUp = bundle.getDouble("diffElevationUp");
diffElevationDown = bundle.getDouble("diffElevationDown");
avgElevation = bundle.getDouble("avgElevation");
minElevation = bundle.getDouble("minElevation");
maxElevation = bundle.getDouble("maxElevation");
minSpeed = bundle.getFloat("minSpeed");
maxSpeed = bundle.getFloat("maxSpeed");
avgSpeed = bundle.getFloat("avgSpeed");
points = bundle.getInt("points");
wptPoints = bundle.getInt("wptPoints");
wptCategoryNames = bundle.getStringArrayList("wptCategoryNames");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable ASelectedGpxFile;

View file

@ -0,0 +1,76 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import net.osmand.aidlapi.AidlParams;
public class ASelectedGpxFile extends AidlParams {
private String fileName;
private long modifiedTime;
private long fileSize;
private AGpxFileDetails details;
public ASelectedGpxFile(@NonNull String fileName) {
this.fileName = fileName;
}
public ASelectedGpxFile(@NonNull String fileName, long modifiedTime, long fileSize, @Nullable AGpxFileDetails details) {
this.fileName = fileName;
this.modifiedTime = modifiedTime;
this.fileSize = fileSize;
this.details = details;
}
public ASelectedGpxFile(Parcel in) {
readFromParcel(in);
}
public static final Creator<ASelectedGpxFile> CREATOR = new Creator<ASelectedGpxFile>() {
@Override
public ASelectedGpxFile createFromParcel(Parcel in) {
return new ASelectedGpxFile(in);
}
@Override
public ASelectedGpxFile[] newArray(int size) {
return new ASelectedGpxFile[size];
}
};
public String getFileName() {
return fileName;
}
public long getModifiedTime() {
return modifiedTime;
}
public long getFileSize() {
return fileSize;
}
public AGpxFileDetails getDetails() {
return details;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("fileName", fileName);
bundle.putLong("modifiedTime", modifiedTime);
bundle.putLong("fileSize", fileSize);
bundle.putParcelable("details", details);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AGpxFileDetails.class.getClassLoader());
fileName = bundle.getString("fileName");
modifiedTime = bundle.getLong("modifiedTime");
fileSize = bundle.getLong("fileSize");
details = bundle.getParcelable("details");
}
}

View file

@ -1,3 +1,3 @@
package net.osmand.aidl.gpx; package net.osmand.aidlapi.gpx;
parcelable CreateGpxBitmapParams; parcelable CreateGpxBitmapParams;

View file

@ -1,12 +1,14 @@
package net.osmand.aidl.gpx; package net.osmand.aidlapi.gpx;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
import net.osmand.aidlapi.AidlParams;
import java.io.File; import java.io.File;
public class CreateGpxBitmapParams implements Parcelable { public class CreateGpxBitmapParams extends AidlParams {
private File gpxFile; private File gpxFile;
private Uri gpxUri; private Uri gpxUri;
@ -35,16 +37,17 @@ public class CreateGpxBitmapParams implements Parcelable {
readFromParcel(in); readFromParcel(in);
} }
public static final Creator<CreateGpxBitmapParams> CREATOR = new public static final Creator<CreateGpxBitmapParams> CREATOR = new Creator<CreateGpxBitmapParams>() {
Creator<CreateGpxBitmapParams>() { @Override
public CreateGpxBitmapParams createFromParcel(Parcel in) { public CreateGpxBitmapParams createFromParcel(Parcel in) {
return new CreateGpxBitmapParams(in); return new CreateGpxBitmapParams(in);
} }
public CreateGpxBitmapParams[] newArray(int size) { @Override
return new CreateGpxBitmapParams[size]; public CreateGpxBitmapParams[] newArray(int size) {
} return new CreateGpxBitmapParams[size];
}; }
};
public File getGpxFile() { public File getGpxFile() {
return gpxFile; return gpxFile;
@ -70,32 +73,28 @@ public class CreateGpxBitmapParams implements Parcelable {
return color; return color;
} }
public void writeToParcel(Parcel out, int flags) { @Override
if (gpxFile != null) { public void writeToBundle(Bundle bundle) {
out.writeString(gpxFile.getAbsolutePath()); bundle.putString("gpxAbsolutePath", gpxFile != null ? gpxFile.getAbsolutePath() : null);
} else { bundle.putParcelable("gpxUri", gpxUri);
out.writeString(null); bundle.putFloat("density", density);
} bundle.putInt("widthPixels", widthPixels);
out.writeParcelable(gpxUri, flags); bundle.putInt("heightPixels", heightPixels);
out.writeFloat(density); bundle.putInt("color", color);
out.writeInt(widthPixels);
out.writeInt(heightPixels);
out.writeInt(color);
} }
private void readFromParcel(Parcel in) { @Override
String gpxAbsolutePath = in.readString(); protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(Uri.class.getClassLoader());
String gpxAbsolutePath = bundle.getString("gpxAbsolutePath");
if (gpxAbsolutePath != null) { if (gpxAbsolutePath != null) {
gpxFile = new File(gpxAbsolutePath); gpxFile = new File(gpxAbsolutePath);
} }
gpxUri = in.readParcelable(Uri.class.getClassLoader()); gpxUri = bundle.getParcelable("gpxUri");
density = in.readFloat(); density = bundle.getFloat("density");
widthPixels = in.readInt(); widthPixels = bundle.getInt("widthPixels");
heightPixels = in.readInt(); heightPixels = bundle.getInt("heightPixels");
color = in.readInt(); color = bundle.getInt("color");
}
public int describeContents() {
return 0;
} }
} }

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable HideGpxParams;

View file

@ -0,0 +1,45 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class HideGpxParams extends AidlParams {
private String fileName;
public HideGpxParams(String fileName) {
this.fileName = fileName;
}
public HideGpxParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<HideGpxParams> CREATOR = new Creator<HideGpxParams>() {
@Override
public HideGpxParams createFromParcel(Parcel in) {
return new HideGpxParams(in);
}
@Override
public HideGpxParams[] newArray(int size) {
return new HideGpxParams[size];
}
};
public String getFileName() {
return fileName;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("fileName", fileName);
}
@Override
protected void readFromBundle(Bundle bundle) {
fileName = bundle.getString("fileName");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable ImportGpxParams;

View file

@ -1,12 +1,14 @@
package net.osmand.aidl.gpx; package net.osmand.aidlapi.gpx;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
import net.osmand.aidlapi.AidlParams;
import java.io.File; import java.io.File;
public class ImportGpxParams implements Parcelable { public class ImportGpxParams extends AidlParams {
private File gpxFile; private File gpxFile;
private Uri gpxUri; private Uri gpxUri;
@ -40,16 +42,17 @@ public class ImportGpxParams implements Parcelable {
readFromParcel(in); readFromParcel(in);
} }
public static final Creator<ImportGpxParams> CREATOR = new public static final Creator<ImportGpxParams> CREATOR = new Creator<ImportGpxParams>() {
Creator<ImportGpxParams>() { @Override
public ImportGpxParams createFromParcel(Parcel in) { public ImportGpxParams createFromParcel(Parcel in) {
return new ImportGpxParams(in); return new ImportGpxParams(in);
} }
public ImportGpxParams[] newArray(int size) { @Override
return new ImportGpxParams[size]; public ImportGpxParams[] newArray(int size) {
} return new ImportGpxParams[size];
}; }
};
public File getGpxFile() { public File getGpxFile() {
return gpxFile; return gpxFile;
@ -75,32 +78,28 @@ public class ImportGpxParams implements Parcelable {
return show; return show;
} }
public void writeToParcel(Parcel out, int flags) { @Override
if (gpxFile != null) { protected void readFromBundle(Bundle bundle) {
out.writeString(gpxFile.getAbsolutePath()); bundle.setClassLoader(Uri.class.getClassLoader());
} else {
out.writeString(null);
}
out.writeParcelable(gpxUri, flags);
out.writeString(sourceRawData);
out.writeString(destinationPath);
out.writeString(color);
out.writeByte((byte) (show ? 1 : 0));
}
private void readFromParcel(Parcel in) { String gpxAbsolutePath = bundle.getString("gpxAbsolutePath");
String gpxAbsolutePath = in.readString();
if (gpxAbsolutePath != null) { if (gpxAbsolutePath != null) {
gpxFile = new File(gpxAbsolutePath); gpxFile = new File(gpxAbsolutePath);
} }
gpxUri = in.readParcelable(Uri.class.getClassLoader()); gpxUri = bundle.getParcelable("gpxUri");
sourceRawData = in.readString(); sourceRawData = bundle.getString("sourceRawData");
destinationPath = in.readString(); destinationPath = bundle.getString("destinationPath");
color = in.readString(); color = bundle.getString("color");
show = in.readByte() == 1; show = bundle.getBoolean("show");
} }
public int describeContents() { @Override
return 0; public void writeToBundle(Bundle bundle) {
bundle.putString("gpxAbsolutePath", gpxFile != null ? gpxFile.getAbsolutePath() : null);
bundle.putParcelable("gpxUri", gpxUri);
bundle.putString("sourceRawData", sourceRawData);
bundle.putString("destinationPath", destinationPath);
bundle.putString("color", color);
bundle.putBoolean("show", show);
} }
} }

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable RemoveGpxParams;

View file

@ -0,0 +1,45 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveGpxParams extends AidlParams {
private String fileName;
public RemoveGpxParams(String fileName) {
this.fileName = fileName;
}
public RemoveGpxParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveGpxParams> CREATOR = new Creator<RemoveGpxParams>() {
@Override
public RemoveGpxParams createFromParcel(Parcel in) {
return new RemoveGpxParams(in);
}
@Override
public RemoveGpxParams[] newArray(int size) {
return new RemoveGpxParams[size];
}
};
public String getFileName() {
return fileName;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("fileName", fileName);
}
@Override
protected void readFromBundle(Bundle bundle) {
fileName = bundle.getString("fileName");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable ShowGpxParams;

View file

@ -0,0 +1,45 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class ShowGpxParams extends AidlParams {
private String fileName;
public ShowGpxParams(String fileName) {
this.fileName = fileName;
}
public ShowGpxParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<ShowGpxParams> CREATOR = new Creator<ShowGpxParams>() {
@Override
public ShowGpxParams createFromParcel(Parcel in) {
return new ShowGpxParams(in);
}
@Override
public ShowGpxParams[] newArray(int size) {
return new ShowGpxParams[size];
}
};
public String getFileName() {
return fileName;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("fileName", fileName);
}
@Override
protected void readFromBundle(Bundle bundle) {
fileName = bundle.getString("fileName");
}
}

View file

@ -1,3 +1,3 @@
package net.osmand.aidl.gpx; package net.osmand.aidlapi.gpx;
parcelable StartGpxRecordingParams; parcelable StartGpxRecordingParams;

View file

@ -1,9 +1,10 @@
package net.osmand.aidl.gpx; package net.osmand.aidlapi.gpx;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
public class StartGpxRecordingParams implements Parcelable { import net.osmand.aidlapi.AidlParams;
public class StartGpxRecordingParams extends AidlParams {
public StartGpxRecordingParams() { public StartGpxRecordingParams() {
@ -24,17 +25,4 @@ public class StartGpxRecordingParams implements Parcelable {
return new StartGpxRecordingParams[size]; return new StartGpxRecordingParams[size];
} }
}; };
@Override
public void writeToParcel(Parcel out, int flags) {
}
private void readFromParcel(Parcel in) {
}
@Override
public int describeContents() {
return 0;
}
} }

View file

@ -1,3 +1,3 @@
package net.osmand.aidl.gpx; package net.osmand.aidlapi.gpx;
parcelable StopGpxRecordingParams; parcelable StopGpxRecordingParams;

View file

@ -1,9 +1,10 @@
package net.osmand.aidl.gpx; package net.osmand.aidlapi.gpx;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
public class StopGpxRecordingParams implements Parcelable { import net.osmand.aidlapi.AidlParams;
public class StopGpxRecordingParams extends AidlParams {
public StopGpxRecordingParams() { public StopGpxRecordingParams() {
@ -24,17 +25,4 @@ public class StopGpxRecordingParams implements Parcelable {
return new StopGpxRecordingParams[size]; return new StopGpxRecordingParams[size];
} }
}; };
@Override
public void writeToParcel(Parcel out, int flags) {
}
private void readFromParcel(Parcel in) {
}
@Override
public int describeContents() {
return 0;
}
} }

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.map;
parcelable ALatLon;

View file

@ -1,9 +1,11 @@
package net.osmand.aidl.map; package net.osmand.aidlapi.map;
import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
public class ALatLon implements Parcelable { import net.osmand.aidlapi.AidlParams;
public class ALatLon extends AidlParams {
private double longitude; private double longitude;
private double latitude; private double latitude;
@ -17,25 +19,26 @@ public class ALatLon implements Parcelable {
readFromParcel(in); readFromParcel(in);
} }
public static final Parcelable.Creator<ALatLon> CREATOR = new public static final Creator<ALatLon> CREATOR = new Creator<ALatLon>() {
Parcelable.Creator<ALatLon>() { @Override
public ALatLon createFromParcel(Parcel in) { public ALatLon createFromParcel(Parcel in) {
return new ALatLon(in); return new ALatLon(in);
} }
public ALatLon[] newArray(int size) { @Override
return new ALatLon[size]; public ALatLon[] newArray(int size) {
} return new ALatLon[size];
}; }
};
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
int result = 1; int result = 1;
int temp; int temp;
temp = (int)Math.floor(latitude * 10000); temp = (int) Math.floor(latitude * 10000);
result = prime * result + temp; result = prime * result + temp;
temp = (int)Math.floor(longitude * 10000); temp = (int) Math.floor(longitude * 10000);
result = prime * result + temp; result = prime * result + temp;
return result; return result;
} }
@ -56,7 +59,7 @@ public class ALatLon implements Parcelable {
@Override @Override
public String toString() { public String toString() {
return "Lat " + ((float)latitude) + " Lon " + ((float)longitude); return "Lat " + ((float) latitude) + " Lon " + ((float) longitude);
} }
public double getLatitude() { public double getLatitude() {
@ -67,17 +70,15 @@ public class ALatLon implements Parcelable {
return longitude; return longitude;
} }
public void writeToParcel(Parcel out, int flags) { @Override
out.writeDouble(latitude); public void writeToBundle(Bundle bundle) {
out.writeDouble(longitude); bundle.putDouble("latitude", latitude);
bundle.putDouble("longitude", longitude);
} }
public void readFromParcel(Parcel in) { @Override
latitude = in.readDouble(); protected void readFromBundle(Bundle bundle) {
longitude = in.readDouble(); latitude = bundle.getDouble("latitude");
} longitude = bundle.getDouble("longitude");
public int describeContents() {
return 0;
} }
} }

View file

@ -1,3 +1,3 @@
package net.osmand.aidl.map; package net.osmand.aidlapi.map;
parcelable SetMapLocationParams; parcelable SetMapLocationParams;

View file

@ -0,0 +1,69 @@
package net.osmand.aidlapi.map;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class SetMapLocationParams extends AidlParams {
private double latitude;
private double longitude;
private int zoom;
private boolean animated;
public SetMapLocationParams(double latitude, double longitude, int zoom, boolean animated) {
this.latitude = latitude;
this.longitude = longitude;
this.zoom = zoom;
this.animated = animated;
}
public SetMapLocationParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<SetMapLocationParams> CREATOR = new Creator<SetMapLocationParams>() {
@Override
public SetMapLocationParams createFromParcel(Parcel in) {
return new SetMapLocationParams(in);
}
@Override
public SetMapLocationParams[] newArray(int size) {
return new SetMapLocationParams[size];
}
};
public double getLatitude() {
return latitude;
}
public double getLongitude() {
return longitude;
}
public int getZoom() {
return zoom;
}
public boolean isAnimated() {
return animated;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putDouble("latitude", latitude);
bundle.putDouble("longitude", longitude);
bundle.putInt("zoom", zoom);
bundle.putBoolean("animated", animated);
}
@Override
protected void readFromBundle(Bundle bundle) {
latitude = bundle.getDouble("latitude");
longitude = bundle.getDouble("longitude");
zoom = bundle.getInt("zoom");
animated = bundle.getBoolean("animated");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer;
parcelable AMapLayer;

View file

@ -1,16 +1,18 @@
package net.osmand.aidl.maplayer; package net.osmand.aidlapi.maplayer;
import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
import net.osmand.aidl.maplayer.point.AMapPoint; import net.osmand.aidlapi.AidlParams;
import net.osmand.aidlapi.maplayer.point.AMapPoint;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
public class AMapLayer implements Parcelable { public class AMapLayer extends AidlParams {
private String id; private String id;
private String name; private String name;
private float zOrder = 5.5f; private float zOrder = 5.5f;
@ -39,16 +41,17 @@ public class AMapLayer implements Parcelable {
readFromParcel(in); readFromParcel(in);
} }
public static final Parcelable.Creator<AMapLayer> CREATOR = new public static final Creator<AMapLayer> CREATOR = new Creator<AMapLayer>() {
Parcelable.Creator<AMapLayer>() { @Override
public AMapLayer createFromParcel(Parcel in) { public AMapLayer createFromParcel(Parcel in) {
return new AMapLayer(in); return new AMapLayer(in);
} }
public AMapLayer[] newArray(int size) { @Override
return new AMapLayer[size]; public AMapLayer[] newArray(int size) {
} return new AMapLayer[size];
}; }
};
public String getId() { public String getId() {
return id; return id;
@ -138,39 +141,40 @@ public class AMapLayer implements Parcelable {
return bigPointMaxZoom; return bigPointMaxZoom;
} }
public void writeToParcel(Parcel out, int flags) { @Override
out.writeString(id); public void writeToBundle(Bundle bundle) {
out.writeString(name); bundle.putString("id", id);
out.writeFloat(zOrder); bundle.putString("name", name);
out.writeTypedList(new ArrayList<>(points.values())); bundle.putFloat("zOrder", zOrder);
out.writeByte((byte) (imagePoints ? 1 : 0)); bundle.putParcelableArrayList("points", new ArrayList<>(points.values()));
out.writeInt(circlePointMinZoom); bundle.putBoolean("imagePoints", imagePoints);
out.writeInt(circlePointMaxZoom); bundle.putInt("circlePointMinZoom", circlePointMinZoom);
out.writeInt(smallPointMinZoom); bundle.putInt("circlePointMaxZoom", circlePointMaxZoom);
out.writeInt(smallPointMaxZoom); bundle.putInt("smallPointMinZoom", smallPointMinZoom);
out.writeInt(bigPointMinZoom); bundle.putInt("smallPointMaxZoom", smallPointMaxZoom);
out.writeInt(bigPointMaxZoom); bundle.putInt("bigPointMinZoom", bigPointMinZoom);
bundle.putInt("bigPointMaxZoom", bigPointMaxZoom);
} }
private void readFromParcel(Parcel in) { @Override
id = in.readString(); protected void readFromBundle(Bundle bundle) {
name = in.readString(); id = bundle.getString("id");
zOrder = in.readFloat(); name = bundle.getString("name");
List<AMapPoint> pointList = new ArrayList<>(); zOrder = bundle.getFloat("zOrder");
in.readTypedList(pointList, AMapPoint.CREATOR); imagePoints = bundle.getBoolean("imagePoints");
for (AMapPoint p : pointList) { circlePointMinZoom = bundle.getInt("circlePointMinZoom");
this.points.put(p.getId(), p); circlePointMaxZoom = bundle.getInt("circlePointMaxZoom");
smallPointMinZoom = bundle.getInt("smallPointMinZoom");
smallPointMaxZoom = bundle.getInt("smallPointMaxZoom");
bigPointMinZoom = bundle.getInt("bigPointMinZoom");
bigPointMaxZoom = bundle.getInt("bigPointMaxZoom");
bundle.setClassLoader(AMapPoint.class.getClassLoader());
List<AMapPoint> pointList = bundle.getParcelableArrayList("points");
if (pointList != null) {
for (AMapPoint p : pointList) {
this.points.put(p.getId(), p);
}
} }
imagePoints = in.readByte() == 1;
circlePointMinZoom = in.readInt();
circlePointMaxZoom = in.readInt();
smallPointMinZoom = in.readInt();
smallPointMaxZoom = in.readInt();
bigPointMinZoom = in.readInt();
bigPointMaxZoom = in.readInt();
}
public int describeContents() {
return 0;
} }
} }

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer;
parcelable AddMapLayerParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.maplayer;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AddMapLayerParams extends AidlParams {
private AMapLayer layer;
public AddMapLayerParams(AMapLayer layer) {
this.layer = layer;
}
public AddMapLayerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AddMapLayerParams> CREATOR = new Creator<AddMapLayerParams>() {
@Override
public AddMapLayerParams createFromParcel(Parcel in) {
return new AddMapLayerParams(in);
}
@Override
public AddMapLayerParams[] newArray(int size) {
return new AddMapLayerParams[size];
}
};
public AMapLayer getLayer() {
return layer;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("layer", layer);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapLayer.class.getClassLoader());
layer = bundle.getParcelable("layer");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer;
parcelable RemoveMapLayerParams;

View file

@ -0,0 +1,45 @@
package net.osmand.aidlapi.maplayer;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveMapLayerParams extends AidlParams {
private String id;
public RemoveMapLayerParams(String id) {
this.id = id;
}
public RemoveMapLayerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveMapLayerParams> CREATOR = new Creator<RemoveMapLayerParams>() {
@Override
public RemoveMapLayerParams createFromParcel(Parcel in) {
return new RemoveMapLayerParams(in);
}
@Override
public RemoveMapLayerParams[] newArray(int size) {
return new RemoveMapLayerParams[size];
}
};
public String getId() {
return id;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("id", id);
}
@Override
protected void readFromBundle(Bundle bundle) {
id = bundle.getString("id");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer;
parcelable UpdateMapLayerParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.maplayer;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class UpdateMapLayerParams extends AidlParams {
private AMapLayer layer;
public UpdateMapLayerParams(AMapLayer layer) {
this.layer = layer;
}
public UpdateMapLayerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<UpdateMapLayerParams> CREATOR = new Creator<UpdateMapLayerParams>() {
@Override
public UpdateMapLayerParams createFromParcel(Parcel in) {
return new UpdateMapLayerParams(in);
}
@Override
public UpdateMapLayerParams[] newArray(int size) {
return new UpdateMapLayerParams[size];
}
};
public AMapLayer getLayer() {
return layer;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("layer", layer);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapLayer.class.getClassLoader());
layer = bundle.getParcelable("layer");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer.point;
parcelable AMapPoint;

View file

@ -1,16 +1,18 @@
package net.osmand.aidl.maplayer.point; package net.osmand.aidlapi.maplayer.point;
import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
import net.osmand.aidl.map.ALatLon; import net.osmand.aidlapi.AidlParams;
import net.osmand.aidlapi.map.ALatLon;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class AMapPoint implements Parcelable { public class AMapPoint extends AidlParams {
public static final String POINT_IMAGE_URI_PARAM = "point_image_uri_param"; public static final String POINT_IMAGE_URI_PARAM = "point_image_uri_param";
public static final String POINT_SPEED_PARAM = "point_speed_param"; public static final String POINT_SPEED_PARAM = "point_speed_param";
public static final String POINT_TYPE_ICON_NAME_PARAM = "point_type_icon_name_param"; public static final String POINT_TYPE_ICON_NAME_PARAM = "point_type_icon_name_param";
@ -24,10 +26,10 @@ public class AMapPoint implements Parcelable {
private String layerId; private String layerId;
private int color; private int color;
private ALatLon location; private ALatLon location;
private List<String> details = new ArrayList<>(); private ArrayList<String> details = new ArrayList<>();
private Map<String, String> params = new HashMap<>(); private HashMap<String, String> params = new HashMap<>();
public AMapPoint(String id, String shortName, String fullName, String typeName, String layerId, public AMapPoint(String id, String shortName, String fullName, String typeName, String layerId,
int color, ALatLon location, List<String> details, Map<String, String> params) { int color, ALatLon location, List<String> details, Map<String, String> params) {
this.id = id; this.id = id;
this.shortName = shortName; this.shortName = shortName;
@ -48,16 +50,17 @@ public class AMapPoint implements Parcelable {
readFromParcel(in); readFromParcel(in);
} }
public static final Creator<AMapPoint> CREATOR = new public static final Creator<AMapPoint> CREATOR = new Creator<AMapPoint>() {
Creator<AMapPoint>() { @Override
public AMapPoint createFromParcel(Parcel in) { public AMapPoint createFromParcel(Parcel in) {
return new AMapPoint(in); return new AMapPoint(in);
} }
public AMapPoint[] newArray(int size) { @Override
return new AMapPoint[size]; public AMapPoint[] newArray(int size) {
} return new AMapPoint[size];
}; }
};
public String getId() { public String getId() {
return id; return id;
@ -95,31 +98,31 @@ public class AMapPoint implements Parcelable {
return params; return params;
} }
public void writeToParcel(Parcel out, int flags) { @Override
out.writeString(id); public void writeToBundle(Bundle bundle) {
out.writeString(shortName); bundle.putString("id", id);
out.writeString(fullName); bundle.putString("shortName", shortName);
out.writeString(typeName); bundle.putString("fullName", fullName);
out.writeInt(color); bundle.putString("typeName", typeName);
out.writeParcelable(location, flags); bundle.putInt("color", color);
out.writeStringList(details); bundle.putParcelable("location", location);
out.writeMap(params); bundle.putStringArrayList("details", details);
out.writeString(layerId); bundle.putSerializable("params", params);
bundle.putString("layerId", layerId);
} }
private void readFromParcel(Parcel in) { @Override
id = in.readString(); protected void readFromBundle(Bundle bundle) {
shortName = in.readString(); bundle.setClassLoader(ALatLon.class.getClassLoader());
fullName = in.readString();
typeName = in.readString();
color = in.readInt();
location = in.readParcelable(ALatLon.class.getClassLoader());
in.readStringList(details);
in.readMap(params, HashMap.class.getClassLoader());
layerId = in.readString();
}
public int describeContents() { id = bundle.getString("id");
return 0; shortName = bundle.getString("shortName");
fullName = bundle.getString("fullName");
typeName = bundle.getString("typeName");
color = bundle.getInt("color");
location = bundle.getParcelable("location");
details = bundle.getStringArrayList("details");
params = (HashMap<String, String>) bundle.getSerializable("params");
layerId = bundle.getString("layerId");
} }
} }

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer.point;
parcelable AddMapPointParams;

View file

@ -0,0 +1,55 @@
package net.osmand.aidlapi.maplayer.point;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AddMapPointParams extends AidlParams {
private String layerId;
private AMapPoint point;
public AddMapPointParams(String layerId, AMapPoint point) {
this.layerId = layerId;
this.point = point;
}
public AddMapPointParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AddMapPointParams> CREATOR = new Creator<AddMapPointParams>() {
@Override
public AddMapPointParams createFromParcel(Parcel in) {
return new AddMapPointParams(in);
}
@Override
public AddMapPointParams[] newArray(int size) {
return new AddMapPointParams[size];
}
};
public String getLayerId() {
return layerId;
}
public AMapPoint getPoint() {
return point;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("layerId", layerId);
bundle.putParcelable("point", point);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapPoint.class.getClassLoader());
layerId = bundle.getString("layerId");
point = bundle.getParcelable("point");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer.point;
parcelable RemoveMapPointParams;

View file

@ -0,0 +1,55 @@
package net.osmand.aidlapi.maplayer.point;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveMapPointParams extends AidlParams {
private String layerId;
private String pointId;
public RemoveMapPointParams(String layerId, String pointId) {
this.layerId = layerId;
this.pointId = pointId;
}
public RemoveMapPointParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveMapPointParams> CREATOR = new Creator<RemoveMapPointParams>() {
@Override
public RemoveMapPointParams createFromParcel(Parcel in) {
return new RemoveMapPointParams(in);
}
@Override
public RemoveMapPointParams[] newArray(int size) {
return new RemoveMapPointParams[size];
}
};
public String getLayerId() {
return layerId;
}
public String getPointId() {
return pointId;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("layerId", layerId);
bundle.putString("pointId", pointId);
}
@Override
protected void readFromBundle(Bundle bundle) {
super.readFromBundle(bundle);
layerId = bundle.getString("layerId");
pointId = bundle.getString("pointId");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer.point;
parcelable ShowMapPointParams;

View file

@ -0,0 +1,54 @@
package net.osmand.aidlapi.maplayer.point;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class ShowMapPointParams extends AidlParams {
private String layerId;
private AMapPoint point;
public ShowMapPointParams(String layerId, AMapPoint point) {
this.layerId = layerId;
this.point = point;
}
public ShowMapPointParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<ShowMapPointParams> CREATOR = new Creator<ShowMapPointParams>() {
@Override
public ShowMapPointParams createFromParcel(Parcel in) {
return new ShowMapPointParams(in);
}
@Override
public ShowMapPointParams[] newArray(int size) {
return new ShowMapPointParams[size];
}
};
public String getLayerId() {
return layerId;
}
public AMapPoint getPoint() {
return point;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("layerId", layerId);
bundle.putParcelable("point", point);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapPoint.class.getClassLoader());
layerId = bundle.getString("layerId");
point = bundle.getParcelable("point");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer.point;
parcelable UpdateMapPointParams;

View file

@ -0,0 +1,62 @@
package net.osmand.aidlapi.maplayer.point;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class UpdateMapPointParams extends AidlParams {
private String layerId;
private AMapPoint point;
private boolean updateOpenedMenuAndMap;
public UpdateMapPointParams(String layerId, AMapPoint point, boolean updateOpenedMenuAndMap) {
this.layerId = layerId;
this.point = point;
this.updateOpenedMenuAndMap = updateOpenedMenuAndMap;
}
public UpdateMapPointParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<UpdateMapPointParams> CREATOR = new Creator<UpdateMapPointParams>() {
@Override
public UpdateMapPointParams createFromParcel(Parcel in) {
return new UpdateMapPointParams(in);
}
@Override
public UpdateMapPointParams[] newArray(int size) {
return new UpdateMapPointParams[size];
}
};
public String getLayerId() {
return layerId;
}
public AMapPoint getPoint() {
return point;
}
public boolean isUpdateOpenedMenuAndMap() {
return updateOpenedMenuAndMap;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("layerId", layerId);
bundle.putParcelable("point", point);
bundle.putBoolean("updateOpenedMenuAndMap", updateOpenedMenuAndMap);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapPoint.class.getClassLoader());
layerId = bundle.getString("layerId");
point = bundle.getParcelable("point");
updateOpenedMenuAndMap = bundle.getBoolean("updateOpenedMenuAndMap");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.mapmarker;
parcelable AMapMarker;

View file

@ -0,0 +1,61 @@
package net.osmand.aidlapi.mapmarker;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import net.osmand.aidlapi.map.ALatLon;
public class AMapMarker extends AidlParams {
private ALatLon latLon;
private String name;
public AMapMarker(ALatLon latLon, String name) {
if (latLon == null) {
throw new IllegalArgumentException("latLon cannot be null");
}
if (name == null) {
name = "";
}
this.latLon = latLon;
this.name = name;
}
public AMapMarker(Parcel in) {
readFromParcel(in);
}
public static final Creator<AMapMarker> CREATOR = new Creator<AMapMarker>() {
@Override
public AMapMarker createFromParcel(Parcel in) {
return new AMapMarker(in);
}
@Override
public AMapMarker[] newArray(int size) {
return new AMapMarker[size];
}
};
public ALatLon getLatLon() {
return latLon;
}
public String getName() {
return name;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("latLon", latLon);
bundle.putString("name", name);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(ALatLon.class.getClassLoader());
latLon = bundle.getParcelable("latLon");
name = bundle.getString("name");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.mapmarker;
parcelable AddMapMarkerParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.mapmarker;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AddMapMarkerParams extends AidlParams {
private AMapMarker marker;
public AddMapMarkerParams(AMapMarker marker) {
this.marker = marker;
}
public AddMapMarkerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AddMapMarkerParams> CREATOR = new Creator<AddMapMarkerParams>() {
@Override
public AddMapMarkerParams createFromParcel(Parcel in) {
return new AddMapMarkerParams(in);
}
@Override
public AddMapMarkerParams[] newArray(int size) {
return new AddMapMarkerParams[size];
}
};
public AMapMarker getMarker() {
return marker;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("marker", marker);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapMarker.class.getClassLoader());
marker = bundle.getParcelable("marker");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.mapmarker;
parcelable RemoveMapMarkerParams;

View file

@ -0,0 +1,59 @@
package net.osmand.aidlapi.mapmarker;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveMapMarkerParams extends AidlParams {
private AMapMarker marker;
private boolean ignoreCoordinates;
public RemoveMapMarkerParams(AMapMarker marker) {
this.marker = marker;
this.ignoreCoordinates = false;
}
public RemoveMapMarkerParams(AMapMarker marker, boolean ignoreCoordinates) {
this.marker = marker;
this.ignoreCoordinates = ignoreCoordinates;
}
public RemoveMapMarkerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveMapMarkerParams> CREATOR = new Creator<RemoveMapMarkerParams>() {
@Override
public RemoveMapMarkerParams createFromParcel(Parcel in) {
return new RemoveMapMarkerParams(in);
}
@Override
public RemoveMapMarkerParams[] newArray(int size) {
return new RemoveMapMarkerParams[size];
}
};
public AMapMarker getMarker() {
return marker;
}
public boolean getIgnoreCoordinates() {
return ignoreCoordinates;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("marker", marker);
bundle.putBoolean("ignoreCoordinates", ignoreCoordinates);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapMarker.class.getClassLoader());
marker = bundle.getParcelable("marker");
ignoreCoordinates = bundle.getBoolean("ignoreCoordinates");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.mapmarker;
parcelable RemoveMapMarkersParams;

View file

@ -0,0 +1,28 @@
package net.osmand.aidlapi.mapmarker;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveMapMarkersParams extends AidlParams {
public RemoveMapMarkersParams() {
}
public RemoveMapMarkersParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveMapMarkersParams> CREATOR = new Creator<RemoveMapMarkersParams>() {
@Override
public RemoveMapMarkersParams createFromParcel(Parcel in) {
return new RemoveMapMarkersParams(in);
}
@Override
public RemoveMapMarkersParams[] newArray(int size) {
return new RemoveMapMarkersParams[size];
}
};
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.mapmarker;
parcelable UpdateMapMarkerParams;

View file

@ -0,0 +1,68 @@
package net.osmand.aidlapi.mapmarker;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class UpdateMapMarkerParams extends AidlParams {
private AMapMarker markerPrev;
private AMapMarker markerNew;
private boolean ignoreCoordinates;
public UpdateMapMarkerParams(AMapMarker markerPrev, AMapMarker markerNew) {
this.markerPrev = markerPrev;
this.markerNew = markerNew;
this.ignoreCoordinates = false;
}
public UpdateMapMarkerParams(AMapMarker markerPrev, AMapMarker markerNew, boolean ignoreCoordinates) {
this.markerPrev = markerPrev;
this.markerNew = markerNew;
this.ignoreCoordinates = ignoreCoordinates;
}
public UpdateMapMarkerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<UpdateMapMarkerParams> CREATOR = new Creator<UpdateMapMarkerParams>() {
@Override
public UpdateMapMarkerParams createFromParcel(Parcel in) {
return new UpdateMapMarkerParams(in);
}
@Override
public UpdateMapMarkerParams[] newArray(int size) {
return new UpdateMapMarkerParams[size];
}
};
public AMapMarker getMarkerPrev() {
return markerPrev;
}
public AMapMarker getMarkerNew() {
return markerNew;
}
public boolean getIgnoreCoordinates() {
return ignoreCoordinates;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("markerPrev", markerPrev);
bundle.putParcelable("markerNew", markerNew);
bundle.putBoolean("ignoreCoordinates", ignoreCoordinates);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapMarker.class.getClassLoader());
markerPrev = bundle.getParcelable("markerPrev");
markerNew = bundle.getParcelable("markerNew");
ignoreCoordinates = bundle.getBoolean("ignoreCoordinates");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.mapwidget;
parcelable AMapWidget;

Some files were not shown because too many files have changed in this diff Show more