mapbox / mapbox/mapbox-navigation-android-examples
Override style of MapboxTripProgressView
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 65
- Forks
- 56
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 2
Description
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!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with mapbox_activity_trip_progress.xml and compare its styling setup with mapbox_activity_show_maneuver_instructions.xml. Trace how MapboxTripProgressView uses updateStyle and its constructor style value versus MapboxManeuverView's updateOptions; done means the custom style in the trip progress example takes effect as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100