Merge branch 'master' of ssh://github.com/osmandapp/Osmand into gpx_card
|
@ -2,6 +2,7 @@ package net.osmand.data;
|
|||
|
||||
public class TransportStop extends MapObject {
|
||||
private int[] referencesToRoutes = null;
|
||||
private Amenity amenity;
|
||||
public int distance;
|
||||
|
||||
public TransportStop(){
|
||||
|
@ -15,4 +16,11 @@ public class TransportStop extends MapObject {
|
|||
this.referencesToRoutes = referencesToRoutes;
|
||||
}
|
||||
|
||||
public Amenity getAmenity() {
|
||||
return amenity;
|
||||
}
|
||||
|
||||
public void setAmenity(Amenity amenity) {
|
||||
this.amenity = amenity;
|
||||
}
|
||||
}
|
||||
|
|
2
OsmAnd-telegram/.gitignore
vendored
|
@ -11,7 +11,7 @@ local.properties
|
|||
obj/
|
||||
out/
|
||||
use/
|
||||
src/main/java/org/drinkless/td/
|
||||
src/org/drinkless/td/
|
||||
|
||||
# Android Studio
|
||||
/.idea
|
||||
|
|
|
@ -6,9 +6,16 @@ apply plugin: 'kotlin-android-extensions'
|
|||
android {
|
||||
compileSdkVersion 27
|
||||
|
||||
sourceSets.main {
|
||||
jniLibs.srcDir 'libs'
|
||||
jni.srcDirs = [] //disable automatic ndk-build call
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile "AndroidManifest.xml"
|
||||
jni.srcDirs = []
|
||||
jniLibs.srcDirs = ["libs"]
|
||||
aidl.srcDirs = ["src"]
|
||||
java.srcDirs = ["src"]
|
||||
resources.srcDirs = ["src"]
|
||||
res.srcDirs = ["res"]
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
|
@ -19,7 +26,6 @@ android {
|
|||
versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode
|
||||
versionName "1.0"
|
||||
versionName System.getenv("APK_VERSION")? System.getenv("APK_VERSION").toString(): versionName
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
flavorDimensions "abi"
|
||||
|
@ -97,7 +103,7 @@ task copyNativeLibs(type: Copy) {
|
|||
task copyJavaSources(type: Copy) {
|
||||
dependsOn downloadTdLibzip
|
||||
from "tdlib/libtd/src/main/java/org/drinkless/td"
|
||||
into "src/main/java/org/drinkless/td"
|
||||
into "src/org/drinkless/td"
|
||||
}
|
||||
|
||||
task downloadPrebuiltTelegram {
|
||||
|
@ -116,15 +122,10 @@ dependencies {
|
|||
implementation project(path: ':OsmAnd-java', configuration: 'android')
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
|
||||
implementation 'com.android.support:support-annotations:27.1.1'
|
||||
implementation 'commons-logging:commons-logging-api:1.1'
|
||||
implementation 'com.android.support:recyclerview-v7:27.1.1'
|
||||
implementation 'com.vividsolutions:jts-core:1.14.0'
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 188 B |
BIN
OsmAnd-telegram/res/drawable-hdpi/osmand_logo.png
Normal file
After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 174 B After Width: | Height: | Size: 174 B |
BIN
OsmAnd-telegram/res/drawable-mdpi/osmand_logo.png
Normal file
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 193 B |
BIN
OsmAnd-telegram/res/drawable-xhdpi/osmand_logo.png
Normal file
After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 215 B After Width: | Height: | Size: 215 B |
BIN
OsmAnd-telegram/res/drawable-xxhdpi/osmand_logo.png
Normal file
After Width: | Height: | Size: 31 KiB |
37
OsmAnd-telegram/res/layout/install_osmand_dialog.xml
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/dialogTitleBackgroundColor"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/osmand_logo"
|
||||
android:layout_margin="32dp"
|
||||
android:src="@drawable/osmand_logo"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:attr/textColorPrimaryInverse"
|
||||
android:text="@string/install_osmand"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_margin="16dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:text="@string/install_osmand_dialog_message"/>
|
||||
|
||||
</LinearLayout>
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9 KiB After Width: | Height: | Size: 9 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
@ -11,4 +11,6 @@
|
|||
|
||||
<color name="osmand_orange">#ff8f00</color>
|
||||
|
||||
<color name="dialogTitleBackgroundColor">#2f7af5</color>
|
||||
|
||||
</resources>
|
|
@ -28,6 +28,9 @@
|
|||
<string name="shared_string_start">Start</string>
|
||||
<string name="shared_string_stop">Stop</string>
|
||||
<string name="process_location_service">OsmAnd Telegram location service</string>
|
||||
<string name="osmand_logo">OsmAnd logo</string>
|
||||
<string name="install_osmand_dialog_message">You need to install free or paid version of OsmAnd first</string>
|
||||
<string name="install_osmand">Install OsmAnd</string>
|
||||
|
||||
<string name="yard">yd</string>
|
||||
<string name="foot">ft</string>
|
|
@ -1,24 +0,0 @@
|
|||
package net.osmand.telegramtest
|
||||
|
||||
import android.support.test.InstrumentationRegistry
|
||||
import android.support.test.runner.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getTargetContext()
|
||||
assertEquals("net.osmand.telegram", appContext.packageName)
|
||||
}
|
||||
}
|
104
OsmAnd-telegram/src/net/osmand/aidl/IOsmAndAidlInterface.aidl
Normal file
|
@ -0,0 +1,104 @@
|
|||
package net.osmand.aidl;
|
||||
|
||||
import net.osmand.aidl.map.ALatLon;
|
||||
import net.osmand.aidl.map.SetMapLocationParams;
|
||||
|
||||
import net.osmand.aidl.favorite.group.AFavoriteGroup;
|
||||
import net.osmand.aidl.favorite.group.AddFavoriteGroupParams;
|
||||
import net.osmand.aidl.favorite.group.RemoveFavoriteGroupParams;
|
||||
import net.osmand.aidl.favorite.group.UpdateFavoriteGroupParams;
|
||||
|
||||
import net.osmand.aidl.favorite.AFavorite;
|
||||
import net.osmand.aidl.favorite.AddFavoriteParams;
|
||||
import net.osmand.aidl.favorite.RemoveFavoriteParams;
|
||||
import net.osmand.aidl.favorite.UpdateFavoriteParams;
|
||||
|
||||
import net.osmand.aidl.mapmarker.AMapMarker;
|
||||
import net.osmand.aidl.mapmarker.AddMapMarkerParams;
|
||||
import net.osmand.aidl.mapmarker.RemoveMapMarkerParams;
|
||||
import net.osmand.aidl.mapmarker.UpdateMapMarkerParams;
|
||||
|
||||
import net.osmand.aidl.calculateroute.CalculateRouteParams;
|
||||
|
||||
import net.osmand.aidl.gpx.ImportGpxParams;
|
||||
import net.osmand.aidl.gpx.ShowGpxParams;
|
||||
import net.osmand.aidl.gpx.StartGpxRecordingParams;
|
||||
import net.osmand.aidl.gpx.StopGpxRecordingParams;
|
||||
import net.osmand.aidl.gpx.HideGpxParams;
|
||||
import net.osmand.aidl.gpx.ASelectedGpxFile;
|
||||
|
||||
import net.osmand.aidl.mapwidget.AMapWidget;
|
||||
import net.osmand.aidl.mapwidget.AddMapWidgetParams;
|
||||
import net.osmand.aidl.mapwidget.RemoveMapWidgetParams;
|
||||
import net.osmand.aidl.mapwidget.UpdateMapWidgetParams;
|
||||
|
||||
import net.osmand.aidl.maplayer.point.AMapPoint;
|
||||
import net.osmand.aidl.maplayer.point.AddMapPointParams;
|
||||
import net.osmand.aidl.maplayer.point.RemoveMapPointParams;
|
||||
import net.osmand.aidl.maplayer.point.UpdateMapPointParams;
|
||||
import net.osmand.aidl.maplayer.AMapLayer;
|
||||
import net.osmand.aidl.maplayer.AddMapLayerParams;
|
||||
import net.osmand.aidl.maplayer.RemoveMapLayerParams;
|
||||
import net.osmand.aidl.maplayer.UpdateMapLayerParams;
|
||||
|
||||
import net.osmand.aidl.navigation.NavigateParams;
|
||||
import net.osmand.aidl.navigation.NavigateGpxParams;
|
||||
|
||||
import net.osmand.aidl.note.TakePhotoNoteParams;
|
||||
import net.osmand.aidl.note.StartVideoRecordingParams;
|
||||
import net.osmand.aidl.note.StartAudioRecordingParams;
|
||||
import net.osmand.aidl.note.StopRecordingParams;
|
||||
|
||||
import net.osmand.aidl.gpx.RemoveGpxParams;
|
||||
|
||||
// NOTE: Add new methods at the end of file!!!
|
||||
|
||||
interface IOsmAndAidlInterface {
|
||||
|
||||
boolean addMapMarker(in AddMapMarkerParams params);
|
||||
boolean removeMapMarker(in RemoveMapMarkerParams params);
|
||||
boolean updateMapMarker(in UpdateMapMarkerParams params);
|
||||
|
||||
boolean addMapWidget(in AddMapWidgetParams params);
|
||||
boolean removeMapWidget(in RemoveMapWidgetParams params);
|
||||
boolean updateMapWidget(in UpdateMapWidgetParams params);
|
||||
|
||||
boolean addMapPoint(in AddMapPointParams params);
|
||||
boolean removeMapPoint(in RemoveMapPointParams params);
|
||||
boolean updateMapPoint(in UpdateMapPointParams params);
|
||||
|
||||
boolean addMapLayer(in AddMapLayerParams params);
|
||||
boolean removeMapLayer(in RemoveMapLayerParams params);
|
||||
boolean updateMapLayer(in UpdateMapLayerParams params);
|
||||
|
||||
boolean importGpx(in ImportGpxParams params);
|
||||
boolean showGpx(in ShowGpxParams params);
|
||||
boolean hideGpx(in HideGpxParams params);
|
||||
boolean getActiveGpx(out List<ASelectedGpxFile> files);
|
||||
|
||||
boolean setMapLocation(in SetMapLocationParams params);
|
||||
boolean calculateRoute(in CalculateRouteParams params);
|
||||
|
||||
boolean refreshMap();
|
||||
|
||||
boolean addFavoriteGroup(in AddFavoriteGroupParams params);
|
||||
boolean removeFavoriteGroup(in RemoveFavoriteGroupParams params);
|
||||
boolean updateFavoriteGroup(in UpdateFavoriteGroupParams params);
|
||||
|
||||
boolean addFavorite(in AddFavoriteParams params);
|
||||
boolean removeFavorite(in RemoveFavoriteParams params);
|
||||
boolean updateFavorite(in UpdateFavoriteParams params);
|
||||
|
||||
boolean startGpxRecording(in StartGpxRecordingParams params);
|
||||
boolean stopGpxRecording(in StopGpxRecordingParams params);
|
||||
|
||||
boolean takePhotoNote(in TakePhotoNoteParams params);
|
||||
boolean startVideoRecording(in StartVideoRecordingParams params);
|
||||
boolean startAudioRecording(in StartAudioRecordingParams params);
|
||||
boolean stopRecording(in StopRecordingParams params);
|
||||
|
||||
boolean navigate(in NavigateParams params);
|
||||
boolean navigateGpx(in NavigateGpxParams params);
|
||||
|
||||
boolean removeGpx(in RemoveGpxParams params);
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.calculateroute;
|
||||
|
||||
parcelable CalculateRouteParams;
|
|
@ -0,0 +1,100 @@
|
|||
package net.osmand.aidl.calculateroute;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import net.osmand.aidl.map.ALatLon;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CalculateRouteParams implements Parcelable {
|
||||
|
||||
private ALatLon startPoint;
|
||||
private String startPointName;
|
||||
private ALatLon endPoint;
|
||||
private String endPointName;
|
||||
private List<ALatLon> intermediatePoints = new ArrayList<>();
|
||||
private List<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 Parcelable.Creator<CalculateRouteParams> CREATOR = new
|
||||
Parcelable.Creator<CalculateRouteParams>() {
|
||||
public CalculateRouteParams createFromParcel(Parcel in) {
|
||||
return new CalculateRouteParams(in);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(startPoint, flags);
|
||||
out.writeString(startPointName);
|
||||
out.writeParcelable(endPoint, flags);
|
||||
out.writeString(endPointName);
|
||||
out.writeTypedList(intermediatePoints);
|
||||
out.writeStringList(intermediateNames);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
startPoint = in.readParcelable(ALatLon.class.getClassLoader());
|
||||
startPointName = in.readString();
|
||||
endPoint = in.readParcelable(ALatLon.class.getClassLoader());
|
||||
endPointName = in.readString();
|
||||
in.readTypedList(intermediatePoints, ALatLon.CREATOR);
|
||||
in.readStringList(intermediateNames);
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.favorite;
|
||||
|
||||
parcelable AFavorite;
|
96
OsmAnd-telegram/src/net/osmand/aidl/favorite/AFavorite.java
Normal file
|
@ -0,0 +1,96 @@
|
|||
package net.osmand.aidl.favorite;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class AFavorite implements Parcelable {
|
||||
|
||||
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 writeToParcel(Parcel out, int flags) {
|
||||
out.writeDouble(lat);
|
||||
out.writeDouble(lon);
|
||||
out.writeString(name);
|
||||
out.writeString(description);
|
||||
out.writeString(category);
|
||||
out.writeString(color);
|
||||
out.writeByte((byte) (visible ? 1 : 0));
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
lat = in.readDouble();
|
||||
lon = in.readDouble();
|
||||
name = in.readString();
|
||||
description = in.readString();
|
||||
category = in.readString();
|
||||
color = in.readString();
|
||||
visible = in.readByte() != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.favorite;
|
||||
|
||||
parcelable AddFavoriteParams;
|
|
@ -0,0 +1,47 @@
|
|||
package net.osmand.aidl.favorite;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class AddFavoriteParams implements Parcelable {
|
||||
|
||||
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 writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(favorite, flags);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
favorite = in.readParcelable(AFavorite.class.getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.favorite;
|
||||
|
||||
parcelable RemoveFavoriteParams;
|
|
@ -0,0 +1,47 @@
|
|||
package net.osmand.aidl.favorite;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class RemoveFavoriteParams implements Parcelable {
|
||||
|
||||
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 writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(favorite, flags);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
favorite = in.readParcelable(AFavorite.class.getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.favorite;
|
||||
|
||||
parcelable UpdateFavoriteParams;
|
|
@ -0,0 +1,55 @@
|
|||
package net.osmand.aidl.favorite;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class UpdateFavoriteParams implements Parcelable {
|
||||
|
||||
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 writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(favoritePrev, flags);
|
||||
out.writeParcelable(favoriteNew, flags);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
favoritePrev = in.readParcelable(AFavorite.class.getClassLoader());
|
||||
favoriteNew = in.readParcelable(AFavorite.class.getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.favorite.group;
|
||||
|
||||
parcelable AFavoriteGroup;
|
|
@ -0,0 +1,63 @@
|
|||
package net.osmand.aidl.favorite.group;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class AFavoriteGroup implements Parcelable {
|
||||
|
||||
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 writeToParcel(Parcel out, int flags) {
|
||||
out.writeString(name);
|
||||
out.writeString(color);
|
||||
out.writeByte((byte) (visible ? 1 : 0));
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
name = in.readString();
|
||||
color = in.readString();
|
||||
visible = in.readByte() != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.favorite.group;
|
||||
|
||||
parcelable AddFavoriteGroupParams;
|
|
@ -0,0 +1,47 @@
|
|||
package net.osmand.aidl.favorite.group;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class AddFavoriteGroupParams implements Parcelable {
|
||||
|
||||
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 writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(favoriteGroup, flags);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
favoriteGroup = in.readParcelable(AFavoriteGroup.class.getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.favorite.group;
|
||||
|
||||
parcelable RemoveFavoriteGroupParams;
|
|
@ -0,0 +1,47 @@
|
|||
package net.osmand.aidl.favorite.group;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class RemoveFavoriteGroupParams implements Parcelable {
|
||||
|
||||
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 writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(favoriteGroup, flags);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
favoriteGroup = in.readParcelable(AFavoriteGroup.class.getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.favorite.group;
|
||||
|
||||
parcelable UpdateFavoriteGroupParams;
|
|
@ -0,0 +1,55 @@
|
|||
package net.osmand.aidl.favorite.group;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class UpdateFavoriteGroupParams implements Parcelable {
|
||||
|
||||
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 writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(favoriteGroupPrev, flags);
|
||||
out.writeParcelable(favoriteGroupNew, flags);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
favoriteGroupPrev = in.readParcelable(AFavoriteGroup.class.getClassLoader());
|
||||
favoriteGroupNew = in.readParcelable(AFavoriteGroup.class.getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
parcelable ASelectedGpxFile;
|
|
@ -0,0 +1,45 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class ASelectedGpxFile implements Parcelable {
|
||||
|
||||
private String fileName;
|
||||
|
||||
public ASelectedGpxFile(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public ASelectedGpxFile(Parcel in) {
|
||||
readFromParcel(in);
|
||||
}
|
||||
|
||||
public static final Creator<ASelectedGpxFile> CREATOR = new
|
||||
Creator<ASelectedGpxFile>() {
|
||||
public ASelectedGpxFile createFromParcel(Parcel in) {
|
||||
return new ASelectedGpxFile(in);
|
||||
}
|
||||
|
||||
public ASelectedGpxFile[] newArray(int size) {
|
||||
return new ASelectedGpxFile[size];
|
||||
}
|
||||
};
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeString(fileName);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
fileName = in.readString();
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
parcelable HideGpxParams;
|
45
OsmAnd-telegram/src/net/osmand/aidl/gpx/HideGpxParams.java
Normal file
|
@ -0,0 +1,45 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class HideGpxParams implements Parcelable {
|
||||
|
||||
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>() {
|
||||
public HideGpxParams createFromParcel(Parcel in) {
|
||||
return new HideGpxParams(in);
|
||||
}
|
||||
|
||||
public HideGpxParams[] newArray(int size) {
|
||||
return new HideGpxParams[size];
|
||||
}
|
||||
};
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeString(fileName);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
fileName = in.readString();
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
parcelable ImportGpxParams;
|
106
OsmAnd-telegram/src/net/osmand/aidl/gpx/ImportGpxParams.java
Normal file
|
@ -0,0 +1,106 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ImportGpxParams implements Parcelable {
|
||||
|
||||
private File gpxFile;
|
||||
private Uri gpxUri;
|
||||
private String sourceRawData;
|
||||
private String destinationPath;
|
||||
private String color;
|
||||
private boolean show;
|
||||
|
||||
public ImportGpxParams(File gpxFile, String destinationPath, String color, boolean show) {
|
||||
this.gpxFile = gpxFile;
|
||||
this.destinationPath = destinationPath;
|
||||
this.color = color;
|
||||
this.show = show;
|
||||
}
|
||||
|
||||
public ImportGpxParams(Uri gpxUri, String destinationPath, String color, boolean show) {
|
||||
this.gpxUri = gpxUri;
|
||||
this.destinationPath = destinationPath;
|
||||
this.color = color;
|
||||
this.show = show;
|
||||
}
|
||||
|
||||
public ImportGpxParams(String sourceRawData, String destinationPath, String color, boolean show) {
|
||||
this.sourceRawData = sourceRawData;
|
||||
this.destinationPath = destinationPath;
|
||||
this.color = color;
|
||||
this.show = show;
|
||||
}
|
||||
|
||||
public ImportGpxParams(Parcel in) {
|
||||
readFromParcel(in);
|
||||
}
|
||||
|
||||
public static final Creator<ImportGpxParams> CREATOR = new
|
||||
Creator<ImportGpxParams>() {
|
||||
public ImportGpxParams createFromParcel(Parcel in) {
|
||||
return new ImportGpxParams(in);
|
||||
}
|
||||
|
||||
public ImportGpxParams[] newArray(int size) {
|
||||
return new ImportGpxParams[size];
|
||||
}
|
||||
};
|
||||
|
||||
public File getGpxFile() {
|
||||
return gpxFile;
|
||||
}
|
||||
|
||||
public Uri getGpxUri() {
|
||||
return gpxUri;
|
||||
}
|
||||
|
||||
public String getSourceRawData() {
|
||||
return sourceRawData;
|
||||
}
|
||||
|
||||
public String getDestinationPath() {
|
||||
return destinationPath;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public boolean isShow() {
|
||||
return show;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
if (gpxFile != null) {
|
||||
out.writeString(gpxFile.getAbsolutePath());
|
||||
} 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 = in.readString();
|
||||
if (gpxAbsolutePath != null) {
|
||||
gpxFile = new File(gpxAbsolutePath);
|
||||
}
|
||||
gpxUri = in.readParcelable(Uri.class.getClassLoader());
|
||||
sourceRawData = in.readString();
|
||||
destinationPath = in.readString();
|
||||
color = in.readString();
|
||||
show = in.readByte() == 1;
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
parcelable RemoveGpxParams;
|
48
OsmAnd-telegram/src/net/osmand/aidl/gpx/RemoveGpxParams.java
Normal file
|
@ -0,0 +1,48 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class RemoveGpxParams implements Parcelable {
|
||||
|
||||
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 writeToParcel(Parcel out, int flags) {
|
||||
out.writeString(fileName);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
fileName = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
parcelable ShowGpxParams;
|
44
OsmAnd-telegram/src/net/osmand/aidl/gpx/ShowGpxParams.java
Normal file
|
@ -0,0 +1,44 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class ShowGpxParams implements Parcelable {
|
||||
|
||||
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>() {
|
||||
public ShowGpxParams createFromParcel(Parcel in) {
|
||||
return new ShowGpxParams(in);
|
||||
}
|
||||
|
||||
public ShowGpxParams[] newArray(int size) {
|
||||
return new ShowGpxParams[size];
|
||||
}
|
||||
};
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeString(fileName);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
fileName = in.readString();
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
parcelable StartGpxRecordingParams;
|
|
@ -0,0 +1,40 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class StartGpxRecordingParams implements Parcelable {
|
||||
|
||||
public StartGpxRecordingParams() {
|
||||
|
||||
}
|
||||
|
||||
public StartGpxRecordingParams(Parcel in) {
|
||||
readFromParcel(in);
|
||||
}
|
||||
|
||||
public static final Creator<StartGpxRecordingParams> CREATOR = new Creator<StartGpxRecordingParams>() {
|
||||
@Override
|
||||
public StartGpxRecordingParams createFromParcel(Parcel in) {
|
||||
return new StartGpxRecordingParams(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StartGpxRecordingParams[] newArray(int size) {
|
||||
return new StartGpxRecordingParams[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
parcelable StopGpxRecordingParams;
|
|
@ -0,0 +1,40 @@
|
|||
package net.osmand.aidl.gpx;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class StopGpxRecordingParams implements Parcelable {
|
||||
|
||||
public StopGpxRecordingParams() {
|
||||
|
||||
}
|
||||
|
||||
public StopGpxRecordingParams(Parcel in) {
|
||||
readFromParcel(in);
|
||||
}
|
||||
|
||||
public static final Creator<StopGpxRecordingParams> CREATOR = new Creator<StopGpxRecordingParams>() {
|
||||
@Override
|
||||
public StopGpxRecordingParams createFromParcel(Parcel in) {
|
||||
return new StopGpxRecordingParams(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StopGpxRecordingParams[] newArray(int size) {
|
||||
return new StopGpxRecordingParams[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
3
OsmAnd-telegram/src/net/osmand/aidl/map/ALatLon.aidl
Normal file
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.map;
|
||||
|
||||
parcelable ALatLon;
|
83
OsmAnd-telegram/src/net/osmand/aidl/map/ALatLon.java
Normal file
|
@ -0,0 +1,83 @@
|
|||
package net.osmand.aidl.map;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class ALatLon implements Parcelable {
|
||||
|
||||
private double longitude;
|
||||
private double latitude;
|
||||
|
||||
public ALatLon(double latitude, double longitude) {
|
||||
this.latitude = latitude;
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public ALatLon(Parcel in) {
|
||||
readFromParcel(in);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<ALatLon> CREATOR = new
|
||||
Parcelable.Creator<ALatLon>() {
|
||||
public ALatLon createFromParcel(Parcel in) {
|
||||
return new ALatLon(in);
|
||||
}
|
||||
|
||||
public ALatLon[] newArray(int size) {
|
||||
return new ALatLon[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
int temp;
|
||||
temp = (int)Math.floor(latitude * 10000);
|
||||
result = prime * result + temp;
|
||||
temp = (int)Math.floor(longitude * 10000);
|
||||
result = prime * result + temp;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
|
||||
ALatLon other = (ALatLon) obj;
|
||||
return Math.abs(latitude - other.latitude) < 0.00001
|
||||
&& Math.abs(longitude - other.longitude) < 0.00001;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Lat " + ((float)latitude) + " Lon " + ((float)longitude);
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeDouble(latitude);
|
||||
out.writeDouble(longitude);
|
||||
}
|
||||
|
||||
public void readFromParcel(Parcel in) {
|
||||
latitude = in.readDouble();
|
||||
longitude = in.readDouble();
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.map;
|
||||
|
||||
parcelable SetMapLocationParams;
|
|
@ -0,0 +1,68 @@
|
|||
package net.osmand.aidl.map;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class SetMapLocationParams implements Parcelable {
|
||||
|
||||
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>() {
|
||||
public SetMapLocationParams createFromParcel(Parcel in) {
|
||||
return new SetMapLocationParams(in);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeDouble(latitude);
|
||||
out.writeDouble(longitude);
|
||||
out.writeInt(zoom);
|
||||
out.writeByte((byte) (animated ? 1 : 0));
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
latitude = in.readDouble();
|
||||
longitude = in.readDouble();
|
||||
zoom = in.readInt();
|
||||
animated = in.readByte() != 0;
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.maplayer;
|
||||
|
||||
parcelable AMapLayer;
|
94
OsmAnd-telegram/src/net/osmand/aidl/maplayer/AMapLayer.java
Normal file
|
@ -0,0 +1,94 @@
|
|||
package net.osmand.aidl.maplayer;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import net.osmand.aidl.maplayer.point.AMapPoint;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class AMapLayer implements Parcelable {
|
||||
private String id;
|
||||
private String name;
|
||||
private float zOrder = 5.5f;
|
||||
private Map<String, AMapPoint> points = new ConcurrentHashMap<>();
|
||||
|
||||
public AMapLayer(String id, String name, float zOrder, List<AMapPoint> pointList) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.zOrder = zOrder;
|
||||
if (pointList != null) {
|
||||
for (AMapPoint p : pointList) {
|
||||
this.points.put(p.getId(), p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AMapLayer(Parcel in) {
|
||||
readFromParcel(in);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<AMapLayer> CREATOR = new
|
||||
Parcelable.Creator<AMapLayer>() {
|
||||
public AMapLayer createFromParcel(Parcel in) {
|
||||
return new AMapLayer(in);
|
||||
}
|
||||
|
||||
public AMapLayer[] newArray(int size) {
|
||||
return new AMapLayer[size];
|
||||
}
|
||||
};
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public float getZOrder() {
|
||||
return zOrder;
|
||||
}
|
||||
|
||||
public List<AMapPoint> getPoints() {
|
||||
return new ArrayList<>(points.values());
|
||||
}
|
||||
|
||||
public boolean hasPoint(String pointId) {
|
||||
return points.containsKey(pointId);
|
||||
}
|
||||
|
||||
public void putPoint(AMapPoint point) {
|
||||
points.put(point.getId(), point);
|
||||
}
|
||||
|
||||
public void removePoint(String pointId) {
|
||||
points.remove(pointId);
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeString(id);
|
||||
out.writeString(name);
|
||||
out.writeFloat(zOrder);
|
||||
out.writeTypedList(new ArrayList<>(points.values()));
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
id = in.readString();
|
||||
name = in.readString();
|
||||
zOrder = in.readFloat();
|
||||
List<AMapPoint> pointList = new ArrayList<>();
|
||||
in.readTypedList(pointList, AMapPoint.CREATOR);
|
||||
for (AMapPoint p : pointList) {
|
||||
this.points.put(p.getId(), p);
|
||||
}
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.maplayer;
|
||||
|
||||
parcelable AddMapLayerParams;
|
|
@ -0,0 +1,44 @@
|
|||
package net.osmand.aidl.maplayer;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.Parcelable.Creator;
|
||||
|
||||
public class AddMapLayerParams implements Parcelable {
|
||||
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>() {
|
||||
public AddMapLayerParams createFromParcel(Parcel in) {
|
||||
return new AddMapLayerParams(in);
|
||||
}
|
||||
|
||||
public AddMapLayerParams[] newArray(int size) {
|
||||
return new AddMapLayerParams[size];
|
||||
}
|
||||
};
|
||||
|
||||
public AMapLayer getLayer() {
|
||||
return layer;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(layer, flags);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
layer = in.readParcelable(AMapLayer.class.getClassLoader());
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.maplayer;
|
||||
|
||||
parcelable RemoveMapLayerParams;
|
|
@ -0,0 +1,44 @@
|
|||
package net.osmand.aidl.maplayer;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.Parcelable.Creator;
|
||||
|
||||
public class RemoveMapLayerParams implements Parcelable {
|
||||
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>() {
|
||||
public RemoveMapLayerParams createFromParcel(Parcel in) {
|
||||
return new RemoveMapLayerParams(in);
|
||||
}
|
||||
|
||||
public RemoveMapLayerParams[] newArray(int size) {
|
||||
return new RemoveMapLayerParams[size];
|
||||
}
|
||||
};
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeString(id);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
id = in.readString();
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.maplayer;
|
||||
|
||||
parcelable UpdateMapLayerParams;
|
|
@ -0,0 +1,44 @@
|
|||
package net.osmand.aidl.maplayer;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.Parcelable.Creator;
|
||||
|
||||
public class UpdateMapLayerParams implements Parcelable {
|
||||
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>() {
|
||||
public UpdateMapLayerParams createFromParcel(Parcel in) {
|
||||
return new UpdateMapLayerParams(in);
|
||||
}
|
||||
|
||||
public UpdateMapLayerParams[] newArray(int size) {
|
||||
return new UpdateMapLayerParams[size];
|
||||
}
|
||||
};
|
||||
|
||||
public AMapLayer getLayer() {
|
||||
return layer;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(layer, flags);
|
||||
}
|
||||
|
||||
private void readFromParcel(Parcel in) {
|
||||
layer = in.readParcelable(AMapLayer.class.getClassLoader());
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.maplayer.point;
|
||||
|
||||
parcelable AMapPoint;
|