diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-04-06 15:38:31 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-04-06 15:38:31 +0000 |
| commit | 59d31d8d6198d5a8c2c4ba17cf9ad1b42a7e2018 (patch) | |
| tree | 5825ecbcb8832b051f89ff97afd466d2c3950fba /android-app/app/src/main/res/layout | |
| parent | f9b8801eb52c48986eb0123e8758f7ab78736dec (diff) | |
feat(tracks): show summary sheet on track stop; 2-min minimum
TrackSummarySheet: bottom sheet showing distance (nm), duration,
max/avg speed, avg wind and waves (when available, waves in ft).
Only shown for tracks ≥ 2 minutes — shorter tracks are discarded silently.
MainViewModel: exposes trackSummary SharedFlow (replay=0) and trackStartMs.
MainActivity: observes flow, shows sheet after stopTrack completes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'android-app/app/src/main/res/layout')
| -rw-r--r-- | android-app/app/src/main/res/layout/layout_track_summary_sheet.xml | 199 |
1 files changed, 199 insertions, 0 deletions
diff --git a/android-app/app/src/main/res/layout/layout_track_summary_sheet.xml b/android-app/app/src/main/res/layout/layout_track_summary_sheet.xml new file mode 100644 index 0000000..a26b76e --- /dev/null +++ b/android-app/app/src/main/res/layout/layout_track_summary_sheet.xml @@ -0,0 +1,199 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingStart="24dp" + android:paddingEnd="24dp" + android:paddingBottom="32dp" + android:background="?attr/colorSurface"> + + <!-- Drag handle --> + <View + android:layout_width="36dp" + android:layout_height="4dp" + android:layout_gravity="center_horizontal" + android:layout_marginTop="12dp" + android:layout_marginBottom="20dp" + android:background="@color/md_theme_outline" /> + + <!-- Title --> + <TextView + android:id="@+id/summary_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="20dp" + android:textSize="13sp" + android:textAllCaps="true" + android:letterSpacing="0.12" + android:fontFamily="sans-serif-light" + android:textColor="@color/instrument_text_secondary" + tools:text="Track · 06 Apr 14:32" /> + + <!-- Distance + Duration row --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:layout_marginBottom="16dp"> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical"> + <TextView + style="@style/InstrumentLabel" + android:text="Distance" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/summary_distance" + style="@style/InstrumentPrimaryValue" + tools:text="12.3" /> + <TextView + style="@style/InstrumentUnit" + android:text="nm" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical"> + <TextView + style="@style/InstrumentLabel" + android:text="Duration" /> + <TextView + android:id="@+id/summary_duration" + style="@style/InstrumentPrimaryValue" + tools:text="2h 14m" /> + </LinearLayout> + + </LinearLayout> + + <!-- Speed row --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:layout_marginBottom="16dp"> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical"> + <TextView + style="@style/InstrumentLabel" + android:text="Max Speed" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/summary_max_sog" + style="@style/InstrumentPrimaryValue" + tools:text="8.1" /> + <TextView + style="@style/InstrumentUnit" + android:text="kt" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical"> + <TextView + style="@style/InstrumentLabel" + android:text="Avg Speed" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/summary_avg_sog" + style="@style/InstrumentPrimaryValue" + tools:text="5.5" /> + <TextView + style="@style/InstrumentUnit" + android:text="kt" /> + </LinearLayout> + </LinearLayout> + + </LinearLayout> + + <!-- Wind + Waves row (conditionally visible) --> + <LinearLayout + android:id="@+id/summary_conditions_row" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:visibility="gone" + tools:visibility="visible"> + + <LinearLayout + android:id="@+id/summary_wind_cell" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical" + android:visibility="gone" + tools:visibility="visible"> + <TextView + style="@style/InstrumentLabel" + android:text="Avg Wind" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/summary_avg_wind" + style="@style/InstrumentPrimaryValue" + tools:text="14" /> + <TextView + style="@style/InstrumentUnit" + android:text="kt" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:id="@+id/summary_wave_cell" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical" + android:visibility="gone" + tools:visibility="visible"> + <TextView + style="@style/InstrumentLabel" + android:text="Avg Waves" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/summary_avg_wave" + style="@style/InstrumentPrimaryValue" + tools:text="2.1" /> + <TextView + style="@style/InstrumentUnit" + android:text="ft" /> + </LinearLayout> + </LinearLayout> + + </LinearLayout> + +</LinearLayout> |
