Skip to content

Commit 9a8c82d

Browse files
kiryldzanhnguyen1618
authored andcommitted
[HD Lite] Implement RouteRenderedObserver callback v2 (#10023)
* [HD Lite] Implement RouteRenderedObserver callback (#9910) * [HD Lite] Implement RouteRenderedObserver callback * Adapt opacity APIs * Adapt opacity API changes * wip * Simplify route setVisibility * PR fixes * bump snapshot * remove _ in MapComponent names --------- Co-authored-by: Anh Nguyen <anhnguyen6281@gmail.com> * [HD Lite] Follow-ups to adding RouteRenderedObserver * bump to latest v0.15 snapshot --------- Co-authored-by: Anh Nguyen <anhnguyen6281@gmail.com> GitOrigin-RevId: 96ec553e1c702ae4cbd967af6db53cb535bcb53a
1 parent ce07f78 commit 9a8c82d

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

gradle/dependencies.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ext {
88
carMinSdkVersion : 23
99
]
1010

11-
def mapboxSdkVersionSuffix = '15.0-SNAPSHOT-08-04--04-42.git-0cacf06'
11+
def mapboxSdkVersionSuffix = '15.0-SNAPSHOT-08-13--15-04.git-7c06c5d'
1212

1313
def ndkVersionSuffix = ""
1414
if (project.hasProperty("ndkMajor")) {
@@ -34,7 +34,7 @@ ext {
3434
mapboxNavigator : "${mapboxNavigatorVersion}",
3535
mapboxCommonNative : "24.${mapboxSdkVersionSuffix}",
3636
mapboxNavSdkCpp : "0.${mapboxSdkVersionSuffix}",
37-
mapboxSearch : '2.15.0-0cacf06-SNAPSHOT',
37+
mapboxSearch : '2.15.0-7c06c5d-SNAPSHOT',
3838
mapboxBaseAndroid : '0.11.0',
3939
androidXActivity : '1.7.1',
4040
androidXActivityCompose : '1.9.2',

navigation/src/main/java/com/mapbox/navigation/core/adas/AdasEdgeAttributes.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
1111
* @param slopes List of slope values with their positions on the edge.
1212
* Position is a shape index, where integer part in an index of geometry segment is
1313
* and fractional part is a position on the segment. Value is a slope in degrees
14+
* @param elevations List of elevation values with their positions on the edge.
15+
* Position is a shape index, where integer part in an index of geometry segment is
16+
* and fractional part is a position on the segment. Value is an elevation in meters above sea level.
1417
* @param curvatures List of curvature values with their positions on the edge.
1518
* Position is a shape index, where integer part in an index of geometry segment is
1619
* and fractional part is a position on the segment
@@ -23,6 +26,7 @@ import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
2326
class AdasEdgeAttributes private constructor(
2427
val speedLimit: List<AdasSpeedLimitInfo>,
2528
val slopes: List<AdasValueOnEdge>,
29+
val elevations: List<AdasValueOnEdge>,
2630
val curvatures: List<AdasValueOnEdge>,
2731
val isDividedRoad: Boolean?,
2832
@FormOfWay.Type val formOfWay: Int?,
@@ -41,6 +45,7 @@ class AdasEdgeAttributes private constructor(
4145
if (speedLimit != other.speedLimit) return false
4246
if (slopes != other.slopes) return false
4347
if (curvatures != other.curvatures) return false
48+
if (elevations != other.elevations) return false
4449
if (isDividedRoad != other.isDividedRoad) return false
4550
if (formOfWay != other.formOfWay) return false
4651
if (etc2 != other.etc2) return false
@@ -53,6 +58,7 @@ class AdasEdgeAttributes private constructor(
5358
override fun hashCode(): Int {
5459
var result = speedLimit.hashCode()
5560
result = 31 * result + slopes.hashCode()
61+
result = 31 * result + elevations.hashCode()
5662
result = 31 * result + curvatures.hashCode()
5763
result = 31 * result + isDividedRoad.hashCode()
5864
result = 31 * result + formOfWay.hashCode()
@@ -67,6 +73,7 @@ class AdasEdgeAttributes private constructor(
6773
return "EdgeAdasAttributes(" +
6874
"speedLimit=$speedLimit, " +
6975
"slopes=$slopes, " +
76+
"elevations=$elevations, " +
7077
"curvatures=$curvatures, " +
7178
"isDividedRoad=$isDividedRoad, " +
7279
"formOfWay=$formOfWay, " +
@@ -268,6 +275,9 @@ class AdasEdgeAttributes private constructor(
268275
slopes = nativeObj.slopes.map {
269276
AdasValueOnEdge.createFromNativeObject(it)
270277
},
278+
elevations = nativeObj.elevations.map {
279+
AdasValueOnEdge.createFromNativeObject(it)
280+
},
271281
curvatures = nativeObj.curvatures.map {
272282
AdasValueOnEdge.createFromNativeObject(it)
273283
},

navigation/src/test/java/com/mapbox/navigation/core/adas/AdasEdgeAttributesTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class AdasEdgeAttributesTest {
2424
listOf(AdasTypeFactory.NATIVE_SPEED_LIMIT_INFO),
2525
listOf(AdasTypeFactory.NATIVE_VALUE_ON_EDGE_1),
2626
listOf(AdasTypeFactory.NATIVE_VALUE_ON_EDGE_2),
27+
listOf(AdasTypeFactory.NATIVE_VALUE_ON_EDGE_3),
2728
true,
2829
com.mapbox.navigator.FormOfWay.CAR_PARK_ENTRANCE,
2930
com.mapbox.navigator.ETC2RoadType.HIGHWAY,
@@ -33,7 +34,8 @@ class AdasEdgeAttributesTest {
3334

3435
assertEquals(listOf(AdasTypeFactory.SPEED_LIMIT_INFO), platform.speedLimit)
3536
assertEquals(listOf(AdasTypeFactory.VALUE_ON_EDGE_1), platform.slopes)
36-
assertEquals(listOf(AdasTypeFactory.VALUE_ON_EDGE_2), platform.curvatures)
37+
assertEquals(listOf(AdasTypeFactory.VALUE_ON_EDGE_2), platform.elevations)
38+
assertEquals(listOf(AdasTypeFactory.VALUE_ON_EDGE_3), platform.curvatures)
3739
assertEquals(true, platform.isDividedRoad)
3840
assertEquals(AdasEdgeAttributes.FormOfWay.CAR_PARK_ENTRANCE, platform.formOfWay)
3941
assertEquals(AdasEdgeAttributes.Etc2Road.HIGHWAY, platform.etc2)

navigation/src/test/java/com/mapbox/navigation/core/adas/AdasTypeFactory.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ internal object AdasTypeFactory {
1414
val NATIVE_VALUE_ON_EDGE_2 = com.mapbox.navigator.ValueOnEdge(0.4f, 0.5, 0.6)
1515
val VALUE_ON_EDGE_2 = AdasValueOnEdge.createFromNativeObject(NATIVE_VALUE_ON_EDGE_2)
1616

17+
val NATIVE_VALUE_ON_EDGE_3 = com.mapbox.navigator.ValueOnEdge(0.7f, 0.8, 0.9)
18+
val VALUE_ON_EDGE_3 = AdasValueOnEdge.createFromNativeObject(NATIVE_VALUE_ON_EDGE_3)
19+
1720
val NATIVE_SPEED_LIMIT_RESTRICTION = com.mapbox.navigator.SpeedLimitRestriction(
1821
listOf(Weather.WET_ROAD, Weather.RAIN),
1922
"test-dateTimeCondition",

0 commit comments

Comments
 (0)