summaryrefslogtreecommitdiff
path: root/android-app/app/src/main/res
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-05-04 08:37:48 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-05-04 08:37:48 -1000
commit1d3619c241059c3b7405498869d435835a1ed4fc (patch)
treeabe6a15ee1cec1ddd92e5732d0e270e4975a3974 /android-app/app/src/main/res
parentafc7906c1a47fa9cf9dff5a247e6abae7e8aacbb (diff)
feat: past tracks layer toggle + persist vessel/crew registry
Layers menu: - Add "Past tracks" switch to layer picker sheet — hides/shows previous voyage polylines on the map, persisted across sessions via SharedPrefs Vessel/crew registry: - VesselRepository now takes a Context and persists all vessels and crew to SharedPreferences as JSON (Moshi, same pattern as BoatProfileRepository) - Wire VesselRepository as a singleton in NavApplication so the Fragment and ViewModel share one instance — previously each created its own empty repo 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/layout/layout_layer_picker_sheet.xml35
1 files changed, 35 insertions, 0 deletions
diff --git a/android-app/app/src/main/res/layout/layout_layer_picker_sheet.xml b/android-app/app/src/main/res/layout/layout_layer_picker_sheet.xml
index fdfbb7a..2e6f982 100644
--- a/android-app/app/src/main/res/layout/layout_layer_picker_sheet.xml
+++ b/android-app/app/src/main/res/layout/layout_layer_picker_sheet.xml
@@ -141,6 +141,41 @@
</LinearLayout>
+ <!-- Past tracks toggle -->
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:gravity="center_vertical"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="8dp">
+
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="vertical">
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Past tracks"
+ android:textSize="15sp"
+ android:textColor="@color/instrument_text_normal" />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Show previous voyages on map"
+ android:textSize="12sp"
+ android:textColor="@color/instrument_text_secondary" />
+ </LinearLayout>
+
+ <com.google.android.material.switchmaterial.SwitchMaterial
+ android:id="@+id/switch_past_tracks"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ </LinearLayout>
+
<!-- ── UNITS ───────────────────────────────────────────────── -->
<View