diff --git a/OsmAnd-telegram/src/main/AndroidManifest.xml b/OsmAnd-telegram/AndroidManifest.xml similarity index 100% rename from OsmAnd-telegram/src/main/AndroidManifest.xml rename to OsmAnd-telegram/AndroidManifest.xml diff --git a/OsmAnd-telegram/build.gradle b/OsmAnd-telegram/build.gradle index 9ae14d619b..dfd1fed11e 100644 --- a/OsmAnd-telegram/build.gradle +++ b/OsmAnd-telegram/build.gradle @@ -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' } diff --git a/OsmAnd-telegram/src/main/res/drawable-hdpi/ic_action_polygom_dark.png b/OsmAnd-telegram/res/drawable-hdpi/ic_action_polygom_dark.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-hdpi/ic_action_polygom_dark.png rename to OsmAnd-telegram/res/drawable-hdpi/ic_action_polygom_dark.png diff --git a/OsmAnd-telegram/src/main/res/drawable-hdpi/ic_action_rec_start.png b/OsmAnd-telegram/res/drawable-hdpi/ic_action_rec_start.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-hdpi/ic_action_rec_start.png rename to OsmAnd-telegram/res/drawable-hdpi/ic_action_rec_start.png diff --git a/OsmAnd-telegram/src/main/res/drawable-hdpi/ic_action_rec_stop.png b/OsmAnd-telegram/res/drawable-hdpi/ic_action_rec_stop.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-hdpi/ic_action_rec_stop.png rename to OsmAnd-telegram/res/drawable-hdpi/ic_action_rec_stop.png diff --git a/OsmAnd-telegram/src/main/res/drawable-hdpi/ic_group.png b/OsmAnd-telegram/res/drawable-hdpi/ic_group.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-hdpi/ic_group.png rename to OsmAnd-telegram/res/drawable-hdpi/ic_group.png diff --git a/OsmAnd-telegram/src/main/res/drawable-hdpi/ic_pause.png b/OsmAnd-telegram/res/drawable-hdpi/ic_pause.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-hdpi/ic_pause.png rename to OsmAnd-telegram/res/drawable-hdpi/ic_pause.png diff --git a/OsmAnd-telegram/res/drawable-hdpi/osmand_logo.png b/OsmAnd-telegram/res/drawable-hdpi/osmand_logo.png new file mode 100644 index 0000000000..08afc02344 Binary files /dev/null and b/OsmAnd-telegram/res/drawable-hdpi/osmand_logo.png differ diff --git a/OsmAnd-telegram/src/main/res/drawable-mdpi/ic_action_polygom_dark.png b/OsmAnd-telegram/res/drawable-mdpi/ic_action_polygom_dark.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-mdpi/ic_action_polygom_dark.png rename to OsmAnd-telegram/res/drawable-mdpi/ic_action_polygom_dark.png diff --git a/OsmAnd-telegram/src/main/res/drawable-mdpi/ic_action_rec_start.png b/OsmAnd-telegram/res/drawable-mdpi/ic_action_rec_start.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-mdpi/ic_action_rec_start.png rename to OsmAnd-telegram/res/drawable-mdpi/ic_action_rec_start.png diff --git a/OsmAnd-telegram/src/main/res/drawable-mdpi/ic_action_rec_stop.png b/OsmAnd-telegram/res/drawable-mdpi/ic_action_rec_stop.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-mdpi/ic_action_rec_stop.png rename to OsmAnd-telegram/res/drawable-mdpi/ic_action_rec_stop.png diff --git a/OsmAnd-telegram/src/main/res/drawable-mdpi/ic_group.png b/OsmAnd-telegram/res/drawable-mdpi/ic_group.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-mdpi/ic_group.png rename to OsmAnd-telegram/res/drawable-mdpi/ic_group.png diff --git a/OsmAnd-telegram/src/main/res/drawable-mdpi/ic_pause.png b/OsmAnd-telegram/res/drawable-mdpi/ic_pause.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-mdpi/ic_pause.png rename to OsmAnd-telegram/res/drawable-mdpi/ic_pause.png diff --git a/OsmAnd-telegram/res/drawable-mdpi/osmand_logo.png b/OsmAnd-telegram/res/drawable-mdpi/osmand_logo.png new file mode 100644 index 0000000000..f70c172418 Binary files /dev/null and b/OsmAnd-telegram/res/drawable-mdpi/osmand_logo.png differ diff --git a/OsmAnd-telegram/src/main/res/drawable-v24/ic_launcher_foreground.xml b/OsmAnd-telegram/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to OsmAnd-telegram/res/drawable-v24/ic_launcher_foreground.xml diff --git a/OsmAnd-telegram/src/main/res/drawable-xhdpi/ic_action_polygom_dark.png b/OsmAnd-telegram/res/drawable-xhdpi/ic_action_polygom_dark.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-xhdpi/ic_action_polygom_dark.png rename to OsmAnd-telegram/res/drawable-xhdpi/ic_action_polygom_dark.png diff --git a/OsmAnd-telegram/src/main/res/drawable-xhdpi/ic_action_rec_start.png b/OsmAnd-telegram/res/drawable-xhdpi/ic_action_rec_start.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-xhdpi/ic_action_rec_start.png rename to OsmAnd-telegram/res/drawable-xhdpi/ic_action_rec_start.png diff --git a/OsmAnd-telegram/src/main/res/drawable-xhdpi/ic_action_rec_stop.png b/OsmAnd-telegram/res/drawable-xhdpi/ic_action_rec_stop.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-xhdpi/ic_action_rec_stop.png rename to OsmAnd-telegram/res/drawable-xhdpi/ic_action_rec_stop.png diff --git a/OsmAnd-telegram/src/main/res/drawable-xhdpi/ic_group.png b/OsmAnd-telegram/res/drawable-xhdpi/ic_group.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-xhdpi/ic_group.png rename to OsmAnd-telegram/res/drawable-xhdpi/ic_group.png diff --git a/OsmAnd-telegram/src/main/res/drawable-xhdpi/ic_pause.png b/OsmAnd-telegram/res/drawable-xhdpi/ic_pause.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-xhdpi/ic_pause.png rename to OsmAnd-telegram/res/drawable-xhdpi/ic_pause.png diff --git a/OsmAnd-telegram/res/drawable-xhdpi/osmand_logo.png b/OsmAnd-telegram/res/drawable-xhdpi/osmand_logo.png new file mode 100644 index 0000000000..c68d31e900 Binary files /dev/null and b/OsmAnd-telegram/res/drawable-xhdpi/osmand_logo.png differ diff --git a/OsmAnd-telegram/src/main/res/drawable-xxhdpi/ic_action_polygom_dark.png b/OsmAnd-telegram/res/drawable-xxhdpi/ic_action_polygom_dark.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-xxhdpi/ic_action_polygom_dark.png rename to OsmAnd-telegram/res/drawable-xxhdpi/ic_action_polygom_dark.png diff --git a/OsmAnd-telegram/src/main/res/drawable-xxhdpi/ic_action_rec_start.png b/OsmAnd-telegram/res/drawable-xxhdpi/ic_action_rec_start.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-xxhdpi/ic_action_rec_start.png rename to OsmAnd-telegram/res/drawable-xxhdpi/ic_action_rec_start.png diff --git a/OsmAnd-telegram/src/main/res/drawable-xxhdpi/ic_action_rec_stop.png b/OsmAnd-telegram/res/drawable-xxhdpi/ic_action_rec_stop.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-xxhdpi/ic_action_rec_stop.png rename to OsmAnd-telegram/res/drawable-xxhdpi/ic_action_rec_stop.png diff --git a/OsmAnd-telegram/src/main/res/drawable-xxhdpi/ic_group.png b/OsmAnd-telegram/res/drawable-xxhdpi/ic_group.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-xxhdpi/ic_group.png rename to OsmAnd-telegram/res/drawable-xxhdpi/ic_group.png diff --git a/OsmAnd-telegram/src/main/res/drawable-xxhdpi/ic_pause.png b/OsmAnd-telegram/res/drawable-xxhdpi/ic_pause.png similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable-xxhdpi/ic_pause.png rename to OsmAnd-telegram/res/drawable-xxhdpi/ic_pause.png diff --git a/OsmAnd-telegram/res/drawable-xxhdpi/osmand_logo.png b/OsmAnd-telegram/res/drawable-xxhdpi/osmand_logo.png new file mode 100644 index 0000000000..f8f3f45291 Binary files /dev/null and b/OsmAnd-telegram/res/drawable-xxhdpi/osmand_logo.png differ diff --git a/OsmAnd-telegram/src/main/res/drawable/ic_launcher_background.xml b/OsmAnd-telegram/res/drawable/ic_launcher_background.xml similarity index 100% rename from OsmAnd-telegram/src/main/res/drawable/ic_launcher_background.xml rename to OsmAnd-telegram/res/drawable/ic_launcher_background.xml diff --git a/OsmAnd-telegram/src/main/res/layout/action_progress_bar.xml b/OsmAnd-telegram/res/layout/action_progress_bar.xml similarity index 100% rename from OsmAnd-telegram/src/main/res/layout/action_progress_bar.xml rename to OsmAnd-telegram/res/layout/action_progress_bar.xml diff --git a/OsmAnd-telegram/src/main/res/layout/activity_main.xml b/OsmAnd-telegram/res/layout/activity_main.xml similarity index 100% rename from OsmAnd-telegram/src/main/res/layout/activity_main.xml rename to OsmAnd-telegram/res/layout/activity_main.xml diff --git a/OsmAnd-telegram/src/main/res/layout/chat_list_item.xml b/OsmAnd-telegram/res/layout/chat_list_item.xml similarity index 100% rename from OsmAnd-telegram/src/main/res/layout/chat_list_item.xml rename to OsmAnd-telegram/res/layout/chat_list_item.xml diff --git a/OsmAnd-telegram/res/layout/install_osmand_dialog.xml b/OsmAnd-telegram/res/layout/install_osmand_dialog.xml new file mode 100644 index 0000000000..4708b4c39a --- /dev/null +++ b/OsmAnd-telegram/res/layout/install_osmand_dialog.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd-telegram/src/main/res/layout/login_dialog.xml b/OsmAnd-telegram/res/layout/login_dialog.xml similarity index 100% rename from OsmAnd-telegram/src/main/res/layout/login_dialog.xml rename to OsmAnd-telegram/res/layout/login_dialog.xml diff --git a/OsmAnd-telegram/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/OsmAnd-telegram/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to OsmAnd-telegram/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/OsmAnd-telegram/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/OsmAnd-telegram/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to OsmAnd-telegram/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/OsmAnd-telegram/src/main/res/mipmap-hdpi/ic_launcher.png b/OsmAnd-telegram/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-hdpi/ic_launcher.png rename to OsmAnd-telegram/res/mipmap-hdpi/ic_launcher.png diff --git a/OsmAnd-telegram/src/main/res/mipmap-hdpi/ic_launcher_round.png b/OsmAnd-telegram/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to OsmAnd-telegram/res/mipmap-hdpi/ic_launcher_round.png diff --git a/OsmAnd-telegram/src/main/res/mipmap-mdpi/ic_launcher.png b/OsmAnd-telegram/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-mdpi/ic_launcher.png rename to OsmAnd-telegram/res/mipmap-mdpi/ic_launcher.png diff --git a/OsmAnd-telegram/src/main/res/mipmap-mdpi/ic_launcher_round.png b/OsmAnd-telegram/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to OsmAnd-telegram/res/mipmap-mdpi/ic_launcher_round.png diff --git a/OsmAnd-telegram/src/main/res/mipmap-xhdpi/ic_launcher.png b/OsmAnd-telegram/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-xhdpi/ic_launcher.png rename to OsmAnd-telegram/res/mipmap-xhdpi/ic_launcher.png diff --git a/OsmAnd-telegram/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/OsmAnd-telegram/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to OsmAnd-telegram/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/OsmAnd-telegram/src/main/res/mipmap-xxhdpi/ic_launcher.png b/OsmAnd-telegram/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to OsmAnd-telegram/res/mipmap-xxhdpi/ic_launcher.png diff --git a/OsmAnd-telegram/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/OsmAnd-telegram/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to OsmAnd-telegram/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/OsmAnd-telegram/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/OsmAnd-telegram/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to OsmAnd-telegram/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/OsmAnd-telegram/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/OsmAnd-telegram/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from OsmAnd-telegram/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to OsmAnd-telegram/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/OsmAnd-telegram/src/main/res/values/attrs.xml b/OsmAnd-telegram/res/values/attrs.xml similarity index 100% rename from OsmAnd-telegram/src/main/res/values/attrs.xml rename to OsmAnd-telegram/res/values/attrs.xml diff --git a/OsmAnd-telegram/src/main/res/values/colors.xml b/OsmAnd-telegram/res/values/colors.xml similarity index 87% rename from OsmAnd-telegram/src/main/res/values/colors.xml rename to OsmAnd-telegram/res/values/colors.xml index 47081acdc2..90dde03d70 100644 --- a/OsmAnd-telegram/src/main/res/values/colors.xml +++ b/OsmAnd-telegram/res/values/colors.xml @@ -11,4 +11,6 @@ #ff8f00 + #2f7af5 + diff --git a/OsmAnd-telegram/src/main/res/values/dimens.xml b/OsmAnd-telegram/res/values/dimens.xml similarity index 100% rename from OsmAnd-telegram/src/main/res/values/dimens.xml rename to OsmAnd-telegram/res/values/dimens.xml diff --git a/OsmAnd-telegram/src/main/res/values/strings.xml b/OsmAnd-telegram/res/values/strings.xml similarity index 93% rename from OsmAnd-telegram/src/main/res/values/strings.xml rename to OsmAnd-telegram/res/values/strings.xml index 7ba6672170..dcb2637d44 100644 --- a/OsmAnd-telegram/src/main/res/values/strings.xml +++ b/OsmAnd-telegram/res/values/strings.xml @@ -28,6 +28,9 @@ Start Stop OsmAnd Telegram location service + OsmAnd logo + You need to install free or paid version of OsmAnd first + Install OsmAnd yd ft diff --git a/OsmAnd-telegram/src/main/res/values/styles.xml b/OsmAnd-telegram/res/values/styles.xml similarity index 100% rename from OsmAnd-telegram/src/main/res/values/styles.xml rename to OsmAnd-telegram/res/values/styles.xml diff --git a/OsmAnd-telegram/src/androidTest/java/net/osmand/telegram/ExampleInstrumentedTest.kt b/OsmAnd-telegram/src/androidTest/java/net/osmand/telegram/ExampleInstrumentedTest.kt deleted file mode 100644 index 0c433d5740..0000000000 --- a/OsmAnd-telegram/src/androidTest/java/net/osmand/telegram/ExampleInstrumentedTest.kt +++ /dev/null @@ -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) - } -} diff --git a/OsmAnd-telegram/src/main/java/net/osmand/PlatformUtil.java b/OsmAnd-telegram/src/net/osmand/PlatformUtil.java similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/PlatformUtil.java rename to OsmAnd-telegram/src/net/osmand/PlatformUtil.java diff --git a/OsmAnd-telegram/src/net/osmand/aidl/IOsmAndAidlInterface.aidl b/OsmAnd-telegram/src/net/osmand/aidl/IOsmAndAidlInterface.aidl new file mode 100644 index 0000000000..64410a3f9f --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/IOsmAndAidlInterface.aidl @@ -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 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); +} \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/calculateroute/CalculateRouteParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/calculateroute/CalculateRouteParams.aidl new file mode 100644 index 0000000000..017dd5e944 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/calculateroute/CalculateRouteParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.calculateroute; + +parcelable CalculateRouteParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/calculateroute/CalculateRouteParams.java b/OsmAnd-telegram/src/net/osmand/aidl/calculateroute/CalculateRouteParams.java new file mode 100644 index 0000000000..3cc660ec8a --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/calculateroute/CalculateRouteParams.java @@ -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 intermediatePoints = new ArrayList<>(); + private List intermediateNames = new ArrayList<>(); + + public CalculateRouteParams(ALatLon startPoint, String startPointName, + ALatLon endPoint, String endPointName, + List intermediatePoints, List 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 CREATOR = new + Parcelable.Creator() { + 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 getIntermediatePoints() { + return intermediatePoints; + } + + public List 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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/AFavorite.aidl b/OsmAnd-telegram/src/net/osmand/aidl/favorite/AFavorite.aidl new file mode 100644 index 0000000000..afd535fbe8 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/AFavorite.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite; + +parcelable AFavorite; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/AFavorite.java b/OsmAnd-telegram/src/net/osmand/aidl/favorite/AFavorite.java new file mode 100644 index 0000000000..b7fc057249 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/AFavorite.java @@ -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 CREATOR = new Creator() { + @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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/AddFavoriteParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/favorite/AddFavoriteParams.aidl new file mode 100644 index 0000000000..c546992b10 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/AddFavoriteParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite; + +parcelable AddFavoriteParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/AddFavoriteParams.java b/OsmAnd-telegram/src/net/osmand/aidl/favorite/AddFavoriteParams.java new file mode 100644 index 0000000000..87baeb5a99 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/AddFavoriteParams.java @@ -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 CREATOR = new Creator() { + @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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/RemoveFavoriteParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/favorite/RemoveFavoriteParams.aidl new file mode 100644 index 0000000000..37c08cd374 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/RemoveFavoriteParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite; + +parcelable RemoveFavoriteParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/RemoveFavoriteParams.java b/OsmAnd-telegram/src/net/osmand/aidl/favorite/RemoveFavoriteParams.java new file mode 100644 index 0000000000..15e2ca74bd --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/RemoveFavoriteParams.java @@ -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 CREATOR = new Creator() { + @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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/UpdateFavoriteParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/favorite/UpdateFavoriteParams.aidl new file mode 100644 index 0000000000..ba4a9364d3 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/UpdateFavoriteParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite; + +parcelable UpdateFavoriteParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/UpdateFavoriteParams.java b/OsmAnd-telegram/src/net/osmand/aidl/favorite/UpdateFavoriteParams.java new file mode 100644 index 0000000000..43fdfc13bd --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/UpdateFavoriteParams.java @@ -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 CREATOR = new Creator() { + @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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AFavoriteGroup.aidl b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AFavoriteGroup.aidl new file mode 100644 index 0000000000..baec925474 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AFavoriteGroup.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite.group; + +parcelable AFavoriteGroup; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AFavoriteGroup.java b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AFavoriteGroup.java new file mode 100644 index 0000000000..e9b6348468 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AFavoriteGroup.java @@ -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 CREATOR = new Creator() { + @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; + } +} \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.aidl new file mode 100644 index 0000000000..5850b5cd34 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite.group; + +parcelable AddFavoriteGroupParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.java b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.java new file mode 100644 index 0000000000..7cb3228572 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.java @@ -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 CREATOR = new Creator() { + @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; + } +} \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.aidl new file mode 100644 index 0000000000..e8b0710a01 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite.group; + +parcelable RemoveFavoriteGroupParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.java b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.java new file mode 100644 index 0000000000..0b17274440 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.java @@ -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 CREATOR = new Creator() { + @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; + } +} \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.aidl new file mode 100644 index 0000000000..e9001a8c5e --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite.group; + +parcelable UpdateFavoriteGroupParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.java b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.java new file mode 100644 index 0000000000..0ea52e1fda --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.java @@ -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 CREATOR = new Creator() { + @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; + } +} \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/ASelectedGpxFile.aidl b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ASelectedGpxFile.aidl new file mode 100644 index 0000000000..23fc3312b4 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ASelectedGpxFile.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable ASelectedGpxFile; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/ASelectedGpxFile.java b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ASelectedGpxFile.java new file mode 100644 index 0000000000..54d51bf882 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ASelectedGpxFile.java @@ -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 CREATOR = new + Creator() { + 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; + } +} + diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/HideGpxParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/gpx/HideGpxParams.aidl new file mode 100644 index 0000000000..4c8992552c --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/HideGpxParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable HideGpxParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/HideGpxParams.java b/OsmAnd-telegram/src/net/osmand/aidl/gpx/HideGpxParams.java new file mode 100644 index 0000000000..5e37c66f80 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/HideGpxParams.java @@ -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 CREATOR = new + Creator() { + 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; + } +} + diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/ImportGpxParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ImportGpxParams.aidl new file mode 100644 index 0000000000..23ecdb6ff3 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ImportGpxParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable ImportGpxParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/ImportGpxParams.java b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ImportGpxParams.java new file mode 100644 index 0000000000..6d2ed2cb88 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ImportGpxParams.java @@ -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 CREATOR = new + Creator() { + 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; + } +} \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/RemoveGpxParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/gpx/RemoveGpxParams.aidl new file mode 100644 index 0000000000..e9025f7a19 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/RemoveGpxParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable RemoveGpxParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/RemoveGpxParams.java b/OsmAnd-telegram/src/net/osmand/aidl/gpx/RemoveGpxParams.java new file mode 100644 index 0000000000..2253fa3616 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/RemoveGpxParams.java @@ -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 CREATOR = new + Creator() { + @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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/ShowGpxParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ShowGpxParams.aidl new file mode 100644 index 0000000000..217f600c4e --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ShowGpxParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable ShowGpxParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/ShowGpxParams.java b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ShowGpxParams.java new file mode 100644 index 0000000000..4d385a65a4 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/ShowGpxParams.java @@ -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 CREATOR = new + Creator() { + 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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/StartGpxRecordingParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/gpx/StartGpxRecordingParams.aidl new file mode 100644 index 0000000000..14f4871540 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/StartGpxRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable StartGpxRecordingParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/StartGpxRecordingParams.java b/OsmAnd-telegram/src/net/osmand/aidl/gpx/StartGpxRecordingParams.java new file mode 100644 index 0000000000..139eac8ea3 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/StartGpxRecordingParams.java @@ -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 CREATOR = new Creator() { + @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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/StopGpxRecordingParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/gpx/StopGpxRecordingParams.aidl new file mode 100644 index 0000000000..db08f1811a --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/StopGpxRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable StopGpxRecordingParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/gpx/StopGpxRecordingParams.java b/OsmAnd-telegram/src/net/osmand/aidl/gpx/StopGpxRecordingParams.java new file mode 100644 index 0000000000..ada47db418 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/gpx/StopGpxRecordingParams.java @@ -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 CREATOR = new Creator() { + @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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/map/ALatLon.aidl b/OsmAnd-telegram/src/net/osmand/aidl/map/ALatLon.aidl new file mode 100644 index 0000000000..33d5930f02 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/map/ALatLon.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.map; + +parcelable ALatLon; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/map/ALatLon.java b/OsmAnd-telegram/src/net/osmand/aidl/map/ALatLon.java new file mode 100644 index 0000000000..377344fd6a --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/map/ALatLon.java @@ -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 CREATOR = new + Parcelable.Creator() { + 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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/map/SetMapLocationParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/map/SetMapLocationParams.aidl new file mode 100644 index 0000000000..9edde4f616 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/map/SetMapLocationParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.map; + +parcelable SetMapLocationParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/map/SetMapLocationParams.java b/OsmAnd-telegram/src/net/osmand/aidl/map/SetMapLocationParams.java new file mode 100644 index 0000000000..929c817d9d --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/map/SetMapLocationParams.java @@ -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 CREATOR = new + Creator() { + 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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AMapLayer.aidl b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AMapLayer.aidl new file mode 100644 index 0000000000..745f49f1a5 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AMapLayer.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer; + +parcelable AMapLayer; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AMapLayer.java b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AMapLayer.java new file mode 100644 index 0000000000..79f82d97bc --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AMapLayer.java @@ -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 points = new ConcurrentHashMap<>(); + + public AMapLayer(String id, String name, float zOrder, List 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 CREATOR = new + Parcelable.Creator() { + 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 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 pointList = new ArrayList<>(); + in.readTypedList(pointList, AMapPoint.CREATOR); + for (AMapPoint p : pointList) { + this.points.put(p.getId(), p); + } + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AddMapLayerParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AddMapLayerParams.aidl new file mode 100644 index 0000000000..8116760a45 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AddMapLayerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer; + +parcelable AddMapLayerParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AddMapLayerParams.java b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AddMapLayerParams.java new file mode 100644 index 0000000000..38e9e53667 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/AddMapLayerParams.java @@ -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 CREATOR = new + Creator() { + 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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/RemoveMapLayerParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/RemoveMapLayerParams.aidl new file mode 100644 index 0000000000..20a972ee95 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/RemoveMapLayerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer; + +parcelable RemoveMapLayerParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/RemoveMapLayerParams.java b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/RemoveMapLayerParams.java new file mode 100644 index 0000000000..3e87627445 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/RemoveMapLayerParams.java @@ -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 CREATOR = new + Creator() { + 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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/UpdateMapLayerParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/UpdateMapLayerParams.aidl new file mode 100644 index 0000000000..eafe8ef464 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/UpdateMapLayerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer; + +parcelable UpdateMapLayerParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/UpdateMapLayerParams.java b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/UpdateMapLayerParams.java new file mode 100644 index 0000000000..a2f6e16498 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/UpdateMapLayerParams.java @@ -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 CREATOR = new + Creator() { + 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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AMapPoint.aidl b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AMapPoint.aidl new file mode 100644 index 0000000000..53fb86b788 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AMapPoint.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer.point; + +parcelable AMapPoint; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AMapPoint.java b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AMapPoint.java new file mode 100644 index 0000000000..1d0d2e01e8 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AMapPoint.java @@ -0,0 +1,99 @@ +package net.osmand.aidl.maplayer.point; + +import android.os.Parcel; +import android.os.Parcelable; + +import net.osmand.aidl.map.ALatLon; + +import java.util.ArrayList; +import java.util.List; + +public class AMapPoint implements Parcelable { + private String id; + private String shortName; + private String fullName; + private String typeName; + private int color; + private ALatLon location; + private List details = new ArrayList<>(); + + public AMapPoint(String id, String shortName, String fullName, String typeName, int color, + ALatLon location, List details) { + this.id = id; + this.shortName = shortName; + this.fullName = fullName; + this.typeName = typeName; + this.color = color; + this.location = location; + if (details != null) { + this.details.addAll(details); + } + } + + public AMapPoint(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public AMapPoint createFromParcel(Parcel in) { + return new AMapPoint(in); + } + + public AMapPoint[] newArray(int size) { + return new AMapPoint[size]; + } + }; + + public String getId() { + return id; + } + + public String getShortName() { + return shortName; + } + + public String getFullName() { + return fullName; + } + + public String getTypeName() { + return typeName; + } + + public int getColor() { + return color; + } + + public ALatLon getLocation() { + return location; + } + + public List getDetails() { + return details; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(id); + out.writeString(shortName); + out.writeString(fullName); + out.writeString(typeName); + out.writeInt(color); + out.writeParcelable(location, flags); + out.writeStringList(details); + } + + private void readFromParcel(Parcel in) { + id = in.readString(); + shortName = in.readString(); + fullName = in.readString(); + typeName = in.readString(); + color = in.readInt(); + location = in.readParcelable(ALatLon.class.getClassLoader()); + in.readStringList(details); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AddMapPointParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AddMapPointParams.aidl new file mode 100644 index 0000000000..d41d6b69ca --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AddMapPointParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer.point; + +parcelable AddMapPointParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AddMapPointParams.java b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AddMapPointParams.java new file mode 100644 index 0000000000..0d575a38d9 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/AddMapPointParams.java @@ -0,0 +1,51 @@ +package net.osmand.aidl.maplayer.point; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AddMapPointParams implements Parcelable { + 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 CREATOR = new + Creator() { + public AddMapPointParams createFromParcel(Parcel in) { + return new AddMapPointParams(in); + } + + public AddMapPointParams[] newArray(int size) { + return new AddMapPointParams[size]; + } + }; + + public String getLayerId() { + return layerId; + } + + public AMapPoint getPoint() { + return point; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(layerId); + out.writeParcelable(point, flags); + } + + private void readFromParcel(Parcel in) { + layerId = in.readString(); + point = in.readParcelable(AMapPoint.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/RemoveMapPointParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/RemoveMapPointParams.aidl new file mode 100644 index 0000000000..68a5fdcf11 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/RemoveMapPointParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer.point; + +parcelable RemoveMapPointParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/RemoveMapPointParams.java b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/RemoveMapPointParams.java new file mode 100644 index 0000000000..797556b1e3 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/RemoveMapPointParams.java @@ -0,0 +1,51 @@ +package net.osmand.aidl.maplayer.point; + +import android.os.Parcel; +import android.os.Parcelable; + +public class RemoveMapPointParams implements Parcelable { + 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 CREATOR = new + Creator() { + public RemoveMapPointParams createFromParcel(Parcel in) { + return new RemoveMapPointParams(in); + } + + public RemoveMapPointParams[] newArray(int size) { + return new RemoveMapPointParams[size]; + } + }; + + public String getLayerId() { + return layerId; + } + + public String getPointId() { + return pointId; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(layerId); + out.writeString(pointId); + } + + private void readFromParcel(Parcel in) { + layerId = in.readString(); + pointId = in.readString(); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/UpdateMapPointParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/UpdateMapPointParams.aidl new file mode 100644 index 0000000000..d81ea87253 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/UpdateMapPointParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer.point; + +parcelable UpdateMapPointParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/UpdateMapPointParams.java b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/UpdateMapPointParams.java new file mode 100644 index 0000000000..178af20b1d --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/maplayer/point/UpdateMapPointParams.java @@ -0,0 +1,51 @@ +package net.osmand.aidl.maplayer.point; + +import android.os.Parcel; +import android.os.Parcelable; + +public class UpdateMapPointParams implements Parcelable { + private String layerId; + private AMapPoint point; + + public UpdateMapPointParams(String layerId, AMapPoint point) { + this.layerId = layerId; + this.point = point; + } + + public UpdateMapPointParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public UpdateMapPointParams createFromParcel(Parcel in) { + return new UpdateMapPointParams(in); + } + + public UpdateMapPointParams[] newArray(int size) { + return new UpdateMapPointParams[size]; + } + }; + + public String getLayerId() { + return layerId; + } + + public AMapPoint getPoint() { + return point; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(layerId); + out.writeParcelable(point, flags); + } + + private void readFromParcel(Parcel in) { + layerId = in.readString(); + point = in.readParcelable(AMapPoint.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AMapMarker.aidl b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AMapMarker.aidl new file mode 100644 index 0000000000..4721b1812b --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AMapMarker.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapmarker; + +parcelable AMapMarker; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AMapMarker.java b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AMapMarker.java new file mode 100644 index 0000000000..083b5bbb37 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AMapMarker.java @@ -0,0 +1,63 @@ +package net.osmand.aidl.mapmarker; + +import android.os.Parcel; +import android.os.Parcelable; + +import net.osmand.aidl.map.ALatLon; + +public class AMapMarker implements Parcelable { + + 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 Parcelable.Creator CREATOR = new + Parcelable.Creator() { + public AMapMarker createFromParcel(Parcel in) { + return new AMapMarker(in); + } + + public AMapMarker[] newArray(int size) { + return new AMapMarker[size]; + } + }; + + public ALatLon getLatLon() { + return latLon; + } + + public String getName() { + return name; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(latLon, flags); + out.writeString(name); + } + + private void readFromParcel(Parcel in) { + latLon = in.readParcelable(ALatLon.class.getClassLoader()); + name = in.readString(); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AddMapMarkerParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AddMapMarkerParams.aidl new file mode 100644 index 0000000000..eef370b4e2 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AddMapMarkerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapmarker; + +parcelable AddMapMarkerParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AddMapMarkerParams.java b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AddMapMarkerParams.java new file mode 100644 index 0000000000..cc707006e4 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/AddMapMarkerParams.java @@ -0,0 +1,44 @@ +package net.osmand.aidl.mapmarker; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AddMapMarkerParams implements Parcelable { + + private AMapMarker marker; + + public AddMapMarkerParams(AMapMarker marker) { + this.marker = marker; + } + + public AddMapMarkerParams(Parcel in) { + readFromParcel(in); + } + + public static final Parcelable.Creator CREATOR = new + Parcelable.Creator() { + public AddMapMarkerParams createFromParcel(Parcel in) { + return new AddMapMarkerParams(in); + } + + public AddMapMarkerParams[] newArray(int size) { + return new AddMapMarkerParams[size]; + } + }; + + public AMapMarker getMarker() { + return marker; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(marker, flags); + } + + private void readFromParcel(Parcel in) { + marker = in.readParcelable(AMapMarker.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.aidl new file mode 100644 index 0000000000..e5b5b126ad --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapmarker; + +parcelable RemoveMapMarkerParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.java b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.java new file mode 100644 index 0000000000..08f489922c --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.java @@ -0,0 +1,44 @@ +package net.osmand.aidl.mapmarker; + +import android.os.Parcel; +import android.os.Parcelable; + +public class RemoveMapMarkerParams implements Parcelable { + + private AMapMarker marker; + + public RemoveMapMarkerParams(AMapMarker marker) { + this.marker = marker; + } + + public RemoveMapMarkerParams(Parcel in) { + readFromParcel(in); + } + + public static final Parcelable.Creator CREATOR = new + Parcelable.Creator() { + public RemoveMapMarkerParams createFromParcel(Parcel in) { + return new RemoveMapMarkerParams(in); + } + + public RemoveMapMarkerParams[] newArray(int size) { + return new RemoveMapMarkerParams[size]; + } + }; + + public AMapMarker getMarker() { + return marker; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(marker, flags); + } + + private void readFromParcel(Parcel in) { + marker = in.readParcelable(AMapMarker.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.aidl new file mode 100644 index 0000000000..2a17fa9369 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapmarker; + +parcelable UpdateMapMarkerParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.java b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.java new file mode 100644 index 0000000000..d03bc0d7f6 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.java @@ -0,0 +1,52 @@ +package net.osmand.aidl.mapmarker; + +import android.os.Parcel; +import android.os.Parcelable; + +public class UpdateMapMarkerParams implements Parcelable { + + private AMapMarker markerPrev; + private AMapMarker markerNew; + + public UpdateMapMarkerParams(AMapMarker markerPrev, AMapMarker markerNew) { + this.markerPrev = markerPrev; + this.markerNew = markerNew; + } + + public UpdateMapMarkerParams(Parcel in) { + readFromParcel(in); + } + + public static final Parcelable.Creator CREATOR = new + Parcelable.Creator() { + public UpdateMapMarkerParams createFromParcel(Parcel in) { + return new UpdateMapMarkerParams(in); + } + + public UpdateMapMarkerParams[] newArray(int size) { + return new UpdateMapMarkerParams[size]; + } + }; + + public AMapMarker getMarkerPrev() { + return markerPrev; + } + + public AMapMarker getMarkerNew() { + return markerNew; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(markerPrev, flags); + out.writeParcelable(markerNew, flags); + } + + private void readFromParcel(Parcel in) { + markerPrev = in.readParcelable(AMapMarker.class.getClassLoader()); + markerNew = in.readParcelable(AMapMarker.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AMapWidget.aidl b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AMapWidget.aidl new file mode 100644 index 0000000000..7798986483 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AMapWidget.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapwidget; + +parcelable AMapWidget; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AMapWidget.java b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AMapWidget.java new file mode 100644 index 0000000000..f6fac08942 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AMapWidget.java @@ -0,0 +1,110 @@ +package net.osmand.aidl.mapwidget; + +import android.content.Intent; +import android.os.Parcel; +import android.os.Parcelable; + +public class AMapWidget implements Parcelable { + private String id; + private String menuIconName; + private String menuTitle; + private String lightIconName; + private String darkIconName; + private String text; + private String description; + private int order; + private Intent intentOnClick; + + public AMapWidget(String id, String menuIconName, String menuTitle, + String lightIconName, String darkIconName, String text, String description, + int order, Intent intentOnClick) { + this.id = id; + this.menuIconName = menuIconName; + this.menuTitle = menuTitle; + this.lightIconName = lightIconName; + this.darkIconName = darkIconName; + this.text = text; + this.description = description; + this.order = order; + this.intentOnClick = intentOnClick; + } + + public AMapWidget(Parcel in) { + readFromParcel(in); + } + + public static final Parcelable.Creator CREATOR = new + Parcelable.Creator() { + public AMapWidget createFromParcel(Parcel in) { + return new AMapWidget(in); + } + + public AMapWidget[] newArray(int size) { + return new AMapWidget[size]; + } + }; + + public String getId() { + return id; + } + + public String getMenuIconName() { + return menuIconName; + } + + public String getMenuTitle() { + return menuTitle; + } + + public String getLightIconName() { + return lightIconName; + } + + public String getDarkIconName() { + return darkIconName; + } + + public String getText() { + return text; + } + + public String getDescription() { + return description; + } + + public int getOrder() { + return order; + } + + public Intent getIntentOnClick() { + return intentOnClick; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(id); + out.writeString(menuIconName); + out.writeString(menuTitle); + out.writeString(lightIconName); + out.writeString(darkIconName); + out.writeString(text); + out.writeString(description); + out.writeInt(order); + out.writeParcelable(intentOnClick, flags); + } + + private void readFromParcel(Parcel in) { + id = in.readString(); + menuIconName = in.readString(); + menuTitle = in.readString(); + lightIconName = in.readString(); + darkIconName = in.readString(); + text = in.readString(); + description = in.readString(); + order = in.readInt(); + intentOnClick = in.readParcelable(Intent.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AddMapWidgetParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AddMapWidgetParams.aidl new file mode 100644 index 0000000000..891d338eb8 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AddMapWidgetParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapwidget; + +parcelable AddMapWidgetParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AddMapWidgetParams.java b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AddMapWidgetParams.java new file mode 100644 index 0000000000..69b337209e --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/AddMapWidgetParams.java @@ -0,0 +1,43 @@ +package net.osmand.aidl.mapwidget; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AddMapWidgetParams implements Parcelable { + private AMapWidget widget; + + public AddMapWidgetParams(AMapWidget widget) { + this.widget = widget; + } + + public AddMapWidgetParams(Parcel in) { + readFromParcel(in); + } + + public static final Parcelable.Creator CREATOR = new + Parcelable.Creator() { + public AddMapWidgetParams createFromParcel(Parcel in) { + return new AddMapWidgetParams(in); + } + + public AddMapWidgetParams[] newArray(int size) { + return new AddMapWidgetParams[size]; + } + }; + + public AMapWidget getWidget() { + return widget; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(widget, flags); + } + + private void readFromParcel(Parcel in) { + widget = in.readParcelable(AMapWidget.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.aidl new file mode 100644 index 0000000000..445b0c994d --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapwidget; + +parcelable RemoveMapWidgetParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.java b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.java new file mode 100644 index 0000000000..e1433d530c --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.java @@ -0,0 +1,43 @@ +package net.osmand.aidl.mapwidget; + +import android.os.Parcel; +import android.os.Parcelable; + +public class RemoveMapWidgetParams implements Parcelable { + private String id; + + public RemoveMapWidgetParams(String id) { + this.id = id; + } + + public RemoveMapWidgetParams(Parcel in) { + readFromParcel(in); + } + + public static final Parcelable.Creator CREATOR = new + Parcelable.Creator() { + public RemoveMapWidgetParams createFromParcel(Parcel in) { + return new RemoveMapWidgetParams(in); + } + + public RemoveMapWidgetParams[] newArray(int size) { + return new RemoveMapWidgetParams[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; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.aidl new file mode 100644 index 0000000000..b92f94c008 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapwidget; + +parcelable UpdateMapWidgetParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.java b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.java new file mode 100644 index 0000000000..07114ad16e --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.java @@ -0,0 +1,43 @@ +package net.osmand.aidl.mapwidget; + +import android.os.Parcel; +import android.os.Parcelable; + +public class UpdateMapWidgetParams implements Parcelable { + private AMapWidget widget; + + public UpdateMapWidgetParams(AMapWidget widget) { + this.widget = widget; + } + + public UpdateMapWidgetParams(Parcel in) { + readFromParcel(in); + } + + public static final Parcelable.Creator CREATOR = new + Parcelable.Creator() { + public UpdateMapWidgetParams createFromParcel(Parcel in) { + return new UpdateMapWidgetParams(in); + } + + public UpdateMapWidgetParams[] newArray(int size) { + return new UpdateMapWidgetParams[size]; + } + }; + + public AMapWidget getWidget() { + return widget; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(widget, flags); + } + + private void readFromParcel(Parcel in) { + widget = in.readParcelable(AMapWidget.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateGpxParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateGpxParams.aidl new file mode 100644 index 0000000000..dea59ed048 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateGpxParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable NavigateGpxParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateGpxParams.java b/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateGpxParams.java new file mode 100644 index 0000000000..6e8fb8efe7 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateGpxParams.java @@ -0,0 +1,69 @@ +package net.osmand.aidl.navigation; + +import android.net.Uri; +import android.os.Parcel; +import android.os.Parcelable; + +public class NavigateGpxParams implements Parcelable { + + private String data; + private Uri uri; + private boolean force; + + public NavigateGpxParams(String data, boolean force) { + this.data = data; + this.force = force; + } + + public NavigateGpxParams(Uri uri, boolean force) { + this.uri = uri; + this.force = force; + } + + public NavigateGpxParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public NavigateGpxParams createFromParcel(Parcel in) { + return new NavigateGpxParams(in); + } + + @Override + public NavigateGpxParams[] newArray(int size) { + return new NavigateGpxParams[size]; + } + }; + + public String getData() { + return data; + } + + public Uri getUri() { + return uri; + } + + public boolean isForce() { + return force; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(data); + out.writeParcelable(uri, flags); + out.writeByte((byte) (force ? 1 : 0)); + } + + private void readFromParcel(Parcel in) { + data = in.readString(); + uri = in.readParcelable(Uri.class.getClassLoader()); + force = in.readByte() != 0; + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateParams.aidl new file mode 100644 index 0000000000..f9b51d7a8c --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable NavigateParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateParams.java b/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateParams.java new file mode 100644 index 0000000000..8b0bdeb1eb --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/navigation/NavigateParams.java @@ -0,0 +1,104 @@ +package net.osmand.aidl.navigation; + +import android.os.Parcel; +import android.os.Parcelable; + +public class NavigateParams implements Parcelable { + + private String startName; + private double startLat; + private double startLon; + private String destName; + private double destLat; + private double destLon; + private String profile; + private boolean force; + + public NavigateParams(String startName, double startLat, double startLon, String destName, double destLat, double destLon, String profile, boolean force) { + this.startName = startName; + this.startLat = startLat; + this.startLon = startLon; + this.destName = destName; + this.destLat = destLat; + this.destLon = destLon; + this.profile = profile; + this.force = force; + } + + public NavigateParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public NavigateParams createFromParcel(Parcel in) { + return new NavigateParams(in); + } + + @Override + public NavigateParams[] newArray(int size) { + return new NavigateParams[size]; + } + }; + + public String getStartName() { + return startName; + } + + public double getStartLat() { + return startLat; + } + + public double getStartLon() { + return startLon; + } + + public String getDestName() { + return destName; + } + + public double getDestLat() { + return destLat; + } + + public double getDestLon() { + return destLon; + } + + public String getProfile() { + return profile; + } + + public boolean isForce() { + return force; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(startName); + out.writeDouble(startLat); + out.writeDouble(startLon); + out.writeString(destName); + out.writeDouble(destLat); + out.writeDouble(destLon); + out.writeString(profile); + out.writeByte((byte) (force ? 1 : 0)); + } + + private void readFromParcel(Parcel in) { + startName = in.readString(); + startLat = in.readDouble(); + startLon = in.readDouble(); + destName = in.readString(); + destLat = in.readDouble(); + destLon = in.readDouble(); + profile = in.readString(); + force = in.readByte() != 0; + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/note/StartAudioRecordingParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/note/StartAudioRecordingParams.aidl new file mode 100644 index 0000000000..bb16dea140 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/note/StartAudioRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable StartAudioRecordingParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/note/StartAudioRecordingParams.java b/OsmAnd-telegram/src/net/osmand/aidl/note/StartAudioRecordingParams.java new file mode 100644 index 0000000000..c2800feb9c --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/note/StartAudioRecordingParams.java @@ -0,0 +1,56 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StartAudioRecordingParams implements Parcelable { + + private double latitude; + private double longitude; + + public StartAudioRecordingParams(double latitude, double longitude) { + this.latitude = latitude; + this.longitude = longitude; + } + + public StartAudioRecordingParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StartAudioRecordingParams createFromParcel(Parcel in) { + return new StartAudioRecordingParams(in); + } + + @Override + public StartAudioRecordingParams[] newArray(int size) { + return new StartAudioRecordingParams[size]; + } + }; + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + } + + private void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/note/StartVideoRecordingParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/note/StartVideoRecordingParams.aidl new file mode 100644 index 0000000000..082b68e09c --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/note/StartVideoRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable StartVideoRecordingParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/note/StartVideoRecordingParams.java b/OsmAnd-telegram/src/net/osmand/aidl/note/StartVideoRecordingParams.java new file mode 100644 index 0000000000..aee86ea9de --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/note/StartVideoRecordingParams.java @@ -0,0 +1,56 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StartVideoRecordingParams implements Parcelable { + + private double latitude; + private double longitude; + + public StartVideoRecordingParams(double latitude, double longitude) { + this.latitude = latitude; + this.longitude = longitude; + } + + public StartVideoRecordingParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StartVideoRecordingParams createFromParcel(Parcel in) { + return new StartVideoRecordingParams(in); + } + + @Override + public StartVideoRecordingParams[] newArray(int size) { + return new StartVideoRecordingParams[size]; + } + }; + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + } + + private void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd-telegram/src/net/osmand/aidl/note/StopRecordingParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/note/StopRecordingParams.aidl new file mode 100644 index 0000000000..4111efbcb6 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/note/StopRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable StopRecordingParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/note/StopRecordingParams.java b/OsmAnd-telegram/src/net/osmand/aidl/note/StopRecordingParams.java new file mode 100644 index 0000000000..b56a42504b --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/note/StopRecordingParams.java @@ -0,0 +1,42 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StopRecordingParams implements Parcelable { + + public StopRecordingParams() { + + } + + public StopRecordingParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StopRecordingParams createFromParcel(Parcel in) { + return new StopRecordingParams(in); + } + + @Override + public StopRecordingParams[] newArray(int size) { + return new StopRecordingParams[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + + } + + private void readFromParcel(Parcel in) { + + } + + @Override + public int describeContents() { + return 0; + } + +} \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/note/TakePhotoNoteParams.aidl b/OsmAnd-telegram/src/net/osmand/aidl/note/TakePhotoNoteParams.aidl new file mode 100644 index 0000000000..3c09d62c41 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/note/TakePhotoNoteParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable TakePhotoNoteParams; \ No newline at end of file diff --git a/OsmAnd-telegram/src/net/osmand/aidl/note/TakePhotoNoteParams.java b/OsmAnd-telegram/src/net/osmand/aidl/note/TakePhotoNoteParams.java new file mode 100644 index 0000000000..254516e080 --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/aidl/note/TakePhotoNoteParams.java @@ -0,0 +1,56 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class TakePhotoNoteParams implements Parcelable { + + private double latitude; + private double longitude; + + public TakePhotoNoteParams(double latitude, double longitude) { + this.latitude = latitude; + this.longitude = longitude; + } + + public TakePhotoNoteParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public TakePhotoNoteParams createFromParcel(Parcel in) { + return new TakePhotoNoteParams(in); + } + + @Override + public TakePhotoNoteParams[] newArray(int size) { + return new TakePhotoNoteParams[size]; + } + }; + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + } + + private void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/LocationService.kt b/OsmAnd-telegram/src/net/osmand/telegram/LocationService.kt similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/LocationService.kt rename to OsmAnd-telegram/src/net/osmand/telegram/LocationService.kt diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/LoginDialogFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/LoginDialogFragment.kt similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/LoginDialogFragment.kt rename to OsmAnd-telegram/src/net/osmand/telegram/LoginDialogFragment.kt diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/MainActivity.kt b/OsmAnd-telegram/src/net/osmand/telegram/MainActivity.kt similarity index 86% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/MainActivity.kt rename to OsmAnd-telegram/src/net/osmand/telegram/MainActivity.kt index b1795fecd1..ede5a2edb5 100644 --- a/OsmAnd-telegram/src/main/java/net/osmand/telegram/MainActivity.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/MainActivity.kt @@ -1,9 +1,14 @@ package net.osmand.telegram import android.Manifest +import android.app.Dialog +import android.content.Intent import android.content.pm.PackageManager +import android.net.Uri import android.os.Bundle import android.support.v4.app.ActivityCompat +import android.support.v4.app.DialogFragment +import android.support.v7.app.AlertDialog import android.support.v7.app.AppCompatActivity import android.support.v7.widget.* import android.view.* @@ -85,8 +90,10 @@ class MainActivity : AppCompatActivity(), TelegramListener { invalidateOptionsMenu() updateTitle() - if (settings.hasAnyChatToShareLocation() && AndroidUtils.isLocationPermissionAvailable(this)) { + if (settings.hasAnyChatToShareLocation() && !AndroidUtils.isLocationPermissionAvailable(this)) { requestLocationPermission() + } else if (settings.hasAnyChatToShowOnMap() && !app.osmandHelper.isOsmandBound()) { + showOsmandMissingDialog() } } @@ -273,24 +280,44 @@ class MainActivity : AppCompatActivity(), TelegramListener { } private fun requestLocationPermission() { - if (!AndroidUtils.isLocationPermissionAvailable(this)) { - ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.ACCESS_FINE_LOCATION), PERMISSION_REQUEST_LOCATION) - } + ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.ACCESS_FINE_LOCATION), PERMISSION_REQUEST_LOCATION) } override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { super.onRequestPermissionsResult(requestCode, permissions, grantResults) - if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { - when (requestCode) { - PERMISSION_REQUEST_LOCATION -> { + when (requestCode) { + PERMISSION_REQUEST_LOCATION -> { + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { if (settings.hasAnyChatToShareLocation()) { app.shareLocationHelper.startSharingLocation() } } + if (settings.hasAnyChatToShowOnMap() && app.osmandHelper.isOsmandBound()) { + showOsmandMissingDialog() + } } } } + fun showOsmandMissingDialog() { + OsmandMissingDialogFragment().show(supportFragmentManager, null) + } + + class OsmandMissingDialogFragment : DialogFragment() { + + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { + val builder = AlertDialog.Builder(requireContext()) + builder.setView(R.layout.install_osmand_dialog) + .setNegativeButton("Cancel", null) + .setPositiveButton("Install", { _, _ -> + val intent = Intent() + intent.data = Uri.parse("market://details?id=net.osmand.plus") + startActivity(intent) + }) + return builder.create() + } + } + inner class ChatsAdapter : RecyclerView.Adapter() { @@ -322,7 +349,9 @@ class MainActivity : AppCompatActivity(), TelegramListener { settings.shareLocationToChat(chatTitle, isChecked) if (settings.hasAnyChatToShareLocation()) { if (!AndroidUtils.isLocationPermissionAvailable(view.context)) { - requestLocationPermission() + if (isChecked) { + requestLocationPermission() + } } else { app.shareLocationHelper.startSharingLocation() } @@ -336,7 +365,13 @@ class MainActivity : AppCompatActivity(), TelegramListener { holder.showOnMapSwitch?.setOnCheckedChangeListener { view, isChecked -> settings.showChatOnMap(chatTitle, isChecked) if (settings.hasAnyChatToShowOnMap()) { - //app.shareLocationHelper.startSharingLocation() + if (!app.osmandHelper.isOsmandBound()) { + if (isChecked) { + showOsmandMissingDialog() + } + } else { + //app.shareLocationHelper.startSharingLocation() + } } else { //app.shareLocationHelper.stopSharingLocation() } diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/TelegramApplication.kt b/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt similarity index 94% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/TelegramApplication.kt rename to OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt index 892a8817df..affb055ff1 100644 --- a/OsmAnd-telegram/src/main/java/net/osmand/telegram/TelegramApplication.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt @@ -7,6 +7,7 @@ import android.net.ConnectivityManager import android.net.NetworkInfo import android.os.Build import android.os.Handler +import net.osmand.telegram.helpers.OsmandAidlHelper import net.osmand.telegram.helpers.ShareLocationHelper import net.osmand.telegram.helpers.TelegramHelper import net.osmand.telegram.notifications.NotificationHelper @@ -18,6 +19,7 @@ class TelegramApplication : Application() { lateinit var settings: TelegramSettings private set lateinit var shareLocationHelper: ShareLocationHelper private set lateinit var notificationHelper: NotificationHelper private set + lateinit var osmandHelper: OsmandAidlHelper private set var locationService: LocationService? = null @@ -33,6 +35,7 @@ class TelegramApplication : Application() { settings = TelegramSettings(this) shareLocationHelper = ShareLocationHelper(this) notificationHelper = NotificationHelper(this) + osmandHelper = OsmandAidlHelper(this) if (settings.hasAnyChatToShareLocation() && AndroidUtils.isLocationPermissionAvailable(this)) { shareLocationHelper.startSharingLocation() @@ -42,6 +45,7 @@ class TelegramApplication : Application() { override fun onTerminate() { super.onTerminate() // TODO close telegram api in appropriate place + osmandHelper.cleanupResources() telegramHelper.close() } diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/TelegramSettings.kt b/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/TelegramSettings.kt rename to OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/OsmandAidlHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/OsmandAidlHelper.kt new file mode 100644 index 0000000000..ba37d519be --- /dev/null +++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/OsmandAidlHelper.kt @@ -0,0 +1,815 @@ +package net.osmand.telegram.helpers + +import android.app.Application +import android.content.ComponentName +import android.content.Context +import android.content.Intent +import android.content.ServiceConnection +import android.net.Uri +import android.os.IBinder +import android.os.RemoteException +import android.widget.Toast +import net.osmand.aidl.IOsmAndAidlInterface +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.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.gpx.* +import net.osmand.aidl.map.ALatLon +import net.osmand.aidl.map.SetMapLocationParams +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.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.mapmarker.AMapMarker +import net.osmand.aidl.mapmarker.AddMapMarkerParams +import net.osmand.aidl.mapmarker.RemoveMapMarkerParams +import net.osmand.aidl.mapmarker.UpdateMapMarkerParams +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.navigation.NavigateGpxParams +import net.osmand.aidl.navigation.NavigateParams +import net.osmand.aidl.note.StartAudioRecordingParams +import net.osmand.aidl.note.StartVideoRecordingParams +import net.osmand.aidl.note.StopRecordingParams +import net.osmand.aidl.note.TakePhotoNoteParams +import java.io.File +import java.util.* + +class OsmandAidlHelper(private val app: Application) { + + companion object { + private const val OSMAND_FREE_PACKAGE_NAME = "net.osmand" + private const val OSMAND_PLUS_PACKAGE_NAME = "net.osmand.plus" + private var OSMAND_PACKAGE_NAME = OSMAND_PLUS_PACKAGE_NAME + } + + private var mIOsmAndAidlInterface: IOsmAndAidlInterface? = null + + /** + * Class for interacting with the main interface of the service. + */ + private val mConnection = object : ServiceConnection { + override fun onServiceConnected(className: ComponentName, + service: IBinder) { + // This is called when the connection with the service has been + // established, giving us the service object we can use to + // interact with the service. We are communicating with our + // service through an IDL interface, so get a client-side + // representation of that from the raw service object. + mIOsmAndAidlInterface = IOsmAndAidlInterface.Stub.asInterface(service) + Toast.makeText(app, "OsmAnd service connected", Toast.LENGTH_SHORT).show() + } + + override fun onServiceDisconnected(className: ComponentName) { + // This is called when the connection with the service has been + // unexpectedly disconnected -- that is, its process crashed. + mIOsmAndAidlInterface = null + Toast.makeText(app, "OsmAnd service disconnected", Toast.LENGTH_SHORT).show() + } + } + + fun isOsmandBound(): Boolean { + return mIOsmAndAidlInterface != null + } + + /** + * Get list of active GPX files. + * + * @return list of active gpx files. + */ + val activeGpxFiles: List? + get() { + if (mIOsmAndAidlInterface != null) { + try { + val res = ArrayList() + if (mIOsmAndAidlInterface!!.getActiveGpx(res)) { + return res + } + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return null + } + + init { + when { + bindService(OSMAND_PLUS_PACKAGE_NAME) -> OSMAND_PACKAGE_NAME = OSMAND_PLUS_PACKAGE_NAME + bindService(OSMAND_FREE_PACKAGE_NAME) -> OSMAND_PACKAGE_NAME = OSMAND_FREE_PACKAGE_NAME + else -> { + Toast.makeText(app, "OsmAnd service NOT bind", Toast.LENGTH_SHORT).show() + } + } + } + + private fun bindService(packageName: String): Boolean { + return if (mIOsmAndAidlInterface == null) { + val intent = Intent("net.osmand.aidl.OsmandAidlService") + intent.`package` = packageName + val res = app.bindService(intent, mConnection, Context.BIND_AUTO_CREATE) + if (res) { + Toast.makeText(app, "OsmAnd service bind", Toast.LENGTH_SHORT).show() + true + } else { + false + } + } else { + true + } + } + + fun cleanupResources() { + if (mIOsmAndAidlInterface != null) { + app.unbindService(mConnection) + } + } + + fun refreshMap(): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.refreshMap() + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Add favorite group with given params. + * + * @param name - group name. + * @param color - group color. Can be one of: "red", "orange", "yellow", + * "lightgreen", "green", "lightblue", "blue", "purple", "pink", "brown". + * @param visible - group visibility. + */ + fun addFavoriteGroup(name: String, color: String, visible: Boolean): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val favoriteGroup = AFavoriteGroup(name, color, visible) + return mIOsmAndAidlInterface!!.addFavoriteGroup(AddFavoriteGroupParams(favoriteGroup)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Update favorite group with given params. + * + * @param namePrev - group name (current). + * @param colorPrev - group color (current). + * @param visiblePrev - group visibility (current). + * @param nameNew - group name (new). + * @param colorNew - group color (new). + * @param visibleNew - group visibility (new). + */ + fun updateFavoriteGroup(namePrev: String, colorPrev: String, visiblePrev: Boolean, + nameNew: String, colorNew: String, visibleNew: Boolean): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val favoriteGroupPrev = AFavoriteGroup(namePrev, colorPrev, visiblePrev) + val favoriteGroupNew = AFavoriteGroup(nameNew, colorNew, visibleNew) + return mIOsmAndAidlInterface!!.updateFavoriteGroup(UpdateFavoriteGroupParams(favoriteGroupPrev, favoriteGroupNew)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Remove favorite group with given name. + * + * @param name - name of favorite group. + */ + fun removeFavoriteGroup(name: String): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val favoriteGroup = AFavoriteGroup(name, "", false) + return mIOsmAndAidlInterface!!.removeFavoriteGroup(RemoveFavoriteGroupParams(favoriteGroup)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Add favorite at given location with given params. + * + * @param lat - latitude. + * @param lon - longitude. + * @param name - name of favorite item. + * @param description - description of favorite item. + * @param category - category of favorite item. + * @param color - color of favorite item. Can be one of: "red", "orange", "yellow", + * "lightgreen", "green", "lightblue", "blue", "purple", "pink", "brown". + * @param visible - should favorite item be visible after creation. + */ + fun addFavorite(lat: Double, lon: Double, name: String, description: String, + category: String, color: String, visible: Boolean): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val favorite = AFavorite(lat, lon, name, description, category, color, visible) + return mIOsmAndAidlInterface!!.addFavorite(AddFavoriteParams(favorite)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Update favorite at given location with given params. + * + * @param latPrev - latitude (current favorite). + * @param lonPrev - longitude (current favorite). + * @param namePrev - name of favorite item (current favorite). + * @param categoryPrev - category of favorite item (current favorite). + * @param latNew - latitude (new favorite). + * @param lonNew - longitude (new favorite). + * @param nameNew - name of favorite item (new favorite). + * @param descriptionNew - description of favorite item (new favorite). + * @param categoryNew - category of favorite item (new favorite). Use only to create a new category, + * not to update an existing one. If you want to update an existing category, + * use the [.updateFavoriteGroup] method. + * @param colorNew - color of new category. Can be one of: "red", "orange", "yellow", + * "lightgreen", "green", "lightblue", "blue", "purple", "pink", "brown". + * @param visibleNew - should new category be visible after creation. + */ + fun updateFavorite(latPrev: Double, lonPrev: Double, namePrev: String, categoryPrev: String, + latNew: Double, lonNew: Double, nameNew: String, descriptionNew: String, + categoryNew: String, colorNew: String, visibleNew: Boolean): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val favoritePrev = AFavorite(latPrev, lonPrev, namePrev, "", categoryPrev, "", false) + val favoriteNew = AFavorite(latNew, lonNew, nameNew, descriptionNew, categoryNew, colorNew, visibleNew) + return mIOsmAndAidlInterface!!.updateFavorite(UpdateFavoriteParams(favoritePrev, favoriteNew)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Remove favorite at given location with given params. + * + * @param lat - latitude. + * @param lon - longitude. + * @param name - name of favorite item. + * @param category - category of favorite item. + */ + fun removeFavorite(lat: Double, lon: Double, name: String, category: String): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val favorite = AFavorite(lat, lon, name, "", category, "", false) + return mIOsmAndAidlInterface!!.removeFavorite(RemoveFavoriteParams(favorite)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Add map marker at given location. + * + * @param lat - latitude. + * @param lon - longitude. + * @param name - name. + */ + fun addMapMarker(lat: Double, lon: Double, name: String): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val marker = AMapMarker(ALatLon(lat, lon), name) + return mIOsmAndAidlInterface!!.addMapMarker(AddMapMarkerParams(marker)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Update map marker at given location with name. + * + * @param latPrev - latitude (current marker). + * @param lonPrev - longitude (current marker). + * @param namePrev - name (current marker). + * @param latNew - latitude (new marker). + * @param lonNew - longitude (new marker). + * @param nameNew - name (new marker). + */ + fun updateMapMarker(latPrev: Double, lonPrev: Double, namePrev: String, + latNew: Double, lonNew: Double, nameNew: String): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val markerPrev = AMapMarker(ALatLon(latPrev, lonPrev), namePrev) + val markerNew = AMapMarker(ALatLon(latNew, lonNew), nameNew) + return mIOsmAndAidlInterface!!.updateMapMarker(UpdateMapMarkerParams(markerPrev, markerNew)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Remove map marker at given location with name. + * + * @param lat - latitude. + * @param lon - longitude. + * @param name - name. + */ + fun removeMapMarker(lat: Double, lon: Double, name: String): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val marker = AMapMarker(ALatLon(lat, lon), name) + return mIOsmAndAidlInterface!!.removeMapMarker(RemoveMapMarkerParams(marker)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Add map widget to the right side of the main screen. + * Note: any specified icon should exist in OsmAnd app resources. + * + * @param id - widget id. + * @param menuIconName - icon name (configure map menu). + * @param menuTitle - widget name (configure map menu). + * @param lightIconName - icon name for the light theme (widget). + * @param darkIconName - icon name for the dark theme (widget). + * @param text - main widget text. + * @param description - sub text, like "km/h". + * @param order - order position in the widgets list. + * @param intentOnClick - onClick intent. Called after click on widget as startActivity(Intent intent). + */ + fun addMapWidget(id: String, menuIconName: String, menuTitle: String, + lightIconName: String, darkIconName: String, text: String, description: String, + order: Int, intentOnClick: Intent): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val widget = AMapWidget(id, menuIconName, menuTitle, lightIconName, + darkIconName, text, description, order, intentOnClick) + return mIOsmAndAidlInterface!!.addMapWidget(AddMapWidgetParams(widget)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Update map widget. + * Note: any specified icon should exist in OsmAnd app resources. + * + * @param id - widget id. + * @param menuIconName - icon name (configure map menu). + * @param menuTitle - widget name (configure map menu). + * @param lightIconName - icon name for the light theme (widget). + * @param darkIconName - icon name for the dark theme (widget). + * @param text - main widget text. + * @param description - sub text, like "km/h". + * @param order - order position in the widgets list. + * @param intentOnClick - onClick intent. Called after click on widget as startActivity(Intent intent). + */ + fun updateMapWidget(id: String, menuIconName: String, menuTitle: String, + lightIconName: String, darkIconName: String, text: String, description: String, + order: Int, intentOnClick: Intent): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val widget = AMapWidget(id, menuIconName, menuTitle, lightIconName, + darkIconName, text, description, order, intentOnClick) + return mIOsmAndAidlInterface!!.updateMapWidget(UpdateMapWidgetParams(widget)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Remove map widget. + * + * @param id - widget id. + */ + fun removeMapWidget(id: String): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.removeMapWidget(RemoveMapWidgetParams(id)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Add user layer on the map. + * + * @param id - layer id. + * @param name - layer name. + * @param zOrder - z-order position of layer. Default value is 5.5f + * @param points - initial list of points. Nullable. + */ + fun addMapLayer(id: String, name: String, zOrder: Float, points: List): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val layer = AMapLayer(id, name, zOrder, points) + return mIOsmAndAidlInterface!!.addMapLayer(AddMapLayerParams(layer)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Update user layer. + * + * @param id - layer id. + * @param name - layer name. + * @param zOrder - z-order position of layer. Default value is 5.5f + * @param points - list of points. Nullable. + */ + fun updateMapLayer(id: String, name: String, zOrder: Float, points: List): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val layer = AMapLayer(id, name, zOrder, points) + return mIOsmAndAidlInterface!!.updateMapLayer(UpdateMapLayerParams(layer)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Remove user layer. + * + * @param id - layer id. + */ + fun removeMapLayer(id: String): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.removeMapLayer(RemoveMapLayerParams(id)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Add point to user layer. + * + * @param layerId - layer id. Note: layer should be added first. + * @param pointId - point id. + * @param shortName - short name (single char). Displayed on the map. + * @param fullName - full name. Displayed in the context menu on first row. + * @param typeName - type name. Displayed in context menu on second row. + * @param color - color of circle's background. + * @param location - location of the point. + * @param details - list of details. Displayed under context menu. + */ + fun addMapPoint(layerId: String, pointId: String, shortName: String, fullName: String, + typeName: String, color: Int, location: ALatLon, details: List): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val point = AMapPoint(pointId, shortName, fullName, typeName, color, location, details) + return mIOsmAndAidlInterface!!.addMapPoint(AddMapPointParams(layerId, point)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Update point. + * + * @param layerId - layer id. + * @param pointId - point id. + * @param shortName - short name (single char). Displayed on the map. + * @param fullName - full name. Displayed in the context menu on first row. + * @param typeName - type name. Displayed in context menu on second row. + * @param color - color of circle's background. + * @param location - location of the point. + * @param details - list of details. Displayed under context menu. + */ + fun updateMapPoint(layerId: String, pointId: String, shortName: String, fullName: String, + typeName: String, color: Int, location: ALatLon, details: List): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + val point = AMapPoint(pointId, shortName, fullName, typeName, color, location, details) + return mIOsmAndAidlInterface!!.updateMapPoint(UpdateMapPointParams(layerId, point)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Remove point. + * + * @param layerId - layer id. + * @param pointId - point id. + */ + fun removeMapPoint(layerId: String, pointId: String): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.removeMapPoint(RemoveMapPointParams(layerId, pointId)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Import GPX file to OsmAnd. + * OsmAnd must have rights to access location. Not recommended. + * + * @param file - File which represents GPX track. + * @param fileName - Destination file name. May contain dirs. + * @param color - color of gpx. Can be one of: "red", "orange", "lightblue", "blue", "purple", + * "translucent_red", "translucent_orange", "translucent_lightblue", + * "translucent_blue", "translucent_purple" + * @param show - show track on the map after import + */ + fun importGpxFromFile(file: File, fileName: String, color: String, show: Boolean): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.importGpx(ImportGpxParams(file, fileName, color, show)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Import GPX file to OsmAnd. + * + * @param gpxUri - URI created by FileProvider. + * @param fileName - Destination file name. May contain dirs. + * @param color - color of gpx. Can be one of: "", "red", "orange", "lightblue", "blue", "purple", + * "translucent_red", "translucent_orange", "translucent_lightblue", + * "translucent_blue", "translucent_purple" + * @param show - show track on the map after import + */ + fun importGpxFromUri(gpxUri: Uri, fileName: String, color: String, show: Boolean): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + app.grantUriPermission(OSMAND_PACKAGE_NAME, gpxUri, Intent.FLAG_GRANT_READ_URI_PERMISSION) + return mIOsmAndAidlInterface!!.importGpx(ImportGpxParams(gpxUri, fileName, color, show)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + fun navigateGpxFromUri(gpxUri: Uri, force: Boolean): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + app.grantUriPermission(OSMAND_PACKAGE_NAME, gpxUri, Intent.FLAG_GRANT_READ_URI_PERMISSION) + return mIOsmAndAidlInterface!!.navigateGpx(NavigateGpxParams(gpxUri, force)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Import GPX file to OsmAnd. + * + * @param data - Raw contents of GPX file. Sent as intent's extra string parameter. + * @param fileName - Destination file name. May contain dirs. + * @param color - color of gpx. Can be one of: "red", "orange", "lightblue", "blue", "purple", + * "translucent_red", "translucent_orange", "translucent_lightblue", + * "translucent_blue", "translucent_purple" + * @param show - show track on the map after import + */ + fun importGpxFromData(data: String, fileName: String, color: String, show: Boolean): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.importGpx(ImportGpxParams(data, fileName, color, show)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + fun navigateGpxFromData(data: String, force: Boolean): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.navigateGpx(NavigateGpxParams(data, force)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Show GPX file on map. + * + * @param fileName - file name to show. Must be imported first. + */ + fun showGpx(fileName: String): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.showGpx(ShowGpxParams(fileName)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Hide GPX file. + * + * @param fileName - file name to hide. + */ + fun hideGpx(fileName: String): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.hideGpx(HideGpxParams(fileName)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Remove GPX file. + * + * @param fileName - file name to remove; + */ + fun removeGpx(fileName: String): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.removeGpx(RemoveGpxParams(fileName)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + /** + * Get list of active GPX files. + * + * @param latitude - latitude of new map center. + * @param longitude - longitude of new map center. + * @param zoom - map zoom level. Set 0 to keep zoom unchanged. + * @param animated - set true to animate changes. + */ + fun setMapLocation(latitude: Double, longitude: Double, zoom: Int, animated: Boolean): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.setMapLocation( + SetMapLocationParams(latitude, longitude, zoom, animated)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + fun startGpxRecording(params: StartGpxRecordingParams): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.startGpxRecording(params) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + fun stopGpxRecording(params: StopGpxRecordingParams): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.stopGpxRecording(params) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + fun takePhotoNote(lat: Double, lon: Double): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.takePhotoNote(TakePhotoNoteParams(lat, lon)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + fun startVideoRecording(lat: Double, lon: Double): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.startVideoRecording(StartVideoRecordingParams(lat, lon)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + fun startAudioRecording(lat: Double, lon: Double): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.startAudioRecording(StartAudioRecordingParams(lat, lon)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + fun stopRecording(): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.stopRecording(StopRecordingParams()) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } + + fun navigate(startName: String, startLat: Double, startLon: Double, destName: String, destLat: Double, destLon: Double, profile: String, force: Boolean): Boolean { + if (mIOsmAndAidlInterface != null) { + try { + return mIOsmAndAidlInterface!!.navigate(NavigateParams(startName, startLat, startLon, destName, destLat, destLon, profile, force)) + } catch (e: RemoteException) { + e.printStackTrace() + } + + } + return false + } +} diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/helpers/ShareLocationHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShareLocationHelper.kt similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/helpers/ShareLocationHelper.kt rename to OsmAnd-telegram/src/net/osmand/telegram/helpers/ShareLocationHelper.kt diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/helpers/TelegramHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/helpers/TelegramHelper.kt rename to OsmAnd-telegram/src/net/osmand/telegram/helpers/TelegramHelper.kt diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/notifications/NotificationDismissReceiver.kt b/OsmAnd-telegram/src/net/osmand/telegram/notifications/NotificationDismissReceiver.kt similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/notifications/NotificationDismissReceiver.kt rename to OsmAnd-telegram/src/net/osmand/telegram/notifications/NotificationDismissReceiver.kt diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/notifications/NotificationHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/notifications/NotificationHelper.kt similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/notifications/NotificationHelper.kt rename to OsmAnd-telegram/src/net/osmand/telegram/notifications/NotificationHelper.kt diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/notifications/ShareLocationNotification.kt b/OsmAnd-telegram/src/net/osmand/telegram/notifications/ShareLocationNotification.kt similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/notifications/ShareLocationNotification.kt rename to OsmAnd-telegram/src/net/osmand/telegram/notifications/ShareLocationNotification.kt diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/notifications/TelegramNotification.kt b/OsmAnd-telegram/src/net/osmand/telegram/notifications/TelegramNotification.kt similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/notifications/TelegramNotification.kt rename to OsmAnd-telegram/src/net/osmand/telegram/notifications/TelegramNotification.kt diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/utils/AndroidUtils.kt b/OsmAnd-telegram/src/net/osmand/telegram/utils/AndroidUtils.kt similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/utils/AndroidUtils.kt rename to OsmAnd-telegram/src/net/osmand/telegram/utils/AndroidUtils.kt diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/utils/CancellableAsyncTask.kt b/OsmAnd-telegram/src/net/osmand/telegram/utils/CancellableAsyncTask.kt similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/utils/CancellableAsyncTask.kt rename to OsmAnd-telegram/src/net/osmand/telegram/utils/CancellableAsyncTask.kt diff --git a/OsmAnd-telegram/src/main/java/net/osmand/telegram/utils/OsmandFormatter.java b/OsmAnd-telegram/src/net/osmand/telegram/utils/OsmandFormatter.java similarity index 100% rename from OsmAnd-telegram/src/main/java/net/osmand/telegram/utils/OsmandFormatter.java rename to OsmAnd-telegram/src/net/osmand/telegram/utils/OsmandFormatter.java diff --git a/OsmAnd-telegram/src/test/java/net/osmand/telegramtest/ExampleUnitTest.kt b/OsmAnd-telegram/src/test/java/net/osmand/telegramtest/ExampleUnitTest.kt deleted file mode 100644 index 56a994f902..0000000000 --- a/OsmAnd-telegram/src/test/java/net/osmand/telegramtest/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package net.osmand.telegram - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index 4d07852ba7..43c0151e5a 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -878,18 +878,18 @@ У напрамку компаса У напрамку руху Не варочаць (поўнач заўсёды ўверсе) - Абраць раўнаваньне мапы на экране. + Абраць раўнаваньне мапы. Арыентацыя мапы Падрабязнасьці маршруту - Выбраныя паспяхова імпартаваны - GPX файл з улюбёнымі ня знойдзены ў {0} - Улюбёныя пасьпяхова захаваны ў {0} + Улюблёныя імпартаваныя + GPX-файл з улюбёнымі ня знойдзены ў {0} + Улюбёныя захаваныя ў {0} Няма любімых месцаў для захоўваньня - Памылка пры загрузцы GPX + Не атрымалася загрузіць GPX Даслаць справаздачу Не атрымалася знайсці спампованых мап на картцы памяці. - Увядзіце запыт для пошуку POI + Надрукуйце для пошуку POI Усе Дзякуй Яндэксу за дарожную інфармацыю. @@ -903,7 +903,7 @@ Пошук POI Выкарыстоўвайце трэкбол для перамяшчэння мапы. Выкарыстоўвайце трэкбол - Задаць максімальны час чакання для кожнага фонавага вызначэння становішча. + Задае максімальна дазволены час чакання для кожнага фонавага вызначэння становішча. Максімальны час чаканьня вызначэньня каардынат Дзе я? @@ -914,9 +914,9 @@ хв. Абярыце інтэрвал абуджэння для фонавага рэжыму. Інтэрвал абуджэньня GPS - Абярыце крыніцу каардынат для выкарыстання фонавым сэрвісам. + Абяраць крыніцу месцазнаходжання для выкарыстання фонавым сэрвісам. Крыніца каардынат - Запускае OsmAnd ў фонавым рэжыме для адсочвання становішча пры выключаным экране. + Адсочвае ваша становішча пры адключаным экране. Запусьціць OsmAnd у фоне Фонаваму сэрвісу неабходная інфармацыя пра месцазнаходжаньне. Схаваць фільтр @@ -930,7 +930,8 @@ Непадтрымліваемая версія галасавых дадзеных Абраныя галасавыя дадзеныя пашкоджаны Абраныя галасавыя дадзеныя не даступныя - SD-карта не даступная.\nВы не зможаце бачыць мапу або штосьці знайсці. + Картка памяці не даступная. +\nВы не зможаце бачыць мапу або штосьці знайсці. Картка памяці толькі для чытання. \nЗараз можна ўбачыць толькі загружаную мапу, а не загружаць новуя вобласці. Файл распакоўваецца… @@ -944,7 +945,7 @@ Рухайцеся Далей Сьцягнуць рэгіёны - Пошук сігналу… + Чаканне сігналу… Шукаць побач з цяперашнім цэнтрам мапы Шукаць паблізу Па змаўчаньні @@ -952,7 +953,7 @@ Гарызантальная Арыентацыя экрану Вертыкальная, гарызантальная, ці як прылада. - Фармат гадзін працы не падтрымліваецца для рэдагаваньня + Фармат гадзін працы не можа быць зменены Дадаць новае правіла Маршруты Прыпынак @@ -969,13 +970,13 @@ Паказаць прыпынкі грамадзкага транспарту на мапе. Паказваць прыпынкі транспарту Навігацыйнае дастасаваньне OsmAnd - Дадзеныя POI былі пасьпяхова абноўленыя ({0} аб\'ектаў загружана) - Памылка падчас абнаўленьня лякальнага сьпісу POI - Памылка пры загрузцы дадзеных з сервера + Дадзеныя POI былі абноўленыя ({0} аб\'ектаў загружана) + Не атрымалася абнавіць лакальны POI-спіс + Не атрымалася загрузіць даных з сервера Для гэтай мясцовасьці адсутнічаюць лякальныя дадзеныя пра POI - Абнаўленьне POI не даступна для малых узроўняў маштабаваньня + Павелічэнне маштабу дазваляе вам абнавіць POI Абнавіць POI - Абнавіць лякальныя дадзеныя праз Інтэрнэт? + Абнавіць лякальныя даныя з Інтэрнэту? Горад: {0} Вуліца: {0}, {1} Скрыжаваньне: {0} х {1} праз {2} @@ -991,18 +992,18 @@ Пазасеціўны пошук Сеціўны пошук Максімальнае павелічэньне онлайн мапаў - Выберыце максімальны ўзровень павелічэння для сцягвання фрагментаў мапы з Інтэрнэту. + Не праглядаць онлайн фрагменты мапы для узроўняў маштабавання за межамі гэтага. Агульная адлегласьць %1$s, час у дарозе %2$d г. %3$d хв. Абраць сеціўны ці пазасеціўны сэрвіс навігацыі. Сэрвіс навігацыі - Каталёг на SD-карце недаступны для захоўваньня! + Каталог на карце памяці недаступны для захоўваньня! Сьцягнуць {0} - {1} ? - Лакальная мапа для {0} ужо існуе ({1}). Хочаце яе абнавіць ({2})? + Лакальная мапа для {0} ужо існуе ({1}). Абнавіць ({2})? Адрас Сьцягваецца сьпіс даступных рэгіёнаў… - Сьпіс даступных рэгіёнаў ня быў зладаваны з osmand.net. + Не ўдалося атрымаць спіс рэгіёнаў з https://osmand.net. Улюбёны пункт быў зьменены Няма ўпадабаных месцаў @@ -1027,17 +1028,17 @@ POI Не атрымалася захаваць GPX-файл - Памылка разьліку маршруту - Памылка падчас разьліку маршруту - Памылка: Разлічаны маршрут пусты + Не ўдалося разлічыць маршрут + Не ўдалося разлічыць маршрут + Разлічаны маршрут пусты Новы шлях разьлічаны, адлегласьць Вы прыбылі ў пункт прызначэньня - Каардынаты несапраўдныя! + Несапраўдныя каардынаты Вярнуцца да мапы OsmAnd Дадзеныя загружаюцца… Чытаньне лякальных зьвестак… Папярэдні старт OsmAnd скончыўся аварыйна. Хроніка запісаная ў файл {0}. Калі ласка, паведаміце пра праблему й прычапіце файл хронікі. - Захаваньне GPX-сьлядоў на SD… + Захаванне GPX-файла… Скончана @@ -1064,8 +1065,8 @@ Выбар паміж мясцовымі і ангельскімі назвамі. - Ангельскія назвы на мапе - Налады дастасаваньня + Выкарыстоўваць ангельскія назвы + Налады дастасавання Пошук адраса Абраць будынак Абраць вуліцу @@ -1083,8 +1084,8 @@ Паказаць ваша становішча - Паказаць GPS каардынаты на мапе - Выкарыстоўваць Інтэрнэт, каб сьцягваць фрагмэнты мапы, што адсутнічаюць + Паказаць GPS-каардынаты на мапе + Сцягнуць адсутныя фрагменты мапы Навігацыйнае дастасаваньне @@ -1098,9 +1099,9 @@ Выбраць рэгіён са сьпісу Абраць скрыжаваньне Бліжэйшыя паслугі - Аўтамабіль - Ровар - Пешаход + Ваджэнне + Язда на ровары + Хада У цэнтры Зьнізу Увядзіце шырату й даўгату ў абраным фармаце (D - градусы, M - хвіліны, S - сэкунды) @@ -1124,11 +1125,11 @@ Стварыць POI Калі ласка, увядзіце імя ўлюбёнага Улюбёнае - Улюбёнае месца \'\'{0}\'\' было дададзенае. + Улюбёная кропка «{0}» дададзеная. Рэдагаваньне ўлюбёнага Выдаліць улюбёнае Выдаліць улюбёную кропку \'%s\' з закладак? - Улюбёны пункт {0} быў пасьпяхова выдалены з закладак. + Улюбёная кропка {0} выдаленая. @@ -1153,9 +1154,9 @@ POI выдаленая дадаць зьмяніць - Дзеяньне {0} пасьпяхова завершана. - Нечаканая памылка пры выкананьні дзеяньня {0}. - Адбылася памылка ўводу/вываду пры выкананьні дзеяньня {0}. + Дзеянне {0} завершанае. + Не ўдалося выканаць дзеянне {0}. + Адбылася памылка ўводу/вываду падчас выкананні дзеяння {0}. Адбылася памылка пры чытаньні інфармацыі пра POI Гадзіны працы Каментар @@ -1169,7 +1170,7 @@ Фільтр {0} быў выдалены Фільтр {0} быў створаны - E-mail + e-mail Тып факусоўкі камеры Выберыце тып фокусу ўбудаванай камеры. Аўтафокус @@ -1666,7 +1667,7 @@ Правіць групу - Неабходна падключэньне да Інтэрнэту, каб усталяваць гэты модуль. + Вам неабходна падлучэнне да Інтэрнэту, каб усталяваць гэты дадатак. Атрымаць Лыжныя мапы Марскія мапы @@ -1932,11 +1933,11 @@ Аўтаматычныя абнаўленні Не ўдалося адаслаць Выдаліць зьмены - {0}/{1} пасьпяхова адасланыя + Адасланыя {0}/{1} Паўтарыць спробу Памылка: {0} Няма даступных абнаўленьняў - Нас вельмі цікавіць ваша меркаваньне і нам важна пачуць вас. + Нас цікавіць ваша меркаваньне і ваш водгук важны для нас. Тлусты абрыс Небяспека OsmAnd @@ -1969,8 +1970,8 @@ Працоўныя дні Нядаўнія месцы Улюбёныя -Пасьпяхова захаваны ў: %1$s -Паказаць GPX +Цяпер захаваны а %1$s +Паказаць GPX-даныя POI будуць выдаленыя, як толькі вы загрузіце вашы зьмены Паказваць пры запуску Колькасьць радкоў @@ -2007,12 +2008,12 @@ Сьцягваецца - %1$d файл Паказваць банер бясплатнай версіі нават у платнай версіі. Паказваць банэр бясплатнай вэрсіі - НАБЫЦЬ + Набыць Пазьней Паўнавартасная вэрсія Зацяненьне рэльефу адключана - Калі ласка, актывуйце модуль SRTM - Калі ласка, актывуйце модуль Марскія навігацыйныя знакі + Калі ласка, актывуйце дадатак «Контурныя лініі» + Калі ласка, актывуйце дадатак «Прагляд марской мапы» Рэгіёны Рэгіянальныя мапы @@ -2022,12 +2023,12 @@ Назва катэгорыі Дадаць новую катэгорыю Калі ласка, выкарыстоўваеце назву катэгорыі, якая яшчэ не існуе. - Вы ўпэўненыя, што хочаце сьцягнуць мапу аўтадарог, нават калі ў вас ёсць поўная мапа? + Мапа аўтадарог не патрэбная, бо вы маеце стандартную (поўную) мапу? Сцягнуць усё роўна? %1$.1f з %2$.1f Мб %.1f Мб Абнавіць усе (%1$s МБ) Выкарыстана бясплатных загрузак - Паказвае колькі бясплатных загрузак вы скарысталі. + Паказвае колькі бясплатных загрузак засталося. Адаслаць Выберыце, дзе вы хочаце захоўваць мапы і іншыя файлы са зьвесткамі. Падзяліцца месцазнаходжаньнем @@ -2050,7 +2051,7 @@ Модулі Часта задаваныя пытаньні Вэрсіі - Напішыце нам + Кантакты Легенда мапы Абнавіць Базавая мапа сьвету (якая пакрывае ўвесь сьвет пры малым маштабе) адсутнічае або састарэла. Калі ласка, загрузіце яе каб мець агляд усяго сьвету. @@ -2061,7 +2062,7 @@ Дапамажыце палепшыць OsmAnd Першы запуск Як загрузіць мапы, усталяваць асноўныя налады. - Налада навігацыі. + Налады навігацыі. Планаваньне паездкі Часта задаваныя пытаньні Агляд мапы @@ -2075,7 +2076,7 @@ Ніжненямецкая Заходнефрыская Альбанская (Тоская) - Вы сапраўды хочаце захаваць POI бяз тыпу? + Вы сапраўды хочаце захаваць POI без тыпу? Рэдагаваньні OSM апублікаваныя праз OsmAnd Месцазнаходжаньне Скапіявана ў буфер абмену @@ -2114,7 +2115,7 @@ Выкарыстоўваць панэль кіраваньня Панэль кіраваньня ці мэню Калі ласка, увядзіце правільны тып POI або прапусьціце яго. - Дадаўся выбар асноўнага элемэнту кіраваньня праграмаю праз панэль кіраваньня або статычнае мэню. Ваш выбар можа быць зьменены ў наладах галоўнага экрана. + Прапануецца выбар асноўнага элементу кіравання праграмаю праз панэль кіравання або статычнае меню. Ваш выбар можа быць зменены ў наладах галоўнага экрана. \\u2022 Новы кантэкстна-залежны інтэрфейс для выбару пазіцыі на мапе і на іншых экранах \n \n • Экран мапы цяпер запускаецца непасрэдна, калі вы не выбралі \"Паказваць панэль кіраваньня пры запуску\" @@ -2148,10 +2149,10 @@ Час: Конныя маршруты Абнавіць кожны - Сьцягваць толькі праз WiFi + Сьцягваць толькі праз Wi-Fi Аўтаабнаўленьне Абнавіць зараз -Праграма не мае дазволу на выкарыстаньне SD карткі +OsmAnd не мае дазволу на выкарыстанне карткі памяці Праграма не мае дазволу на выкарыстаньне GPS. Праграма не мае дазволу на выкарыстаньне камэры. Праграма не мае дазволу на выкарыстаньне мікрафону. @@ -2503,8 +2504,8 @@ Вы ўпэўненыя, што хочаце выдаліць дзеяньне \"%s\"? Месца Паказаць/схаваць улюбёныя - Паказаць Улюбёныя - Схаваць Улюбёныя + Паказаць улюбёныя + Схаваць улюбёныя Паказаць/схаваць POI Паказаць %1$s Схаваць %1$s @@ -2512,22 +2513,22 @@ Налада мапы Навігацыя Пакіньце пустым, каб прымяніць адрас або назву гораду. - Гэта паведамленьне будзе аўтаматычна запоўнена ў поле камэнтара. + Гэта паведамленьне уключанае ў поле камэнтара. Паведамленьне Выберыце катэгорыю, каб захаваць улюблёнае там. Пералік POI - Вы можаце дадаць адну або некалькі катэгорый POI для адлюстраваньня на мапе. + Дадаць адну або некалькі катэгорый POI для адлюстраваньня на мапе. Дадаць стыль мапы - Парамэтры не павінны быць пустымі + Запоўніце ўсе параметры Стылі мапы Крыніцы мапаў Дадаць крыніцу мапы Крыніца мапы была зьменена на \"%s\". Зьмяніць становішча кнопкі Назва дзеяньня -Стварыць гукавую нататку - Стварыць відэа-нататку - Стварыць фота-нататку +Новая гукавая нататка + Новая відэа-нататка + Новая фота-нататка Голас прыглушаны Голас актыўны Паказваць контуры і пункты глыбіні. @@ -2594,23 +2595,23 @@ Паказаць дыялёг улюбёных Назва перадусталёўкі Пры націсканні на кнопку дадасць маркер на мапу ў цэнтры экрана. - Пры націску на кнопку дзеяньня дадасьць GPX-кропку на мапу ў цэнтры экрана. - Пры націсканні на кнопку дадасць аўдыянататку на мапу ў цэнтры экрана. - Пры націсканні на кнопку дадасць відэанататку на мапу ў цэнтры экрана. - Пры націсканні на кнопку дадасць фотанататку на мапу ў цэнтры экрана. - Пры націсканні на кнопку дадасць OSM-нататку на мапу ў цэнтры экрана. - Пры націсканні на кнопку дадасць POI на мапу ў цэнтры экрана. - Пры націсканьні на кнопку адключыць ці ўключыць галасавыя падказкі пад час навігацыі. - Націск на кнопку дзеяньня дадасьць месца паркоўкі ў цэнтры экрана. + Пры націску на кнопку дадасьць GPX-кропку ў сярэдзіне экрана. + Пры націсканні на кнопку дадасць аўдыянататку на мапу ў сярэдзіне экрана. + Пры націсканні на кнопку дадасць відэанататку на мапу ў сярэдзіне экрана. + Пры націсканні на кнопку дадасць фотанататку на мапу ў сярэдзіне экрана. + Пры націсканні на кнопку дадасць OSM-нататку на мапу ў сярэдзіне экрана. + Пры націсканні на кнопку дадасць POI ў сярэдзіне экрана. + Пры націсканьні на кнопку адключыць ці ўключыць галасавыя падказкі падчас навігацыі. + Націск на кнопку дадасьць месца паркоўкі ў сярэдзіне экрана. Паказаць прамежкавы дыялёг " было захавана ў " - Назва для хуткага дзеяньня ўжо існуе. Дзеяньне будзе захована як %1$s каб пазбавіцца дубляваньня. + Назва для хуткага дзеяньня ўжо існуе. Назва будзе змененая на %1$s, каб пазбавіцца дубляваньня. Знойдзены дублікат назвы - Пры націсканьні на кнопку дзеяньня будуць паказаны ці схаваны ўлюбёныя кропкі на мапе. - Пры націсканні на кнопку пакажа ці схавае POI на мапе. + Націсканне на кнопку пакажа ці схавае ўлюбёныя кропкі на мапе. + Націсканне на кнопку пакажа ці схавае POI на мапе. Стварэнне элементаў Абярыце катэгорыю (апцыянальна). - Пры націсканні на кнопку будзе гартаць старонкі данага спісу. + Націсканне на кнопку гартае старонкі данага спісу. Змяніць мапу пакрыцця Мапа пакрыцця Дадаць мапу пакрыцця @@ -2720,7 +2721,7 @@ Калі ласка, дадайце прамежкавыя пункты, калі разлік не завяршыўся цягам 10 хвілін. Лыжня \nOsmAnd-дадатак лыжных мап дазваляе бачыць лыжныя трасы з узроўнем складанасці і некаторай дадатковай інфармацыяй, як размяшчэнне пад\'ёмнікаў і іншых аб\'ектаў. - Назва змяшчае занадта шмат вялікіх літар. Вы хочаце прадоўжыць? + Назва змяшчае занадта шмат вялікіх літар. Прадоўжыць? Мапа \n• Адлюстроўвае POI (пункт інтарэсаў) каля вас \n• Адаптуе мапу ў напрамку вашага руху (ці компаса) @@ -2878,7 +2879,7 @@ Націсніце гэтую кнопку, каб пачаць або скончыць навігацыю. Час буферызацыі для анлайн сачэньня Задае час буферызацыі для зьберажэньня месцаў для адпраўкі без злучэньня - Вам патрэбен Інтэрнэт для прагляду фатаграфій з Mapillary. + Вам патрэбна падлучэнне да Інтэрнэту для прагляду фатаграфій з Mapillary. Паўтарыць @@ -2906,14 +2907,14 @@ Абраць профіль навігацыі Дадаць кропкі маршруту Дадаць лінію - Дадаць і запісаць сляды - Запісаць ці імпартаваць сляды для прагляду. + Дадаць GPX-файлы + Запісаць GPX-файлы ці запісаныя сляды. Дадаць ва Ўлюбёныя Імпартаваць улюбёныя ці дадаць з дапамогай маркіроўкі пунктаў на мапе. - Імпартаваць сьлед + Імпартаваць GPX-файл Файл %1$s не зьмяшчае кропкі шляху, імпартаваць як сьлед? Перамясціць кропку - Дадаць у GPX-сьлед + Дадаць у GPX-файл Працягваць паказваць на мапе Выйсьці без захаваньня? Без анімацыі @@ -3089,11 +3090,11 @@ \n вых. Зімовы/лыжны - Турыстычны (кантраст і дэталі) + Турыстычны выгляд Марскі Адчыніцца заўтра а Капіяваць назву кропкі/POI - Месца не мае назвы + Месца без назвы Цяперашні Дадае прамежкавы прыпынак Дадае першы прыпынак @@ -3202,7 +3203,7 @@ Адкрыць артыкул анлайн Паглядзець артыкул у браўзеры. гэты рэгіён - Пошук неабходнага вікі-артыкула + Пошук адпаведнага вікі-артыкула Артыкул не знойдзены Як адкрыць артыкулы Вікіпэдыі? Перазапуск праграмы