Skip to content

Restyle the selected route-stop circle (bullseye)#1935

Merged
bmander merged 2 commits into
mainfrom
feature/selected-stop-circle-styling
Jul 17, 2026
Merged

Restyle the selected route-stop circle (bullseye)#1935
bmander merged 2 commits into
mainfrom
feature/selected-stop-circle-styling

Conversation

@bmander

@bmander bmander commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Reworks how a selected/focused route-stop circle (the "bullseye") looks on the map, now that tapping a stop drops straight into the route-focus view. Applies to both the Google and MapLibre map flavors.

  • Orange fill for the selected circle instead of white — the annulus between the center dot and the outer ring uses the shared map_stop_focus highlight. The center dot is the outline color.
  • Theme-aware route-stop circle colors via new resources:
    • route_stop_fill — white (light) / near-black #4D4D4D (dark)
    • route_stop_outline — dark-gray #616161 (light) / white (dark)
    • map_stop_focus (selected fill, shared with the selected pin markers) — lighter #FFA726 (light) / deeper #FB8C00 (dark)
  • Larger selected circle (FOCUSED_SCALE 1.8) whose ring keeps the same on-screen weight as every other stop — the selection scale is divided back out of the stroke on both platforms.
  • Thinner base ring (STROKE_WIDTH_PX 2.7) and a larger center dot (INNER_RADIUS_SCALE 0.36).

Implementation notes

  • The three circle colors are theme-aware resources resolved from a Context in each renderer (GoogleMapRenderer, MapLibreRenderer) and passed into the circle layers — the pure RouteStopCircles styling object has no Context. HomeActivity recreates on a light↔dark switch (no uiMode in its configChanges), so there's no stale bitmap cache.
  • MapLibre gets separate base-radius feature properties so the GPU circleStrokeWidth ramp stays a constant weight while the selected circle still scales up.

Testing

  • Compiles clean on obaGoogleDebug + obaMaplibreDebug under -PwarningsAsErrors=true.
  • Device-verified on a Pixel 7 Pro (Google flavor), light and dark mode.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added theme-aware route-stop colors for light and dark map modes.
    • Route stops now use configurable fill, focus, and outline/selected colors across supported map providers.
  • Visual Improvements

    • Updated stop marker sizing, focus scaling, and stroke proportions for clearer selection states.
    • Improved selection styling to keep ring/stroke weight consistent across zoom and selection.
  • Tests

    • Updated route-stop bitmap expectations to match the revised sizing/selection behavior.

Give the focused/selected route-stop circle a clearer, theme-aware look
now that selecting a stop drops straight into the route-focus (bullseye)
view:

- Selected circle fills orange (the shared map_stop_focus highlight)
  instead of white, with a smaller center dot in the outline color.
- Route-stop circle fill and outline are now theme-aware resources
  (route_stop_fill / route_stop_outline): white fill + dark-gray ring in
  light mode, near-black (#4D4D4D) fill + white ring in dark mode.
- Selected fill (map_stop_focus) is theme-aware too: lighter #FFA726 in
  light mode, deeper #FB8C00 in dark mode.
- The selected circle is enlarged (FOCUSED_SCALE 1.8) but its ring keeps
  the same on-screen weight as every other stop (the selection scale is
  divided back out of the stroke on both platforms).
- Thinner base ring (STROKE_WIDTH_PX 2.7) and larger center dot
  (INNER_RADIUS_SCALE 0.36).

Colors are resolved from Context in each renderer and passed into the
layers; HomeActivity recreates on a light<->dark switch so there is no
stale bitmap cache. Applied consistently to both the Google and MapLibre
map flavors.
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d5b949ee-7169-47ec-bffa-7d7f058d4099

📥 Commits

Reviewing files that changed from the base of the PR and between 714306c and b672fa3.

📒 Files selected for processing (1)
  • onebusaway-android/src/testGoogle/java/org/onebusaway/android/map/googlemapsv2/GoogleRouteStopBitmapLayerTest.kt

📝 Walkthrough

Walkthrough

Route-stop styling now uses light and dark theme resources instead of hardcoded colors. Google Maps bitmap markers and MapLibre circle layers receive themed colors, while radius and stroke calculations preserve selection and zoom behavior.

Changes

Route-stop styling

Layer / File(s) Summary
Theme resources and shared styling
onebusaway-android/src/main/java/.../RouteStopCircles.kt, onebusaway-android/src/main/res/values*/colors.xml
Shared sizing constants are adjusted, fixed color constants are removed, and light/dark route-stop colors are defined.
Google bitmap styling
onebusaway-android/src/google/java/.../GoogleRouteStopBitmapLayer.kt, onebusaway-android/src/google/java/.../GoogleMapRenderer.kt, onebusaway-android/src/testGoogle/java/.../GoogleRouteStopBitmapLayerTest.kt
Google route-stop bitmaps use supplied normal, selected, and outline colors, with selection-aware stroke sizing and updated selected-diameter expectations.
MapLibre circle styling
onebusaway-android/src/maplibre/java/.../MapLibreRouteStopCircleLayer.kt, onebusaway-android/src/maplibre/java/.../MapLibreRenderer.kt
MapLibre layers use themed color expressions and separate base-radius properties for stroke interpolation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ThemeResources
  participant GoogleMapRenderer
  participant GoogleRouteStopBitmapLayer
  participant MapLibreRenderer
  participant MapLibreRouteStopCircleLayer

  ThemeResources-->>GoogleMapRenderer: Provide route-stop colors
  GoogleMapRenderer->>GoogleRouteStopBitmapLayer: Pass fill, selected-fill, and outline colors
  GoogleRouteStopBitmapLayer->>GoogleRouteStopBitmapLayer: Draw selected or normal bitmap

  ThemeResources-->>MapLibreRenderer: Provide route-stop colors
  MapLibreRenderer->>MapLibreRouteStopCircleLayer: Pass fill, selected-fill, and outline colors
  MapLibreRouteStopCircleLayer->>MapLibreRouteStopCircleLayer: Build color and radius expressions
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: restyling the selected route-stop circle.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/selected-stop-circle-styling

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The selected route-stop circle now scales by FOCUSED_SCALE 1.8 (was 1.5),
so every `selected = true` expectation in the bitmap-diameter test was stale
and failing CI. Recompute them (they scale by 1.8/1.5 = 1.2): fixed selected
90 -> 108, and the ramp's selected samples 27 -> 32, 59 -> 70, 90 -> 108. The
`selected = false` values are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bmander
bmander merged commit c758ef7 into main Jul 17, 2026
3 checks passed
@bmander
bmander deleted the feature/selected-stop-circle-styling branch July 17, 2026 18:24
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.

1 participant