Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[android] Keep CompassView's state up to date when compass is enabled. #15606

Merged
merged 3 commits into from
Sep 12, 2019

Conversation

pengdev
Copy link
Member

@pengdev pengdev commented Sep 11, 2019

Resolves #15133

Reproduced the above issue by setting setCompassEnabled() to false initially and enable it after 5 seconds time out.
before
As seen above, the compass view is not visible immediately after the setCompassEnabled call. Instead, only after user moved the map, the CompassView then showed up.

This PR resolves the issue by passing through the camera position update to the mapView regardless of whether the compass is enabled, and update the MapView's rotation when the MapView.setEnabled() is called.
after

@pengdev pengdev added the Android Mapbox Maps SDK for Android label Sep 11, 2019
@pengdev pengdev self-assigned this Sep 11, 2019
@pengdev pengdev requested a review from tobrun September 11, 2019 11:42
Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

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

change looks good! Could we back this change up with a test?

@tobrun tobrun added the needs changelog Indicates PR needs a changelog entry prior to merging. label Sep 11, 2019
@pengdev
Copy link
Member Author

pengdev commented Sep 11, 2019

change looks good! Could we back this change up with a test?

Sure, added unit tests for updating CompassView in UISettings.

Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

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

🚀

@pengdev pengdev force-pushed the peng-update-compassview-ui-settings branch from 47b7611 to ea0ea31 Compare September 12, 2019 08:06
@pengdev pengdev force-pushed the peng-update-compassview-ui-settings branch from ea0ea31 to cf64143 Compare September 12, 2019 08:14
@pengdev pengdev merged commit f0d3d45 into master Sep 12, 2019
@pengdev pengdev deleted the peng-update-compassview-ui-settings branch September 12, 2019 08:59
@pengdev pengdev removed the needs changelog Indicates PR needs a changelog entry prior to merging. label Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android MapBox - uiSettings.invalidate() does not proper work
2 participants