Skip to content

feat: full-screen route map with km markers and split highlight - #57

Open
ricaezejo wants to merge 15 commits into
sayed0am:mainfrom
ricaezejo:feat/fullscreen-route-map
Open

ricaezejo wants to merge 15 commits into
sayed0am:mainfrom
ricaezejo:feat/fullscreen-route-map

Conversation

@ricaezejo

@ricaezejo ricaezejo commented Nov 8, 2026 •

Copy link
Copy Markdown

Summary

Tapping the Route card on a finished GPS workout now opens the map full screen.

  • Full-screen map in a dialog over the page, so it also covers the nav rail and list pane on a wide or landscape screen. Route in heart-rate zone colours, pan and zoom, a Fit route pill after a pan, and a Route only toggle that makes no tile requests.
  • A numbered marker at the end of each whole kilometre. The markers are bitmaps, so they need no font download and work in Route only mode.
  • A split picker along the bottom (same rows as the Splits list). Picking a kilometre draws it with a white casing and zooms to it; picking it again clears it.
  • Route.legs is the single source of kilometres; Route.splits now delegates to it so markers, highlight and the Splits list cannot disagree.
  • The card's map gets a transparent click-catching overlay above the native map so the tap is not swallowed.

Where the map's state lives

Which workout's map is open, Route only and the selected split are kept in an activity-scoped RouteMapModel (ViewModel), and the dialog is hosted at page level. Not rememberSaveable:

  • State inside the dialog was lost on rotation (reproduced in FullScreenRouteMapRotationTest).
  • Showing the map in place kept state but filled only the page's pane in landscape.
  • rememberSaveable in the card failed too: portrait and landscape place the page at different positions in the layout tree, so each orientation kept its own copy and a stale one could bring a closed map back.

The dialog's entrance animation is turned off best-effort so a rotation doesn't replay it.

No new permissions or network use.

This is the lower PR of a stack; the GPX export PR builds on it.

Known limits

  • After a rotation the selected stretch is not refitted to the new screen shape; tapping the chip again refits.
  • A highlighted kilometre that spans a pause is drawn as one line.
  • Tapping a marker does nothing; the picker is how to select.

Test plan

  • ./gradlew :app:testDebugUnitTest :protocol:test :app:lintDebug detektMain. ktlintCheck reports findings across the repo (it is continue-on-error in CI).
  • On a device (Pixel, fake 2.77 km GPS run): the card tap opens the map and page scrolling works over the card; km markers and the split picker render; selecting a kilometre highlights it; Route only keeps markers and highlight.
  • Rotation on the device: portrait to landscape and back keeps the open map's split and Route only; landscape covers the whole screen; a closed map stays closed.
  • Not yet on a device: three-digit markers, a run under 1 km (only a "Last N m" chip), the Fit route pill after a pan, the OSM credit above the picker, the live workout map unchanged.

ricaezejo and others added 12 commits November 8, 2026 22:02
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… card

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…trait and landscape layouts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ricaezejo and others added 2 commits November 13, 2026 09:40
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ricaezejo
ricaezejo marked this pull request as ready for review November 13, 2026 09:00
*/
internal fun kmMarkerBitmap(km: Int, density: Float): Bitmap {
val size = (22 * density).toInt()
val bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants