Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Mapbox welcomes participation and contributions from everyone.
- Exposed a new API `MapboxManeuverView.updateLaneGuidanceIconStyle` that would allow changing the style of `MapboxLaneGuidanceAdapter` at runtime. [#5334](https://github.com/mapbox/mapbox-navigation-android/pull/5334)
- Fixed a crash when `MapboxNavigationViewportDataSourceDebugger.enabled` is repeatedly set to true. [#5347](https://github.com/mapbox/mapbox-navigation-android/pull/5347)
- Implemented vanishing route line feature from 1.x for exposing an option to adjust/limit the frequency of the vanishing route line updates. The MapboxRouteLineOptions.vanishingRouteLineUpdateIntervalNano can reduce the frequency of vanishing route line updates when the value of the option increases. [#5344](https://github.com/mapbox/mapbox-navigation-android/pull/5344)
- Fixed `RoadShield` by reverting the breaking changes and use the new shield callback. [#5302](https://github.com/mapbox/mapbox-navigation-android/pull/5302)

## Mapbox Navigation SDK 2.0.5 - January 7, 2022
This is a patch release on top of `v2.0.x` which does not include changes introduced in `v2.1.x` and later.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import com.mapbox.navigation.core.trip.session.LocationObserver
import com.mapbox.navigation.core.trip.session.RouteProgressObserver
import com.mapbox.navigation.examples.core.databinding.LayoutActivityManeuverBinding
import com.mapbox.navigation.ui.maneuver.api.MapboxManeuverApi
import com.mapbox.navigation.ui.maneuver.api.RoadShieldsCallback
import com.mapbox.navigation.ui.maneuver.model.Maneuver
import com.mapbox.navigation.ui.maneuver.model.ManeuverError
import com.mapbox.navigation.ui.maneuver.view.MapboxManeuverView
Expand All @@ -59,6 +58,7 @@ import com.mapbox.navigation.ui.maps.route.line.api.MapboxRouteLineView
import com.mapbox.navigation.ui.maps.route.line.model.MapboxRouteLineOptions
import com.mapbox.navigation.ui.maps.route.line.model.RouteLine
import com.mapbox.navigation.ui.maps.route.line.model.RouteLineResources
import com.mapbox.navigation.ui.shield.model.RouteShieldCallback
import com.mapbox.navigation.ui.utils.internal.ifNonNull
import com.mapbox.navigation.utils.internal.LoggerProvider
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -129,16 +129,8 @@ class MapboxManeuverActivity : AppCompatActivity(), OnMapLongClickListener {

private val replayProgressObserver = ReplayProgressObserver(mapboxReplayer)

private val roadShieldCallback = RoadShieldsCallback { _, shieldResult, shieldErrors ->
private val roadShieldCallback = RouteShieldCallback { shieldResult ->
binding.maneuverView.renderManeuverWith(shieldResult)
shieldErrors.forEach { (id, errors) ->
errors.forEach { error ->
LoggerProvider.logger.e(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we can keep logging the error here

Tag("MbxManeuverActivity"),
Message("id: $id -- error: ${error.url} - ${error.message}")
)
}
}
}

private val locationObserver = object : LocationObserver {
Expand Down
61 changes: 28 additions & 33 deletions libnavui-maneuver/api/current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ package com.mapbox.navigation.ui.maneuver.api {
method public com.mapbox.bindgen.Expected<com.mapbox.navigation.ui.maneuver.model.ManeuverError,java.util.List<com.mapbox.navigation.ui.maneuver.model.Maneuver>> getManeuvers(com.mapbox.api.directions.v5.models.DirectionsRoute route);
method public com.mapbox.bindgen.Expected<com.mapbox.navigation.ui.maneuver.model.ManeuverError,java.util.List<com.mapbox.navigation.ui.maneuver.model.Maneuver>> getManeuvers(com.mapbox.navigation.base.trip.model.RouteProgress routeProgress);
method @Deprecated public void getRoadShields(java.util.List<com.mapbox.navigation.ui.maneuver.model.Maneuver> maneuvers, com.mapbox.navigation.ui.maneuver.api.RoadShieldCallback callback);
method @Deprecated public void getRoadShields(String? userId, String? styleId, String? accessToken, java.util.List<com.mapbox.navigation.ui.maneuver.model.Maneuver> maneuvers, com.mapbox.navigation.ui.maneuver.api.RoadShieldCallback callback);
method public void getRoadShields(java.util.List<com.mapbox.navigation.ui.maneuver.model.Maneuver> maneuvers, com.mapbox.navigation.ui.maneuver.api.RoadShieldsCallback shieldCallback);
method public void getRoadShields(String? userId, String? styleId, String? accessToken, java.util.List<com.mapbox.navigation.ui.maneuver.model.Maneuver> maneuvers, com.mapbox.navigation.ui.maneuver.api.RoadShieldsCallback shieldCallback);
method public void getRoadShields(java.util.List<com.mapbox.navigation.ui.maneuver.model.Maneuver> maneuvers, com.mapbox.navigation.ui.shield.model.RouteShieldCallback shieldCallback);
method public void getRoadShields(String? userId, String? styleId, String? accessToken, java.util.List<com.mapbox.navigation.ui.maneuver.model.Maneuver> maneuvers, com.mapbox.navigation.ui.shield.model.RouteShieldCallback shieldCallback);
}

public final class MapboxTurnIconsApi {
Expand All @@ -33,10 +32,6 @@ package com.mapbox.navigation.ui.maneuver.api {
method @Deprecated public void onRoadShields(java.util.List<com.mapbox.navigation.ui.maneuver.model.Maneuver> maneuvers, java.util.Map<java.lang.String,com.mapbox.navigation.ui.maneuver.model.RoadShield> shields, java.util.Map<java.lang.String,com.mapbox.navigation.ui.maneuver.model.RoadShieldError> errors);
}

public fun interface RoadShieldsCallback {
method public void onRoadShields(java.util.List<com.mapbox.navigation.ui.maneuver.model.Maneuver> maneuvers, java.util.Map<java.lang.String,? extends java.util.List<com.mapbox.navigation.ui.maneuver.model.RoadShield>> shields, java.util.Map<java.lang.String,? extends java.util.List<com.mapbox.navigation.ui.maneuver.model.RoadShieldError>> errors);
}

}

package com.mapbox.navigation.ui.maneuver.model {
Expand Down Expand Up @@ -408,18 +403,14 @@ package com.mapbox.navigation.ui.maneuver.model {
field public static final com.mapbox.navigation.ui.maneuver.model.PrimaryManeuverFactory INSTANCE;
}

public final class RoadShield {
ctor public RoadShield(String shieldUrl, byte[] shieldIcon, com.mapbox.api.directions.v5.models.MapboxShield? mapboxShield = null);
ctor public RoadShield(String shieldUrl, byte[] shieldIcon);
method public String component1();
method public byte[] component2();
method public com.mapbox.api.directions.v5.models.MapboxShield? component3();
method public com.mapbox.navigation.ui.maneuver.model.RoadShield copy(String shieldUrl, byte[] shieldIcon, com.mapbox.api.directions.v5.models.MapboxShield? mapboxShield);
method public com.mapbox.api.directions.v5.models.MapboxShield? getMapboxShield();
method public byte[] getShieldIcon();
method public String getShieldUrl();
method public void setShieldIcon(byte[] p);
property public final com.mapbox.api.directions.v5.models.MapboxShield? mapboxShield;
@Deprecated public final class RoadShield {
ctor @Deprecated public RoadShield(String shieldUrl, byte[] shieldIcon);
method @Deprecated public String component1();
method @Deprecated public byte[] component2();
method @Deprecated public com.mapbox.navigation.ui.maneuver.model.RoadShield copy(String shieldUrl, byte[] shieldIcon);
method @Deprecated public byte[] getShieldIcon();
method @Deprecated public String getShieldUrl();
method @Deprecated public void setShieldIcon(byte[] p);
property public final byte[] shieldIcon;
property public final String shieldUrl;
}
Expand All @@ -442,16 +433,20 @@ package com.mapbox.navigation.ui.maneuver.model {
method public com.mapbox.navigation.ui.maneuver.model.RoadShieldComponentNode.Builder text(String text);
}

public final class RoadShieldError {
method public String component1();
method public String component2();
method public com.mapbox.navigation.ui.maneuver.model.RoadShieldError copy(String url, String message);
method public String getMessage();
method public String getUrl();
@Deprecated public final class RoadShieldError {
method @Deprecated public String component1();
method @Deprecated public String component2();
method @Deprecated public com.mapbox.navigation.ui.maneuver.model.RoadShieldError copy(String url, String message);
method @Deprecated public String getMessage();
method @Deprecated public String getUrl();
property public final String message;
property public final String url;
}

public final class RoadShieldExKt {
method public static com.mapbox.navigation.ui.shield.model.RouteShield toRouteShield(com.mapbox.navigation.ui.maneuver.model.RoadShield);
}

public final class SecondaryManeuver {
method public java.util.List<com.mapbox.navigation.ui.maneuver.model.Component> getComponentList();
method public Double? getDegrees();
Expand Down Expand Up @@ -851,16 +846,16 @@ package com.mapbox.navigation.ui.maneuver.view {
method public void renderAddLanes(com.mapbox.navigation.ui.maneuver.model.Lane lane);
method public void renderDistanceRemaining(com.mapbox.navigation.ui.maneuver.model.StepDistance stepDistance);
method @Deprecated public void renderManeuverShields(java.util.Map<java.lang.String,com.mapbox.navigation.ui.maneuver.model.RoadShield> shieldMap);
method public void renderManeuverWith(java.util.Map<java.lang.String,? extends java.util.List<com.mapbox.navigation.ui.maneuver.model.RoadShield>> shields);
method public void renderManeuverWith(java.util.List<? extends com.mapbox.bindgen.Expected<com.mapbox.navigation.ui.shield.model.RouteShieldError,com.mapbox.navigation.ui.shield.model.RouteShieldResult>> shields);
method public void renderManeuvers(com.mapbox.bindgen.Expected<com.mapbox.navigation.ui.maneuver.model.ManeuverError,java.util.List<com.mapbox.navigation.ui.maneuver.model.Maneuver>> maneuvers);
method public void renderPrimary(com.mapbox.navigation.ui.maneuver.model.PrimaryManeuver primary, java.util.List<com.mapbox.navigation.ui.maneuver.model.RoadShield>? roadShields);
method public void renderPrimary(com.mapbox.navigation.ui.maneuver.model.PrimaryManeuver primary, java.util.Set<? extends com.mapbox.navigation.ui.shield.model.RouteShield>? routeShields);
method @Deprecated public void renderPrimaryManeuver(com.mapbox.navigation.ui.maneuver.model.PrimaryManeuver primary, com.mapbox.navigation.ui.maneuver.model.RoadShield? roadShield = null);
method @Deprecated public void renderPrimaryManeuver(com.mapbox.navigation.ui.maneuver.model.PrimaryManeuver primary);
method public void renderRemoveLanes();
method public void renderSecondary(com.mapbox.navigation.ui.maneuver.model.SecondaryManeuver? secondary, java.util.List<com.mapbox.navigation.ui.maneuver.model.RoadShield>? roadShields);
method public void renderSecondary(com.mapbox.navigation.ui.maneuver.model.SecondaryManeuver? secondary, java.util.Set<? extends com.mapbox.navigation.ui.shield.model.RouteShield>? routeShields);
method @Deprecated public void renderSecondaryManeuver(com.mapbox.navigation.ui.maneuver.model.SecondaryManeuver? secondary, com.mapbox.navigation.ui.maneuver.model.RoadShield? roadShield = null);
method @Deprecated public void renderSecondaryManeuver(com.mapbox.navigation.ui.maneuver.model.SecondaryManeuver? secondary);
method public void renderSub(com.mapbox.navigation.ui.maneuver.model.SubManeuver? sub, java.util.List<com.mapbox.navigation.ui.maneuver.model.RoadShield>? roadShields);
method public void renderSub(com.mapbox.navigation.ui.maneuver.model.SubManeuver? sub, java.util.Set<? extends com.mapbox.navigation.ui.shield.model.RouteShield>? routeShields);
method @Deprecated public void renderSubManeuver(com.mapbox.navigation.ui.maneuver.model.SubManeuver? sub, com.mapbox.navigation.ui.maneuver.model.RoadShield? roadShield = null);
method @Deprecated public void renderSubManeuver(com.mapbox.navigation.ui.maneuver.model.SubManeuver? sub);
method public void setUpcomingManeuverRenderingEnabled(boolean value);
Expand Down Expand Up @@ -888,7 +883,7 @@ package com.mapbox.navigation.ui.maneuver.view {
ctor public MapboxPrimaryManeuver(android.content.Context context, android.util.AttributeSet? attrs, int defStyleAttr);
method @Deprecated public void render(com.mapbox.navigation.ui.maneuver.model.PrimaryManeuver maneuver, com.mapbox.navigation.ui.maneuver.model.RoadShield? roadShield = null);
method @Deprecated public void render(com.mapbox.navigation.ui.maneuver.model.PrimaryManeuver maneuver);
method public void renderManeuver(com.mapbox.navigation.ui.maneuver.model.PrimaryManeuver maneuver, java.util.List<com.mapbox.navigation.ui.maneuver.model.RoadShield>? roadShields);
method public void renderManeuver(com.mapbox.navigation.ui.maneuver.model.PrimaryManeuver maneuver, java.util.Set<? extends com.mapbox.navigation.ui.shield.model.RouteShield>? routeShields);
}

public final class MapboxSecondaryManeuver extends androidx.appcompat.widget.AppCompatTextView {
Expand All @@ -897,7 +892,7 @@ package com.mapbox.navigation.ui.maneuver.view {
ctor public MapboxSecondaryManeuver(android.content.Context context, android.util.AttributeSet? attrs, int defStyleAttr);
method @Deprecated public void render(com.mapbox.navigation.ui.maneuver.model.SecondaryManeuver? maneuver, com.mapbox.navigation.ui.maneuver.model.RoadShield? roadShield = null);
method @Deprecated public void render(com.mapbox.navigation.ui.maneuver.model.SecondaryManeuver? maneuver);
method public void renderManeuver(com.mapbox.navigation.ui.maneuver.model.SecondaryManeuver? maneuver, java.util.List<com.mapbox.navigation.ui.maneuver.model.RoadShield>? roadShields);
method public void renderManeuver(com.mapbox.navigation.ui.maneuver.model.SecondaryManeuver? maneuver, java.util.Set<? extends com.mapbox.navigation.ui.shield.model.RouteShield>? routeShields);
}

public final class MapboxStepDistance extends androidx.appcompat.widget.AppCompatTextView {
Expand All @@ -914,7 +909,7 @@ package com.mapbox.navigation.ui.maneuver.view {
ctor public MapboxSubManeuver(android.content.Context context, android.util.AttributeSet? attrs, int defStyleAttr);
method @Deprecated public void render(com.mapbox.navigation.ui.maneuver.model.SubManeuver? maneuver, com.mapbox.navigation.ui.maneuver.model.RoadShield? roadShield = null);
method @Deprecated public void render(com.mapbox.navigation.ui.maneuver.model.SubManeuver? maneuver);
method public void renderManeuver(com.mapbox.navigation.ui.maneuver.model.SubManeuver? maneuver, java.util.List<com.mapbox.navigation.ui.maneuver.model.RoadShield>? roadShields);
method public void renderManeuver(com.mapbox.navigation.ui.maneuver.model.SubManeuver? maneuver, java.util.Set<? extends com.mapbox.navigation.ui.shield.model.RouteShield>? routeShields);
}

public final class MapboxTurnIconManeuver extends androidx.appcompat.widget.AppCompatImageView {
Expand All @@ -934,7 +929,7 @@ package com.mapbox.navigation.ui.maneuver.view {
method public void onBindViewHolder(com.mapbox.navigation.ui.maneuver.view.MapboxUpcomingManeuverAdapter.MapboxUpcomingManeuverViewHolder holder, int position);
method public com.mapbox.navigation.ui.maneuver.view.MapboxUpcomingManeuverAdapter.MapboxUpcomingManeuverViewHolder onCreateViewHolder(android.view.ViewGroup parent, int viewType);
method @Deprecated public void updateRoadShields(java.util.Map<java.lang.String,com.mapbox.navigation.ui.maneuver.model.RoadShield> shieldMap);
method public void updateShields(java.util.Map<java.lang.String,? extends java.util.List<com.mapbox.navigation.ui.maneuver.model.RoadShield>> shields);
method public void updateShields(java.util.Set<? extends com.mapbox.navigation.ui.shield.model.RouteShield> shields);
method public void updateUpcomingManeuverStepDistanceTextAppearance(@StyleRes int style);
method public void updateUpcomingPrimaryManeuverTextAppearance(@StyleRes int style);
method public void updateUpcomingSecondaryManeuverTextAppearance(@StyleRes int style);
Expand Down
Loading