mapbox / mapbox-navigation-android-examples

Other
55 stars 46 forks source link

Override style of MapboxTripProgressView #171

Open foyst opened 2 years ago

foyst commented 2 years ago

Hi,

I'm following the "Render trip progress information" example and I'm wanting to apply a custom style to the MapboxTripProgressView component.

I can see in mapbox_activity_trip_progress.xml there is already a custom style applied but commented out. I've tried uncommenting this but the style doesn't seem to take effect.

Conversely I've tried uncommenting the custom style in "Render maneuver instructions for a route" (mapbox_activity_show_maneuver_instructions.xml) and this works fine.

I think the difference in behaviour is because MapboxManeuverView is passing config through the "updateOptions" functions, whereas MapboxTripProgressView is using the "updateStyle" function (which appears to be deprecated, and also has a hardcoded style of 0 passed in through the constructor that's being used).

Let me know if you need any more info.

Thanks!