echo-swent / echo

4 stars 0 forks source link

Fix app crash when switching theme #367

Closed octogradiste closed 5 months ago

octogradiste commented 5 months ago

The problem was that we kept the same instance of the mapView across configuration changes. Therefore, when switching the theme, the mapView already had a parent view which causes an IllegalStateException. To fix this, I recreate the mapView at every configuration change. This has the side effect of re-centering the map at every configuration change. To avoid this, I save the camera position every time it moves, so I can restore the previous camera position when the map is recreated. Closes #333.

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

alejandrocalles commented 5 months ago

LGTM. Thanks :)