Skip to content

Fix MapSurface#surfaceChanged to update dimensions for plugins - #1575

Merged
kiryldz merged 2 commits into
mainfrom
MAPSAND-368-gestures-dont-work-as-expected-in-map-surface-activity
Aug 11, 2022
Merged

kiryldz merged 2 commits into
mainfrom
MAPSAND-368-gestures-dont-work-as-expected-in-map-surface-activity

Conversation

@kiryldz

@kiryldz kiryldz commented Aug 11, 2022 •

Copy link
Copy Markdown
Contributor

Summary of changes

When implementing MapSurface (e.g. for Android Auto) it is regular practice to overload just surfaceCreated, surfaceChanged and surfaceDestroyed methods. However in that case we're missing MapControllable.onSizeChanged call that actually notifies all the plugins.

That will lead as an example to incorrect map shove gesture as center focal point will always be (0, 0). Now surfaceChanged call will also call MapControllable.onSizeChanged under the hood.

User impact (optional)

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Optimize code for java consumption (@JvmOverloads, @file:JvmName, etc).
  • Add example if relevant.
  • Document any changes to public APIs.
  • Run make update-api to update generated api files, if there's public API changes, otherwise the verify-api-* CI steps might fail.
  • Update CHANGELOG.md or use the label 'skip changelog', otherwise check changelog CI step will fail.
  • If this PR is a v10.[version] release branch fix / enhancement, merge it to main firstly and then port to v10.[version] release branch.

Fixes: < Link to related issues that will be fixed by this pull request, if they exist >

PRs must be submitted under the terms of our Contributor License Agreement CLA.

@kiryldz kiryldz added the bug 🪲 Something isn't working label Aug 11, 2022
@kiryldz
kiryldz requested a review from a team as a code owner August 11, 2022 08:26
@kiryldz kiryldz self-assigned this Aug 11, 2022
Comment thread sdk/src/main/java/com/mapbox/maps/MapSurface.kt
@kiryldz
kiryldz force-pushed the MAPSAND-368-gestures-dont-work-as-expected-in-map-surface-activity branch from 14d900d to ff9be72 Compare August 11, 2022 08:45
@kiryldz
kiryldz merged commit 3c117f3 into main Aug 11, 2022
@kiryldz
kiryldz deleted the MAPSAND-368-gestures-dont-work-as-expected-in-map-surface-activity branch August 11, 2022 09:19
mapbox-github-ci-writer-public-1 Bot pushed a commit that referenced this pull request Mar 28, 2023
Co-authored-by: root <root@4bc29afcb2c1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants