Skip to content

Android: Use dynamic screen-based padding again for navigation camera #885

Merged
ianthetechie merged 3 commits into
stadiamaps:mainfrom
klemensz:fix/compose-navigation-camera-padding
May 27, 2026
Merged

Android: Use dynamic screen-based padding again for navigation camera #885
ianthetechie merged 3 commits into
stadiamaps:mainfrom
klemensz:fix/compose-navigation-camera-padding

Conversation

@klemensz

@klemensz klemensz commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

During the maplibre-compose migration (#853) relative values (0.5) for padding were replaced with hard coded Dp value. I changed this to relative values again.

It could be observed in these screen captures for example, that the 3D navigation puck is too far away from the bottom elements (before and after migration).

Bildschirmfoto 2026-04-29 um 10 26 37

Changes

Updates the Android MapLibre navigation camera padding to use dynamic, screen-based values again instead of fixed Dp offsets introduced during the maplibre-compose migration.

  • Calculates navigation camera padding from the current screen width/height.
  • Restores landscape behavior by shifting the camera target based on screen width.
  • Adjusts bottom camera padding while navigating so the target remains visible above bottom UI insets.
  • Applies the effective camera options across portrait, landscape, and dynamically orienting navigation views.

@klemensz klemensz changed the title Use dynamic screen-based padding again for navigation camera Android: Use dynamic screen-based padding again for navigation camera Apr 28, 2026

@Archdoog Archdoog left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me. Will let @ianthetechie decide how he wants to get all this merged 👍

@klemensz

Copy link
Copy Markdown
Contributor Author

Conflicts are resolved now.

@ianthetechie

Copy link
Copy Markdown
Contributor

Looks good; thanks! Probably worth a follow-up at some point to automatically take the navigation use case into account (e.g. bike vs pedestrian vs car).

We have a somewhat badly named issue #196 that hints at a broader project of optimizing the display per use.

@ianthetechie
ianthetechie merged commit d1fa445 into stadiamaps:main May 27, 2026
14 checks passed
@klemensz
klemensz deleted the fix/compose-navigation-camera-padding branch June 1, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants