diff --git a/android/app/src/main/cpp/CMakeLists.txt b/android/app/src/main/cpp/CMakeLists.txt index 4b3b06fa0c..03b63de4e6 100644 --- a/android/app/src/main/cpp/CMakeLists.txt +++ b/android/app/src/main/cpp/CMakeLists.txt @@ -26,6 +26,7 @@ set(SRC app/organicmaps/sdk/search/SearchEngine.cpp app/organicmaps/sdk/search/SearchRecents.cpp app/organicmaps/sdk/routing/RouteRecommendationType.hpp + app/organicmaps/sdk/routing/RoutingOptions.cpp app/organicmaps/sdk/ChoosePositionMode.cpp app/organicmaps/sdk/MapStyle.cpp app/organicmaps/sdk/OrganicMaps.cpp @@ -43,7 +44,6 @@ set(SRC app/organicmaps/LocationState.cpp app/organicmaps/Map.cpp app/organicmaps/MapManager.cpp - app/organicmaps/routing/RoutingOptions.cpp app/organicmaps/settings/UnitLocale.cpp app/organicmaps/settings/MapLanguageCode.cpp app/organicmaps/sound/tts.cpp diff --git a/android/app/src/main/cpp/app/organicmaps/Framework.cpp b/android/app/src/main/cpp/app/organicmaps/Framework.cpp index 23a50a98be..c4d32bd261 100644 --- a/android/app/src/main/cpp/app/organicmaps/Framework.cpp +++ b/android/app/src/main/cpp/app/organicmaps/Framework.cpp @@ -1281,7 +1281,7 @@ Java_app_organicmaps_Framework_nativeGetRouteFollowingInfo(JNIEnv * env, jclass) if (!info.IsValid()) return nullptr; - static jclass const klass = jni::GetGlobalClassRef(env, "app/organicmaps/routing/RoutingInfo"); + static jclass const klass = jni::GetGlobalClassRef(env, "app/organicmaps/sdk/routing/RoutingInfo"); // Java signature : RoutingInfo(Distance distToTarget, Distance distToTurn, // String currentStreet, String nextStreet, String nextNextStreet, // double completionPercent, int vehicleTurnOrdinal, int @@ -1291,13 +1291,13 @@ Java_app_organicmaps_Framework_nativeGetRouteFollowingInfo(JNIEnv * env, jclass) jni::GetConstructorID(env, klass, "(Lapp/organicmaps/util/Distance;Lapp/organicmaps/util/Distance;" "Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;DIIIII" - "[Lapp/organicmaps/routing/SingleLaneInfo;DZZ)V"); + "[Lapp/organicmaps/sdk/routing/SingleLaneInfo;DZZ)V"); vector const & lanes = info.m_lanes; jobjectArray jLanes = nullptr; if (!lanes.empty()) { - static jclass const laneClass = jni::GetGlobalClassRef(env, "app/organicmaps/routing/SingleLaneInfo"); + static jclass const laneClass = jni::GetGlobalClassRef(env, "app/organicmaps/sdk/routing/SingleLaneInfo"); auto const lanesSize = static_cast(lanes.size()); jLanes = env->NewObjectArray(lanesSize, laneClass, nullptr); ASSERT(jLanes, (jni::DescribeException())); @@ -1342,7 +1342,7 @@ Java_app_organicmaps_Framework_nativeGetRouteJunctionPoints(JNIEnv * env, jclass return nullptr; } - static jclass const junctionClazz = jni::GetGlobalClassRef(env, "app/organicmaps/routing/JunctionInfo"); + static jclass const junctionClazz = jni::GetGlobalClassRef(env, "app/organicmaps/sdk/routing/JunctionInfo"); // Java signature : JunctionInfo(double lat, double lon) static jmethodID const junctionConstructor = jni::GetConstructorID(env, junctionClazz, "(DD)V"); @@ -1551,7 +1551,7 @@ Java_app_organicmaps_Framework_nativeGetRoutePoints(JNIEnv * env, jclass) auto const points = frm()->GetRoutingManager().GetRoutePoints(); static jclass const pointClazz = jni::GetGlobalClassRef(env, - "app/organicmaps/routing/RouteMarkData"); + "app/organicmaps/sdk/routing/RouteMarkData"); // Java signature : RouteMarkData(String title, String subtitle, // @RoutePointInfo.RouteMarkType int pointType, // int intermediateIndex, boolean isVisible, boolean isMyPosition, @@ -1587,7 +1587,7 @@ Java_app_organicmaps_Framework_nativeGetTransitRouteInfo(JNIEnv * env, jclass) auto const routeInfo = frm()->GetRoutingManager().GetTransitRouteInfo(); static jclass const transitStepClass = jni::GetGlobalClassRef(env, - "app/organicmaps/routing/TransitStepInfo"); + "app/organicmaps/sdk/routing/TransitStepInfo"); // Java signature : TransitStepInfo(@TransitType int type, @Nullable String distance, @Nullable String distanceUnits, // int timeInSec, @Nullable String number, int color, int intermediateIndex) static jmethodID const transitStepConstructor = jni::GetConstructorID(env, transitStepClass, @@ -1611,14 +1611,14 @@ Java_app_organicmaps_Framework_nativeGetTransitRouteInfo(JNIEnv * env, jclass) })); static jclass const transitRouteInfoClass = jni::GetGlobalClassRef(env, - "app/organicmaps/routing/TransitRouteInfo"); + "app/organicmaps/sdk/routing/TransitRouteInfo"); // Java signature : TransitRouteInfo(@NonNull String totalDistance, @NonNull String totalDistanceUnits, int totalTimeInSec, // @NonNull String totalPedestrianDistance, @NonNull String totalPedestrianDistanceUnits, // int totalPedestrianTimeInSec, @NonNull TransitStepInfo[] steps) static jmethodID const transitRouteInfoConstructor = jni::GetConstructorID(env, transitRouteInfoClass, "(Ljava/lang/String;Ljava/lang/String;I" "Ljava/lang/String;Ljava/lang/String;I" - "[Lapp/organicmaps/routing/TransitStepInfo;)V"); + "[Lapp/organicmaps/sdk/routing/TransitStepInfo;)V"); jni::TScopedLocalRef const distance(env, jni::ToJavaString(env, routeInfo.m_totalDistanceStr)); jni::TScopedLocalRef const distanceUnits(env, jni::ToJavaString(env, routeInfo.m_totalDistanceUnitsSuffix)); jni::TScopedLocalRef const distancePedestrian(env, jni::ToJavaString(env, routeInfo.m_totalPedestrianDistanceStr)); diff --git a/android/app/src/main/cpp/app/organicmaps/UserMarkHelper.cpp b/android/app/src/main/cpp/app/organicmaps/UserMarkHelper.cpp index 637352fd60..8438a8d44b 100644 --- a/android/app/src/main/cpp/app/organicmaps/UserMarkHelper.cpp +++ b/android/app/src/main/cpp/app/organicmaps/UserMarkHelper.cpp @@ -47,7 +47,7 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info, int mapObje static jmethodID const ctorId = jni::GetConstructorID( env, g_mapObjectClazz, "(" - "Lapp/organicmaps/bookmarks/data/FeatureId;" // featureId + "Lapp/organicmaps/bookmarks/data/FeatureId;" // featureId "I" // mapObjectType "Ljava/lang/String;" // title "Ljava/lang/String;" // secondaryTitle @@ -55,7 +55,7 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info, int mapObje "Ljava/lang/String;" // address "DD" // lat, lon "Ljava/lang/String;" // appId - "Lapp/organicmaps/routing/RoutePointInfo;" // routePointInfo + "Lapp/organicmaps/sdk/routing/RoutePointInfo;" // routePointInfo "I" // openingMode "Lapp/organicmaps/sdk/search/Popularity;" // popularity "Ljava/lang/String;" // description @@ -104,7 +104,7 @@ jobject CreateBookmark(JNIEnv *env, const place_page::Info &info, jni::GetConstructorID(env, g_bookmarkClazz, "(Lapp/organicmaps/bookmarks/data/FeatureId;JJLjava/lang/String;" "Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;" - "Lapp/organicmaps/routing/RoutePointInfo;" + "Lapp/organicmaps/sdk/routing/RoutePointInfo;" "ILapp/organicmaps/sdk/search/Popularity;Ljava/lang/String;" "[Ljava/lang/String;)V"); static jmethodID const featureCtorId = @@ -215,7 +215,7 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info) jobject CreateRoutePointInfo(JNIEnv * env, place_page::Info const & info) { - static jclass const clazz = jni::GetGlobalClassRef(env, "app/organicmaps/routing/RoutePointInfo"); + static jclass const clazz = jni::GetGlobalClassRef(env, "app/organicmaps/sdk/routing/RoutePointInfo"); static jmethodID const ctorId = jni::GetConstructorID(env, clazz, "(II)V"); int const markType = static_cast(info.GetRouteMarkType()); return env->NewObject(clazz, ctorId, markType, info.GetIntermediateIndex()); diff --git a/android/app/src/main/cpp/app/organicmaps/routing/RoutingOptions.cpp b/android/app/src/main/cpp/app/organicmaps/sdk/routing/RoutingOptions.cpp similarity index 71% rename from android/app/src/main/cpp/app/organicmaps/routing/RoutingOptions.cpp rename to android/app/src/main/cpp/app/organicmaps/sdk/routing/RoutingOptions.cpp index 5480edd46d..7befa3174e 100644 --- a/android/app/src/main/cpp/app/organicmaps/routing/RoutingOptions.cpp +++ b/android/app/src/main/cpp/app/organicmaps/sdk/routing/RoutingOptions.cpp @@ -5,16 +5,15 @@ routing::RoutingOptions::Road makeValue(jint option) { - uint8_t const road = static_cast(1u << static_cast(option)); + auto const road = static_cast(1u << static_cast(option)); CHECK_LESS(road, static_cast(routing::RoutingOptions::Road::Max), ()); return static_cast(road); } extern "C" { - -JNIEXPORT jboolean JNICALL -Java_app_organicmaps_routing_RoutingOptions_nativeHasOption(JNIEnv * env, jclass clazz, jint option) +JNIEXPORT jboolean JNICALL Java_app_organicmaps_sdk_routing_RoutingOptions_nativeHasOption(JNIEnv *, jclass, + jint option) { CHECK(g_framework, ("Framework isn't created yet!")); routing::RoutingOptions routingOptions = routing::RoutingOptions::LoadCarOptionsFromSettings(); @@ -22,8 +21,7 @@ Java_app_organicmaps_routing_RoutingOptions_nativeHasOption(JNIEnv * env, jclass return static_cast(routingOptions.Has(road)); } -JNIEXPORT void JNICALL -Java_app_organicmaps_routing_RoutingOptions_nativeAddOption(JNIEnv * env, jclass clazz, jint option) +JNIEXPORT void JNICALL Java_app_organicmaps_sdk_routing_RoutingOptions_nativeAddOption(JNIEnv *, jclass, jint option) { CHECK(g_framework, ("Framework isn't created yet!")); routing::RoutingOptions routingOptions = routing::RoutingOptions::LoadCarOptionsFromSettings(); @@ -32,9 +30,7 @@ Java_app_organicmaps_routing_RoutingOptions_nativeAddOption(JNIEnv * env, jclass routing::RoutingOptions::SaveCarOptionsToSettings(routingOptions); } - -JNIEXPORT void JNICALL -Java_app_organicmaps_routing_RoutingOptions_nativeRemoveOption(JNIEnv * env, jclass clazz, jint option) +JNIEXPORT void JNICALL Java_app_organicmaps_sdk_routing_RoutingOptions_nativeRemoveOption(JNIEnv *, jclass, jint option) { CHECK(g_framework, ("Framework isn't created yet!")); routing::RoutingOptions routingOptions = routing::RoutingOptions::LoadCarOptionsFromSettings(); diff --git a/android/app/src/main/java/app/organicmaps/Framework.java b/android/app/src/main/java/app/organicmaps/Framework.java index 9f843b5565..80c6b12da0 100644 --- a/android/app/src/main/java/app/organicmaps/Framework.java +++ b/android/app/src/main/java/app/organicmaps/Framework.java @@ -13,13 +13,12 @@ import app.organicmaps.api.RequestType; import app.organicmaps.bookmarks.data.DistanceAndAzimut; import app.organicmaps.bookmarks.data.FeatureId; import app.organicmaps.bookmarks.data.MapObject; -import app.organicmaps.products.Product; import app.organicmaps.products.ProductsConfig; -import app.organicmaps.routing.JunctionInfo; -import app.organicmaps.routing.RouteMarkData; -import app.organicmaps.routing.RoutePointInfo; -import app.organicmaps.routing.RoutingInfo; -import app.organicmaps.routing.TransitRouteInfo; +import app.organicmaps.sdk.routing.JunctionInfo; +import app.organicmaps.sdk.routing.RouteMarkData; +import app.organicmaps.sdk.routing.RoutePointInfo; +import app.organicmaps.sdk.routing.RoutingInfo; +import app.organicmaps.sdk.routing.TransitRouteInfo; import app.organicmaps.sdk.PlacePageActivationListener; import app.organicmaps.sdk.routing.RoutingListener; import app.organicmaps.sdk.routing.RoutingLoadPointsListener; diff --git a/android/app/src/main/java/app/organicmaps/MwmActivity.java b/android/app/src/main/java/app/organicmaps/MwmActivity.java index 9b45b45656..69fa0e26f8 100644 --- a/android/app/src/main/java/app/organicmaps/MwmActivity.java +++ b/android/app/src/main/java/app/organicmaps/MwmActivity.java @@ -79,11 +79,11 @@ import app.organicmaps.maplayer.isolines.IsolinesState; import app.organicmaps.routing.ManageRouteBottomSheet; import app.organicmaps.routing.NavigationController; import app.organicmaps.routing.NavigationService; -import app.organicmaps.routing.RoutePointInfo; +import app.organicmaps.sdk.routing.RoutePointInfo; import app.organicmaps.routing.RoutingBottomMenuListener; import app.organicmaps.routing.RoutingController; import app.organicmaps.routing.RoutingErrorDialogFragment; -import app.organicmaps.routing.RoutingOptions; +import app.organicmaps.sdk.routing.RoutingOptions; import app.organicmaps.routing.RoutingPlanFragment; import app.organicmaps.routing.RoutingPlanInplaceController; import app.organicmaps.sdk.ChoosePositionMode; diff --git a/android/app/src/main/java/app/organicmaps/bookmarks/data/Bookmark.java b/android/app/src/main/java/app/organicmaps/bookmarks/data/Bookmark.java index 151dd5a2ee..ddb4b22f81 100644 --- a/android/app/src/main/java/app/organicmaps/bookmarks/data/Bookmark.java +++ b/android/app/src/main/java/app/organicmaps/bookmarks/data/Bookmark.java @@ -10,7 +10,7 @@ import androidx.annotation.Nullable; import androidx.core.os.ParcelCompat; import app.organicmaps.Framework; -import app.organicmaps.routing.RoutePointInfo; +import app.organicmaps.sdk.routing.RoutePointInfo; import app.organicmaps.sdk.search.Popularity; import app.organicmaps.util.Constants; diff --git a/android/app/src/main/java/app/organicmaps/bookmarks/data/MapObject.java b/android/app/src/main/java/app/organicmaps/bookmarks/data/MapObject.java index 75b3d67aa9..f24e56047b 100644 --- a/android/app/src/main/java/app/organicmaps/bookmarks/data/MapObject.java +++ b/android/app/src/main/java/app/organicmaps/bookmarks/data/MapObject.java @@ -11,7 +11,7 @@ import androidx.annotation.Nullable; import androidx.core.os.ParcelCompat; import app.organicmaps.Framework; -import app.organicmaps.routing.RoutePointInfo; +import app.organicmaps.sdk.routing.RoutePointInfo; import app.organicmaps.sdk.search.Popularity; import app.organicmaps.util.Utils; import app.organicmaps.widget.placepage.PlacePageData; diff --git a/android/app/src/main/java/app/organicmaps/car/screens/NavigationScreen.java b/android/app/src/main/java/app/organicmaps/car/screens/NavigationScreen.java index b365a4a520..b43b9fc865 100644 --- a/android/app/src/main/java/app/organicmaps/car/screens/NavigationScreen.java +++ b/android/app/src/main/java/app/organicmaps/car/screens/NavigationScreen.java @@ -30,10 +30,10 @@ import app.organicmaps.car.util.ThemeUtils; import app.organicmaps.car.util.UiHelpers; import app.organicmaps.location.LocationHelper; import app.organicmaps.location.LocationListener; -import app.organicmaps.routing.JunctionInfo; +import app.organicmaps.sdk.routing.JunctionInfo; import app.organicmaps.routing.NavigationService; import app.organicmaps.routing.RoutingController; -import app.organicmaps.routing.RoutingInfo; +import app.organicmaps.sdk.routing.RoutingInfo; import app.organicmaps.sound.TtsPlayer; import app.organicmaps.util.LocationUtils; import app.organicmaps.util.log.Logger; diff --git a/android/app/src/main/java/app/organicmaps/car/screens/PlaceScreen.java b/android/app/src/main/java/app/organicmaps/car/screens/PlaceScreen.java index 84aa492649..7f0312453a 100644 --- a/android/app/src/main/java/app/organicmaps/car/screens/PlaceScreen.java +++ b/android/app/src/main/java/app/organicmaps/car/screens/PlaceScreen.java @@ -41,7 +41,7 @@ import app.organicmaps.car.util.UiHelpers; import app.organicmaps.location.LocationHelper; import app.organicmaps.routing.ResultCodesHelper; import app.organicmaps.routing.RoutingController; -import app.organicmaps.routing.RoutingInfo; +import app.organicmaps.sdk.routing.RoutingInfo; import app.organicmaps.sdk.Router; import app.organicmaps.util.Config; diff --git a/android/app/src/main/java/app/organicmaps/car/screens/settings/DrivingOptionsScreen.java b/android/app/src/main/java/app/organicmaps/car/screens/settings/DrivingOptionsScreen.java index 9316ee5bb9..0143983da7 100644 --- a/android/app/src/main/java/app/organicmaps/car/screens/settings/DrivingOptionsScreen.java +++ b/android/app/src/main/java/app/organicmaps/car/screens/settings/DrivingOptionsScreen.java @@ -18,7 +18,7 @@ import app.organicmaps.car.SurfaceRenderer; import app.organicmaps.car.screens.base.BaseMapScreen; import app.organicmaps.car.util.Toggle; import app.organicmaps.car.util.UiHelpers; -import app.organicmaps.routing.RoutingOptions; +import app.organicmaps.sdk.routing.RoutingOptions; import app.organicmaps.settings.RoadType; import java.util.HashMap; diff --git a/android/app/src/main/java/app/organicmaps/car/util/RoutingHelpers.java b/android/app/src/main/java/app/organicmaps/car/util/RoutingHelpers.java index 23f41f1751..7bc0e76938 100644 --- a/android/app/src/main/java/app/organicmaps/car/util/RoutingHelpers.java +++ b/android/app/src/main/java/app/organicmaps/car/util/RoutingHelpers.java @@ -8,8 +8,8 @@ import androidx.car.app.navigation.model.LaneDirection; import androidx.car.app.navigation.model.Maneuver; import androidx.core.graphics.drawable.IconCompat; -import app.organicmaps.routing.RoutingInfo; -import app.organicmaps.routing.SingleLaneInfo; +import app.organicmaps.sdk.routing.RoutingInfo; +import app.organicmaps.sdk.routing.SingleLaneInfo; public final class RoutingHelpers { diff --git a/android/app/src/main/java/app/organicmaps/car/util/RoutingUtils.java b/android/app/src/main/java/app/organicmaps/car/util/RoutingUtils.java index 95a7379897..f79dcd6f68 100644 --- a/android/app/src/main/java/app/organicmaps/car/util/RoutingUtils.java +++ b/android/app/src/main/java/app/organicmaps/car/util/RoutingUtils.java @@ -15,8 +15,8 @@ import androidx.car.app.navigation.model.Trip; import androidx.core.graphics.drawable.IconCompat; import app.organicmaps.bookmarks.data.MapObject; -import app.organicmaps.routing.RoutingInfo; -import app.organicmaps.routing.SingleLaneInfo; +import app.organicmaps.sdk.routing.RoutingInfo; +import app.organicmaps.sdk.routing.SingleLaneInfo; import app.organicmaps.util.Graphics; import app.organicmaps.widget.LanesDrawable; diff --git a/android/app/src/main/java/app/organicmaps/location/LocationHelper.java b/android/app/src/main/java/app/organicmaps/location/LocationHelper.java index 92ab5e13c1..9c0fbac835 100644 --- a/android/app/src/main/java/app/organicmaps/location/LocationHelper.java +++ b/android/app/src/main/java/app/organicmaps/location/LocationHelper.java @@ -25,7 +25,7 @@ import app.organicmaps.Map; import app.organicmaps.MwmApplication; import app.organicmaps.bookmarks.data.FeatureId; import app.organicmaps.bookmarks.data.MapObject; -import app.organicmaps.routing.JunctionInfo; +import app.organicmaps.sdk.routing.JunctionInfo; import app.organicmaps.routing.RoutingController; import app.organicmaps.util.Config; import app.organicmaps.util.LocationUtils; diff --git a/android/app/src/main/java/app/organicmaps/location/RouteSimulationProvider.java b/android/app/src/main/java/app/organicmaps/location/RouteSimulationProvider.java index c44e355e63..2c47224f5d 100644 --- a/android/app/src/main/java/app/organicmaps/location/RouteSimulationProvider.java +++ b/android/app/src/main/java/app/organicmaps/location/RouteSimulationProvider.java @@ -5,7 +5,7 @@ import android.location.Location; import androidx.annotation.NonNull; -import app.organicmaps.routing.JunctionInfo; +import app.organicmaps.sdk.routing.JunctionInfo; import app.organicmaps.util.LocationUtils; import app.organicmaps.util.concurrency.UiThread; import app.organicmaps.util.log.Logger; diff --git a/android/app/src/main/java/app/organicmaps/routing/ManageRouteAdapter.java b/android/app/src/main/java/app/organicmaps/routing/ManageRouteAdapter.java index 4e6fa6c5a6..6f0d28150c 100644 --- a/android/app/src/main/java/app/organicmaps/routing/ManageRouteAdapter.java +++ b/android/app/src/main/java/app/organicmaps/routing/ManageRouteAdapter.java @@ -17,6 +17,8 @@ import androidx.recyclerview.widget.RecyclerView; import app.organicmaps.R; import app.organicmaps.bookmarks.data.MapObject; +import app.organicmaps.sdk.routing.RouteMarkData; +import app.organicmaps.sdk.routing.RoutePointInfo; import app.organicmaps.util.StringUtils; import app.organicmaps.util.UiUtils; diff --git a/android/app/src/main/java/app/organicmaps/routing/ManageRouteBottomSheet.java b/android/app/src/main/java/app/organicmaps/routing/ManageRouteBottomSheet.java index 0ca75f3c1d..2929e9f3cc 100644 --- a/android/app/src/main/java/app/organicmaps/routing/ManageRouteBottomSheet.java +++ b/android/app/src/main/java/app/organicmaps/routing/ManageRouteBottomSheet.java @@ -20,6 +20,7 @@ import app.organicmaps.Framework; import app.organicmaps.MwmApplication; import app.organicmaps.R; import app.organicmaps.bookmarks.data.MapObject; +import app.organicmaps.sdk.routing.RouteMarkData; import app.organicmaps.util.UiUtils; import com.google.android.material.bottomsheet.BottomSheetBehavior; import com.google.android.material.bottomsheet.BottomSheetDialog; diff --git a/android/app/src/main/java/app/organicmaps/routing/NavigationController.java b/android/app/src/main/java/app/organicmaps/routing/NavigationController.java index 9615243db0..903c9a2a2c 100644 --- a/android/app/src/main/java/app/organicmaps/routing/NavigationController.java +++ b/android/app/src/main/java/app/organicmaps/routing/NavigationController.java @@ -19,6 +19,7 @@ import app.organicmaps.location.LocationHelper; import app.organicmaps.maplayer.MapButtonsViewModel; import app.organicmaps.maplayer.traffic.TrafficManager; import app.organicmaps.sdk.Router; +import app.organicmaps.sdk.routing.RoutingInfo; import app.organicmaps.util.StringUtils; import app.organicmaps.util.UiUtils; import app.organicmaps.util.Utils; diff --git a/android/app/src/main/java/app/organicmaps/routing/NavigationService.java b/android/app/src/main/java/app/organicmaps/routing/NavigationService.java index d2327c32e4..1b74eb3a58 100644 --- a/android/app/src/main/java/app/organicmaps/routing/NavigationService.java +++ b/android/app/src/main/java/app/organicmaps/routing/NavigationService.java @@ -33,6 +33,7 @@ import app.organicmaps.Framework; import app.organicmaps.MwmActivity; import app.organicmaps.MwmApplication; import app.organicmaps.R; +import app.organicmaps.sdk.routing.RoutingInfo; import app.organicmaps.sound.MediaPlayerWrapper; import app.organicmaps.location.LocationHelper; import app.organicmaps.location.LocationListener; diff --git a/android/app/src/main/java/app/organicmaps/routing/RoutingBottomMenuController.java b/android/app/src/main/java/app/organicmaps/routing/RoutingBottomMenuController.java index e9745a52b5..60fb4e22e2 100644 --- a/android/app/src/main/java/app/organicmaps/routing/RoutingBottomMenuController.java +++ b/android/app/src/main/java/app/organicmaps/routing/RoutingBottomMenuController.java @@ -32,6 +32,11 @@ import app.organicmaps.Framework; import app.organicmaps.R; import app.organicmaps.bookmarks.data.DistanceAndAzimut; import app.organicmaps.location.LocationHelper; +import app.organicmaps.sdk.routing.RouteMarkData; +import app.organicmaps.sdk.routing.RoutePointInfo; +import app.organicmaps.sdk.routing.RoutingInfo; +import app.organicmaps.sdk.routing.TransitRouteInfo; +import app.organicmaps.sdk.routing.TransitStepInfo; import app.organicmaps.util.Distance; import app.organicmaps.util.Graphics; import app.organicmaps.util.ThemeUtils; diff --git a/android/app/src/main/java/app/organicmaps/routing/RoutingBottomMenuListener.java b/android/app/src/main/java/app/organicmaps/routing/RoutingBottomMenuListener.java index 135f6b3213..589c5f5f03 100644 --- a/android/app/src/main/java/app/organicmaps/routing/RoutingBottomMenuListener.java +++ b/android/app/src/main/java/app/organicmaps/routing/RoutingBottomMenuListener.java @@ -1,5 +1,7 @@ package app.organicmaps.routing; +import app.organicmaps.sdk.routing.RoutePointInfo; + public interface RoutingBottomMenuListener { void onUseMyPositionAsStart(); diff --git a/android/app/src/main/java/app/organicmaps/routing/RoutingController.java b/android/app/src/main/java/app/organicmaps/routing/RoutingController.java index 10b394bed6..5367f88a07 100644 --- a/android/app/src/main/java/app/organicmaps/routing/RoutingController.java +++ b/android/app/src/main/java/app/organicmaps/routing/RoutingController.java @@ -17,10 +17,15 @@ import app.organicmaps.bookmarks.data.FeatureId; import app.organicmaps.bookmarks.data.MapObject; import app.organicmaps.location.LocationHelper; import app.organicmaps.sdk.Router; +import app.organicmaps.sdk.routing.RouteMarkData; +import app.organicmaps.sdk.routing.RoutePointInfo; import app.organicmaps.sdk.routing.RouteRecommendationType; +import app.organicmaps.sdk.routing.RoutingInfo; import app.organicmaps.sdk.routing.RoutingListener; import app.organicmaps.sdk.routing.RoutingLoadPointsListener; +import app.organicmaps.sdk.routing.RoutingOptions; import app.organicmaps.sdk.routing.RoutingProgressListener; +import app.organicmaps.sdk.routing.TransitRouteInfo; import app.organicmaps.widget.placepage.CoordinatesFormat; import app.organicmaps.util.StringUtils; import app.organicmaps.util.Utils; diff --git a/android/app/src/main/java/app/organicmaps/routing/RoutingPlanController.java b/android/app/src/main/java/app/organicmaps/routing/RoutingPlanController.java index d9df888ad4..de22cff865 100644 --- a/android/app/src/main/java/app/organicmaps/routing/RoutingPlanController.java +++ b/android/app/src/main/java/app/organicmaps/routing/RoutingPlanController.java @@ -19,6 +19,9 @@ import app.organicmaps.Framework; import app.organicmaps.MwmApplication; import app.organicmaps.R; import app.organicmaps.sdk.Router; +import app.organicmaps.sdk.routing.RoutingInfo; +import app.organicmaps.sdk.routing.RoutingOptions; +import app.organicmaps.sdk.routing.TransitRouteInfo; import app.organicmaps.settings.DrivingOptionsActivity; import app.organicmaps.util.UiUtils; import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener; diff --git a/android/app/src/main/java/app/organicmaps/routing/TransitStepAdapter.java b/android/app/src/main/java/app/organicmaps/routing/TransitStepAdapter.java index c57d12f148..e5b032fd27 100644 --- a/android/app/src/main/java/app/organicmaps/routing/TransitStepAdapter.java +++ b/android/app/src/main/java/app/organicmaps/routing/TransitStepAdapter.java @@ -8,6 +8,7 @@ import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import app.organicmaps.R; +import app.organicmaps.sdk.routing.TransitStepInfo; import java.util.ArrayList; import java.util.List; diff --git a/android/app/src/main/java/app/organicmaps/routing/TransitStepView.java b/android/app/src/main/java/app/organicmaps/routing/TransitStepView.java index 9f4a965c10..9e43a17d19 100644 --- a/android/app/src/main/java/app/organicmaps/routing/TransitStepView.java +++ b/android/app/src/main/java/app/organicmaps/routing/TransitStepView.java @@ -20,6 +20,8 @@ import androidx.annotation.Nullable; import androidx.core.content.res.ResourcesCompat; import androidx.core.graphics.drawable.DrawableCompat; import app.organicmaps.R; +import app.organicmaps.sdk.routing.TransitStepInfo; +import app.organicmaps.sdk.routing.TransitStepType; import app.organicmaps.widget.recycler.MultilineLayoutManager; import app.organicmaps.util.ThemeUtils; diff --git a/android/app/src/main/java/app/organicmaps/routing/JunctionInfo.java b/android/app/src/main/java/app/organicmaps/sdk/routing/JunctionInfo.java similarity index 77% rename from android/app/src/main/java/app/organicmaps/routing/JunctionInfo.java rename to android/app/src/main/java/app/organicmaps/sdk/routing/JunctionInfo.java index c4eeb3b520..def825811e 100644 --- a/android/app/src/main/java/app/organicmaps/routing/JunctionInfo.java +++ b/android/app/src/main/java/app/organicmaps/sdk/routing/JunctionInfo.java @@ -1,11 +1,11 @@ -package app.organicmaps.routing; +package app.organicmaps.sdk.routing; import androidx.annotation.Keep; // Used by JNI. @Keep @SuppressWarnings("unused") -public class JunctionInfo +public final class JunctionInfo { public final double mLat; public final double mLon; diff --git a/android/app/src/main/java/app/organicmaps/routing/RouteMarkData.java b/android/app/src/main/java/app/organicmaps/sdk/routing/RouteMarkData.java similarity index 94% rename from android/app/src/main/java/app/organicmaps/routing/RouteMarkData.java rename to android/app/src/main/java/app/organicmaps/sdk/routing/RouteMarkData.java index 33b1300e04..182802e375 100644 --- a/android/app/src/main/java/app/organicmaps/routing/RouteMarkData.java +++ b/android/app/src/main/java/app/organicmaps/sdk/routing/RouteMarkData.java @@ -1,4 +1,4 @@ -package app.organicmaps.routing; +package app.organicmaps.sdk.routing; import androidx.annotation.Keep; import androidx.annotation.Nullable; @@ -9,7 +9,7 @@ import androidx.annotation.Nullable; // Called from JNI. @Keep @SuppressWarnings("unused") -public class RouteMarkData +public final class RouteMarkData { @Nullable public final String mTitle; diff --git a/android/app/src/main/java/app/organicmaps/routing/RoutePointInfo.java b/android/app/src/main/java/app/organicmaps/sdk/routing/RoutePointInfo.java similarity index 94% rename from android/app/src/main/java/app/organicmaps/routing/RoutePointInfo.java rename to android/app/src/main/java/app/organicmaps/sdk/routing/RoutePointInfo.java index e04b0da5cc..4dfaf7356e 100644 --- a/android/app/src/main/java/app/organicmaps/routing/RoutePointInfo.java +++ b/android/app/src/main/java/app/organicmaps/sdk/routing/RoutePointInfo.java @@ -1,4 +1,4 @@ -package app.organicmaps.routing; +package app.organicmaps.sdk.routing; import android.os.Parcel; import android.os.Parcelable; @@ -12,7 +12,7 @@ import java.lang.annotation.RetentionPolicy; // Called from JNI. @Keep @SuppressWarnings("unused") -public class RoutePointInfo implements Parcelable +public final class RoutePointInfo implements Parcelable { public static final Creator CREATOR = new Creator<>() { diff --git a/android/app/src/main/java/app/organicmaps/routing/RoutingInfo.java b/android/app/src/main/java/app/organicmaps/sdk/routing/RoutingInfo.java similarity index 98% rename from android/app/src/main/java/app/organicmaps/routing/RoutingInfo.java rename to android/app/src/main/java/app/organicmaps/sdk/routing/RoutingInfo.java index 6b0a393783..c8121dd3ad 100644 --- a/android/app/src/main/java/app/organicmaps/routing/RoutingInfo.java +++ b/android/app/src/main/java/app/organicmaps/sdk/routing/RoutingInfo.java @@ -1,4 +1,4 @@ -package app.organicmaps.routing; +package app.organicmaps.sdk.routing; import android.widget.ImageView; @@ -12,7 +12,7 @@ import app.organicmaps.util.Distance; // Called from JNI. @Keep @SuppressWarnings("unused") -public class RoutingInfo +public final class RoutingInfo { // Target (end point of route). public final Distance distToTarget; @@ -105,7 +105,7 @@ public class RoutingInfo } } - enum PedestrianTurnDirection + public enum PedestrianTurnDirection { NO_TURN(R.drawable.ic_turn_straight, 0), GO_STRAIGHT(R.drawable.ic_turn_straight, 0), diff --git a/android/app/src/main/java/app/organicmaps/routing/RoutingOptions.java b/android/app/src/main/java/app/organicmaps/sdk/routing/RoutingOptions.java similarity index 93% rename from android/app/src/main/java/app/organicmaps/routing/RoutingOptions.java rename to android/app/src/main/java/app/organicmaps/sdk/routing/RoutingOptions.java index 67cd892308..9868930e2c 100644 --- a/android/app/src/main/java/app/organicmaps/routing/RoutingOptions.java +++ b/android/app/src/main/java/app/organicmaps/sdk/routing/RoutingOptions.java @@ -1,4 +1,4 @@ -package app.organicmaps.routing; +package app.organicmaps.sdk.routing; import androidx.annotation.NonNull; @@ -7,7 +7,7 @@ import app.organicmaps.settings.RoadType; import java.util.HashSet; import java.util.Set; -public class RoutingOptions +public final class RoutingOptions { public static void addOption(@NonNull RoadType roadType) { @@ -24,10 +24,6 @@ public class RoutingOptions return nativeHasOption(roadType.ordinal()); } - private static native void nativeAddOption(int option); - private static native void nativeRemoveOption(int option); - private static native boolean nativeHasOption(int option); - public static boolean hasAnyOptions() { for (RoadType each : RoadType.values()) @@ -49,4 +45,10 @@ public class RoutingOptions } return roadTypes; } + + private static native void nativeAddOption(int option); + + private static native void nativeRemoveOption(int option); + + private static native boolean nativeHasOption(int option); } diff --git a/android/app/src/main/java/app/organicmaps/routing/SingleLaneInfo.java b/android/app/src/main/java/app/organicmaps/sdk/routing/SingleLaneInfo.java similarity index 95% rename from android/app/src/main/java/app/organicmaps/routing/SingleLaneInfo.java rename to android/app/src/main/java/app/organicmaps/sdk/routing/SingleLaneInfo.java index 96595ad21b..480dcaf4b8 100644 --- a/android/app/src/main/java/app/organicmaps/routing/SingleLaneInfo.java +++ b/android/app/src/main/java/app/organicmaps/sdk/routing/SingleLaneInfo.java @@ -1,11 +1,11 @@ -package app.organicmaps.routing; +package app.organicmaps.sdk.routing; import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; import app.organicmaps.R; -public class SingleLaneInfo +public final class SingleLaneInfo { public LaneWay[] mLane; public boolean mIsActive; diff --git a/android/app/src/main/java/app/organicmaps/routing/TransitRouteInfo.java b/android/app/src/main/java/app/organicmaps/sdk/routing/TransitRouteInfo.java similarity index 84% rename from android/app/src/main/java/app/organicmaps/routing/TransitRouteInfo.java rename to android/app/src/main/java/app/organicmaps/sdk/routing/TransitRouteInfo.java index 949f95720e..61946fbde3 100644 --- a/android/app/src/main/java/app/organicmaps/routing/TransitRouteInfo.java +++ b/android/app/src/main/java/app/organicmaps/sdk/routing/TransitRouteInfo.java @@ -1,4 +1,4 @@ -package app.organicmaps.routing; +package app.organicmaps.sdk.routing; import androidx.annotation.Keep; import androidx.annotation.NonNull; @@ -13,7 +13,7 @@ import java.util.List; // Used by JNI. @Keep @SuppressWarnings("unused") -public class TransitRouteInfo +public final class TransitRouteInfo { @NonNull private final String mTotalDistance; @@ -42,29 +42,29 @@ public class TransitRouteInfo } @NonNull - String getTotalPedestrianDistance() + public String getTotalPedestrianDistance() { return mTotalPedestrianDistance; } - int getTotalPedestrianTimeInSec() + public int getTotalPedestrianTimeInSec() { return mTotalPedestrianTimeInSec; } @NonNull - String getTotalPedestrianDistanceUnits() + public String getTotalPedestrianDistanceUnits() { return mTotalPedestrianDistanceUnits; } - int getTotalTime() + public int getTotalTime() { return mTotalTimeInSec; } @NonNull - List getTransitSteps() + public List getTransitSteps() { return new ArrayList<>(Arrays.asList(mSteps)); } diff --git a/android/app/src/main/java/app/organicmaps/routing/TransitStepInfo.java b/android/app/src/main/java/app/organicmaps/sdk/routing/TransitStepInfo.java similarity index 97% rename from android/app/src/main/java/app/organicmaps/routing/TransitStepInfo.java rename to android/app/src/main/java/app/organicmaps/sdk/routing/TransitStepInfo.java index 905ccdfd60..4a3fef43bf 100644 --- a/android/app/src/main/java/app/organicmaps/routing/TransitStepInfo.java +++ b/android/app/src/main/java/app/organicmaps/sdk/routing/TransitStepInfo.java @@ -1,4 +1,4 @@ -package app.organicmaps.routing; +package app.organicmaps.sdk.routing; import androidx.annotation.IntDef; import androidx.annotation.Keep; @@ -14,7 +14,7 @@ import java.lang.annotation.RetentionPolicy; // Used by JNI. @Keep @SuppressWarnings("unused") -public class TransitStepInfo +public final class TransitStepInfo { private static final int TRANSIT_TYPE_INTERMEDIATE_POINT = 0; private static final int TRANSIT_TYPE_PEDESTRIAN = 1; diff --git a/android/app/src/main/java/app/organicmaps/routing/TransitStepType.java b/android/app/src/main/java/app/organicmaps/sdk/routing/TransitStepType.java similarity index 95% rename from android/app/src/main/java/app/organicmaps/routing/TransitStepType.java rename to android/app/src/main/java/app/organicmaps/sdk/routing/TransitStepType.java index bf1ffd9a6d..5d6cdc9b5f 100644 --- a/android/app/src/main/java/app/organicmaps/routing/TransitStepType.java +++ b/android/app/src/main/java/app/organicmaps/sdk/routing/TransitStepType.java @@ -1,4 +1,4 @@ -package app.organicmaps.routing; +package app.organicmaps.sdk.routing; import androidx.annotation.DrawableRes; diff --git a/android/app/src/main/java/app/organicmaps/settings/DrivingOptionsFragment.java b/android/app/src/main/java/app/organicmaps/settings/DrivingOptionsFragment.java index ec827f45ff..5c5f2f4800 100644 --- a/android/app/src/main/java/app/organicmaps/settings/DrivingOptionsFragment.java +++ b/android/app/src/main/java/app/organicmaps/settings/DrivingOptionsFragment.java @@ -14,7 +14,7 @@ import androidx.appcompat.widget.SwitchCompat; import app.organicmaps.R; import app.organicmaps.base.BaseMwmToolbarFragment; import app.organicmaps.routing.RoutingController; -import app.organicmaps.routing.RoutingOptions; +import app.organicmaps.sdk.routing.RoutingOptions; import java.util.ArrayList; import java.util.Collections; diff --git a/android/app/src/main/java/app/organicmaps/settings/SettingsPrefsFragment.java b/android/app/src/main/java/app/organicmaps/settings/SettingsPrefsFragment.java index 72c07ec630..f0c7fa6e2f 100644 --- a/android/app/src/main/java/app/organicmaps/settings/SettingsPrefsFragment.java +++ b/android/app/src/main/java/app/organicmaps/settings/SettingsPrefsFragment.java @@ -24,7 +24,7 @@ import app.organicmaps.editor.data.Language; import app.organicmaps.help.HelpActivity; import app.organicmaps.location.LocationHelper; import app.organicmaps.location.LocationProviderFactory; -import app.organicmaps.routing.RoutingOptions; +import app.organicmaps.sdk.routing.RoutingOptions; import app.organicmaps.util.Config; import app.organicmaps.util.NetworkPolicy; import app.organicmaps.util.PowerManagment; diff --git a/android/app/src/main/java/app/organicmaps/widget/LanesDrawable.java b/android/app/src/main/java/app/organicmaps/widget/LanesDrawable.java index eb01fa560e..c54ba8bb62 100644 --- a/android/app/src/main/java/app/organicmaps/widget/LanesDrawable.java +++ b/android/app/src/main/java/app/organicmaps/widget/LanesDrawable.java @@ -15,7 +15,7 @@ import androidx.appcompat.content.res.AppCompatResources; import androidx.core.content.ContextCompat; import app.organicmaps.R; -import app.organicmaps.routing.SingleLaneInfo; +import app.organicmaps.sdk.routing.SingleLaneInfo; import java.util.Objects; diff --git a/android/app/src/main/java/app/organicmaps/widget/LanesView.java b/android/app/src/main/java/app/organicmaps/widget/LanesView.java index b1a1a5daa0..0aa0aab4c4 100644 --- a/android/app/src/main/java/app/organicmaps/widget/LanesView.java +++ b/android/app/src/main/java/app/organicmaps/widget/LanesView.java @@ -18,7 +18,7 @@ import androidx.annotation.Nullable; import androidx.annotation.StyleableRes; import app.organicmaps.R; -import app.organicmaps.routing.SingleLaneInfo; +import app.organicmaps.sdk.routing.SingleLaneInfo; public class LanesView extends View { diff --git a/android/app/src/main/java/app/organicmaps/widget/menu/NavMenu.java b/android/app/src/main/java/app/organicmaps/widget/menu/NavMenu.java index 9e2b8612b7..855f364cdc 100644 --- a/android/app/src/main/java/app/organicmaps/widget/menu/NavMenu.java +++ b/android/app/src/main/java/app/organicmaps/widget/menu/NavMenu.java @@ -14,7 +14,7 @@ import androidx.core.content.ContextCompat; import com.google.android.material.bottomsheet.BottomSheetBehavior; import app.organicmaps.R; import app.organicmaps.location.LocationHelper; -import app.organicmaps.routing.RoutingInfo; +import app.organicmaps.sdk.routing.RoutingInfo; import app.organicmaps.sound.TtsPlayer; import app.organicmaps.util.Graphics; import app.organicmaps.util.StringUtils;