Skip to content

Commit e60a15a

Browse files
committed
make MapViewBinder#shouldLoadMapStyle false by default
1 parent 77d0006 commit e60a15a

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Mapbox welcomes participation and contributions from everyone.
77
#### Bug fixes and improvements
88
- Improved precision of congestion visualization and independent leg styling transitions, especially for long routes. [#6476](https://github.com/mapbox/mapbox-navigation-android/pull/6476)
99
- Fixed an issue with congestion visualization on the route line that occurred during route refreshes. [#6476](https://github.com/mapbox/mapbox-navigation-android/pull/6476)
10+
- Made `MapViewBinder#shouldLoadMapStyle` false by default. [#6485](https://github.com/mapbox/mapbox-navigation-android/pull/6485)
1011

1112
## Mapbox Navigation SDK 2.9.0-beta.2 - 14 October, 2022
1213
### Changelog
@@ -37,6 +38,7 @@ binding.navigationView.customizeViewBinders {
3738
}
3839
}
3940
```
41+
- Removed force disabling of `MapView#compass` for custom MapViews. [#6433](https://github.com/mapbox/mapbox-navigation-android/pull/6433)
4042
- :warning: Improved alternatives route processing. `MapboxNavigation#setNavigationRoutes` doesn't accept alternatives which don't deviate from primary route or which have different destinations. Rejected alternatives will be present in `RoutesSetSuccess.ignoredAlternatives` and won't produce `AlternativeRouteMetadata`. [#6464](https://github.com/mapbox/mapbox-navigation-android/pull/6464)
4143
- Fixed false detection of passed alternatives that led to their removal. [#6464](https://github.com/mapbox/mapbox-navigation-android/pull/6464)
4244
- Improved route matching. [#6464](https://github.com/mapbox/mapbox-navigation-android/pull/6464)

libnavui-dropin/src/main/java/com/mapbox/navigation/dropin/map/MapViewBinder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abstract class MapViewBinder : UIBinder {
5050
* `True` if Mapbox should load map style,
5151
* `false` if it will be loaded by the user or handled in any other way.
5252
*/
53-
open val shouldLoadMapStyle: Boolean = true
53+
open val shouldLoadMapStyle: Boolean = false
5454

5555
/**
5656
* Triggered when this view binder instance is attached. The [viewGroup] returns a

libnavui-dropin/src/main/java/com/mapbox/navigation/dropin/map/MapboxMapViewBinder.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
88
@ExperimentalPreviewMapboxNavigationAPI
99
internal class MapboxMapViewBinder : MapViewBinder() {
1010

11+
override val shouldLoadMapStyle: Boolean = true
12+
1113
override fun getMapView(context: Context): MapView {
1214
return MapView(context).apply {
1315
compass.enabled = false

libnavui-dropin/src/test/java/com/mapbox/navigation/dropin/map/MapViewBinderTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ import io.mockk.verify
5353
import kotlinx.coroutines.ExperimentalCoroutinesApi
5454
import kotlinx.coroutines.FlowPreview
5555
import kotlinx.coroutines.flow.MutableStateFlow
56+
import org.junit.Assert.assertFalse
5657
import org.junit.Assert.assertNotEquals
5758
import org.junit.Assert.assertNotNull
5859
import org.junit.Assert.assertNull
59-
import org.junit.Assert.assertTrue
6060
import org.junit.Before
6161
import org.junit.Rule
6262
import org.junit.Test
@@ -390,7 +390,7 @@ class MapViewBinderTest {
390390
}
391391

392392
@Test
393-
fun `shouldLoadMapStyle should be true`() {
394-
assertTrue(sut.shouldLoadMapStyle)
393+
fun `shouldLoadMapStyle should be false`() {
394+
assertFalse(sut.shouldLoadMapStyle)
395395
}
396396
}

qa-test-app/src/main/java/com/mapbox/navigation/qa_test_app/view/customnavview/CustomMapViewBinder.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@ class CustomMapViewBinder : MapViewBinder() {
1111
override fun getMapView(context: Context): MapView {
1212
return customMapViewFromCode(context)
1313
}
14-
15-
override val shouldLoadMapStyle: Boolean = false
1614
}

0 commit comments

Comments
 (0)