diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-25 18:09:53 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-25 18:09:53 +0000 |
| commit | ca57e40adc0b89e7dc5409475f7510c0c188d715 (patch) | |
| tree | d1fd636e0bdd67e36870ae891ed55d7d764689cf /android-app/app/src/main/res | |
| parent | b5ab0c5236d7503dc002b7bf04e0e33b9c7ff9fa (diff) | |
feat(track): implement GPS track recording with map overlay
- TrackRepository + TrackPoint wired into MainViewModel:
isRecording/trackPoints StateFlows, startTrack/stopTrack/addGpsPoint
- MapHandler.updateTrackLayer(): lazily initialises a red LineLayer
and updates GeoJSON polyline from List<TrackPoint>
- fab_record_track FAB in activity_main.xml (top|end of bottom nav);
icon toggles between ic_track_record and ic_close while recording
- MainActivity feeds every GPS fix into viewModel.addGpsPoint() and
observes trackPoints to redraw the polyline in real time
- ic_track_record.xml vector drawable (red record dot)
- 8 TrackRepositoryTest tests all GREEN
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'android-app/app/src/main/res')
| -rw-r--r-- | android-app/app/src/main/res/drawable/ic_track_record.xml | 17 | ||||
| -rw-r--r-- | android-app/app/src/main/res/layout/activity_main.xml | 13 |
2 files changed, 30 insertions, 0 deletions
diff --git a/android-app/app/src/main/res/drawable/ic_track_record.xml b/android-app/app/src/main/res/drawable/ic_track_record.xml new file mode 100644 index 0000000..9016369 --- /dev/null +++ b/android-app/app/src/main/res/drawable/ic_track_record.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <!-- Outer ring --> + <path + android:fillColor="#00000000" + android:strokeColor="@android:color/white" + android:strokeWidth="2" + android:pathData="M12,12m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"/> + <!-- Filled red dot --> + <path + android:fillColor="#E53935" + android:pathData="M12,12m-6,0a6,6 0,1 1,12 0a6,6 0,1 1,-12 0"/> +</vector> diff --git a/android-app/app/src/main/res/layout/activity_main.xml b/android-app/app/src/main/res/layout/activity_main.xml index 66d1abe..552bf99 100644 --- a/android-app/app/src/main/res/layout/activity_main.xml +++ b/android-app/app/src/main/res/layout/activity_main.xml @@ -68,4 +68,17 @@ app:layout_anchor="@id/bottom_navigation" app:layout_anchorGravity="top|start" /> + <!-- Record Track Button --> + <com.google.android.material.floatingactionbutton.FloatingActionButton + android:id="@+id/fab_record_track" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:clickable="true" + android:focusable="true" + android:contentDescription="Record Track" + app:srcCompat="@drawable/ic_track_record" + app:layout_anchor="@id/bottom_navigation" + app:layout_anchorGravity="top|end" /> + </androidx.coordinatorlayout.widget.CoordinatorLayout> |
