Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapView does not handle Android Navigation Compose transitions smoothly #3070

Open
TonyGnk opened this issue Dec 6, 2024 · 0 comments
Open
Labels

Comments

@TonyGnk
Copy link

TonyGnk commented Dec 6, 2024

MapLibre Android Version

11.6.1

Android SDK Version

Android 14

Device

Google Pixel 9

What happened?

When integrating MapLibre with Android Navigation Compose, the default fade-in/fade-out transitions provided by Navigation Compose do not apply smoothly to the MapView. Instead, the map disappears and reappears abruptly, disrupting the user experience.

This issue occurs because MapView does not properly handle the lifecycle events triggered during these transitions. This behavior is inconsistent with other Compose-based UI elements, which handle transitions seamlessly.https://github.com/user-attachments/assets/0a69542b-27e7-4aa7-9a5a-5eb1df3b8ebb

Steps to reproduce

  1. Create a MapFragment to render a MapLibre map within a jetpack compose app.
  2. Set up Android Navigation Compose with default transition animations (fade-in/fade-out).
  3. Navigate between fragments or Composables that contain the MapLibre map.
  4. Observe the behavior during navigation transitions.

Clone the reproduction repository: https://github.com/TonyGnk/mapIssue.

Renderer

OpenGL (choose this if you are unsure)

Relevant log output

Additional context

Potential Cause:
The issue might be related to how MapView manages its lifecycle during transitions. Navigation Compose likely delays the disposal of a screen's UI for the duration of the fade-out animation, but MapView does not seem to respond correctly to these lifecycle changes.

Similar Issues:
The same issue has been reported to Ramani Maps.

@TonyGnk TonyGnk added the android label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant