Skip to content

feat(workout-ui): tabs with swipe for lap/chart, taller scan list, km chart markers - #30

Merged
duhow merged 4 commits into
mainfrom
copilot/local-agent-ponytail
Jul 26, 2026
Merged

duhow merged 4 commits into
mainfrom
copilot/local-agent-ponytail

Conversation

Copilot AI commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

The running-session card jumps when switching lap/graph views because the two views differ in height, the Bluetooth scan list is capped at ~6 devices despite free screen space, and the live chart gives no distance cues.

Stable lap/chart switching via tabs + swipe

  • Replaced the MaterialButtonToggleGroup below the cards with a Material TabLayout above the card (portrait + landscape) — no new dependency.
  • Wrapped lapSection and chartSection in a FrameLayout; the inactive card is now INVISIBLE instead of GONE, so the container always measures to the tallest view and the rectangle keeps a constant top/height.
  • Added a horizontal fling detector to switch views (swipe left → chart, right → lap). Distance + velocity thresholds keep the chart's slow tooltip drag working.

Bluetooth scan list uses available space

  • ScrollView now uses fillViewport; rvScanResults switched from fixed height (220dp / 160dp landscape) to layout_weight="1", keeping the old height as minHeight. The list grows to fill remaining space while the Start button stays at the bottom.

Kilometre markers in live chart

  • MainActivity records the chart point index each time a full km is completed (persisted across rotation like the other live-chart state).
  • LineChartView draws a labelled vertical line per marker:
val kmCount = sample.totalDistanceM / 1000
while (liveKmMarkIndices.size < kmCount) liveKmMarkIndices.add(liveSpeedPoints.size - 1)
// ...
binding.liveChart.setData(*seriesList.toTypedArray(), durationSec = durationSec,
    kmMarkIndices = liveKmMarkIndices.toList())

Also updated changelog 6.txt. Note: btnViewLap/btnViewChart ids changed type (MaterialButton → TabItem) consistently in both layout configurations for view binding.

Copilot finished work on behalf of duhow July 26, 2026 10:41
@github-actions

Copy link
Copy Markdown
Contributor

✅ Debug APK artifact is ready for commit d0416f4 .
💾 Download APK artifact here.
Workflow run: https://github.com/duhow/ftms-bridge/actions/runs/30207211748

@duhow
duhow marked this pull request as ready for review July 26, 2026 15:33
@duhow
duhow merged commit 66fb645 into main Jul 26, 2026
1 check passed
@duhow
duhow deleted the copilot/local-agent-ponytail branch July 26, 2026 15:33
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