Skip to content

Commit 67b9efc

Browse files
authored
fix road label position not updating in some cases (#6531)
1 parent 8aaca27 commit 67b9efc

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Mapbox welcomes participation and contributions from everyone.
3434
- The `MapboxExtendableButtonParams` class has been removed. Any action button placement adjustments must be done via custom `ActionButtonsBinder` implementation. [#6498](https://github.com/mapbox/mapbox-navigation-android/pull/6498)
3535
- Fixed an issue where "silent waypoints" (not regular waypoints that define legs) had markers added on the map when route line was drawn with `MapboxRouteLineApi` and `MapboxRouteLineView`. [#6526](https://github.com/mapbox/mapbox-navigation-android/pull/6526)
3636
- Slightly improved performance of updates to the traveled portion of the route in MapboxRouteLineView. [#6528](https://github.com/mapbox/mapbox-navigation-android/pull/6528)
37+
- Fixed an issue with `NavigationView` that caused road label position to not update in some cases. [#6531](https://github.com/mapbox/mapbox-navigation-android/pull/6531)
3738

3839
## Mapbox Navigation SDK 2.10.0-alpha.1 - 28 October, 2022
3940
### Changelog

libnavui-dropin/src/main/java/com/mapbox/navigation/dropin/infopanel/InfoPanelCoordinator.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ internal class InfoPanelCoordinator(
8181
}
8282
}
8383
coroutineScope.launch {
84-
context.systemBarsInsets.collect(this@InfoPanelCoordinator::updateGuidelinePosition)
84+
context.systemBarsInsets.collect { updateGuidelinePosition(systemBarsInsets = it) }
8585
}
8686
coroutineScope.launch {
8787
context.options.isInfoPanelHideable.collect { hideable ->
@@ -98,7 +98,7 @@ internal class InfoPanelCoordinator(
9898
bottomSheetPeekHeight().collect { behavior.peekHeight = it }
9999
}
100100
coroutineScope.launch {
101-
infoPanelTop.collect { updateGuidelinePosition() }
101+
infoPanelTop.collect { updateGuidelinePosition(infoPanelTop = it) }
102102
}
103103
}
104104

@@ -157,10 +157,13 @@ internal class InfoPanelCoordinator(
157157
state = BottomSheetBehavior.STATE_HIDDEN
158158
}
159159

160-
private fun updateGuidelinePosition(systemBarsInsets: Insets = context.systemBarsInsets.value) {
160+
private fun updateGuidelinePosition(
161+
systemBarsInsets: Insets = context.systemBarsInsets.value,
162+
infoPanelTop: Int = infoPanel.top,
163+
) {
161164
val parentHeight = (infoPanel.parent as ViewGroup).height
162165
val maxPos = (parentHeight * GUIDELINE_MAX_POSITION_PERCENT).toInt()
163-
val pos = parentHeight - infoPanel.top - systemBarsInsets.bottom
166+
val pos = parentHeight - infoPanelTop - systemBarsInsets.bottom
164167
guidelineBottom.setGuidelineEnd(pos.coerceIn(0, maxPos))
165168
}
166169

0 commit comments

Comments
 (0)