diff options
| author | Claude <noreply@anthropic.com> | 2026-04-10 09:30:55 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-04-10 09:30:55 +0000 |
| commit | 4daf9dfcd00844075768e5b0d1dd7a17002a26d0 (patch) | |
| tree | cf1f01bfd64ddc8fc06a469e126df7b4ab1f9e39 /android-app/app/src/main/res | |
| parent | 12c6193c6d4f666425962e0bd1804358570465f6 (diff) | |
Area conditions HUD redesign: map-center conditions refresh + boat HUD strip
- Persistent top-of-map HUD strip (SOG/COG/BSP/Depth) replaces instrument grid in bottom sheet
- Bottom sheet now shows area conditions only (Wind/Temp/Baro + wave forecast) — always visible
- loadConditions() fires on every camera idle event so panning the map refreshes conditions
- Crosshair appears at map center while panning; hides when following GPS
- Added tempC field to MarineConditions (already fetched from Open-Meteo hourly)
- InstrumentHandler slimmed to area conditions only; updateDisplay() removed
- LocationService pipes nmeaBoatSpeedData from NmeaStreamManager to companion flow
https://claude.ai/code/session_01HXPjBsogsJVRwCiekDGkJX
Diffstat (limited to 'android-app/app/src/main/res')
4 files changed, 237 insertions, 163 deletions
diff --git a/android-app/app/src/main/res/drawable/ic_crosshair.xml b/android-app/app/src/main/res/drawable/ic_crosshair.xml new file mode 100644 index 0000000..609538e --- /dev/null +++ b/android-app/app/src/main/res/drawable/ic_crosshair.xml @@ -0,0 +1,28 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="32dp" + android:height="32dp" + android:viewportWidth="32" + android:viewportHeight="32"> + + <!-- Horizontal line --> + <path + android:pathData="M2,16 L13,16 M19,16 L30,16" + android:strokeColor="#CCFFFFFF" + android:strokeWidth="1.5" + android:strokeLineCap="round" /> + + <!-- Vertical line --> + <path + android:pathData="M16,2 L16,13 M16,19 L16,30" + android:strokeColor="#CCFFFFFF" + android:strokeWidth="1.5" + android:strokeLineCap="round" /> + + <!-- Center circle --> + <path + android:pathData="M16,16 m-2.5,0 a2.5,2.5 0 1,0 5,0 a2.5,2.5 0 1,0 -5,0" + android:strokeColor="#CCFFFFFF" + android:strokeWidth="1.5" + android:fillColor="#00000000" /> + +</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 1741c62..5147506 100644 --- a/android-app/app/src/main/res/layout/activity_main.xml +++ b/android-app/app/src/main/res/layout/activity_main.xml @@ -29,6 +29,30 @@ android:clickable="false" android:focusable="false" /> + <!-- Boat-instrument HUD strip — always on top of map --> + <include + android:id="@+id/nav_hud" + layout="@layout/layout_nav_hud" + android:layout_width="match_parent" + android:layout_height="48dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> + + <!-- Crosshair — visible when not following (panning) --> + <ImageView + android:id="@+id/map_crosshair" + android:layout_width="32dp" + android:layout_height="32dp" + android:src="@drawable/ic_crosshair" + android:visibility="gone" + android:clickable="false" + android:focusable="false" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> + <!-- Overlay Fragment Container (for Log, Safety, Help) --> <FrameLayout android:id="@+id/fragment_container" diff --git a/android-app/app/src/main/res/layout/layout_instruments_sheet.xml b/android-app/app/src/main/res/layout/layout_instruments_sheet.xml index 33a7bd9..faec826 100644 --- a/android-app/app/src/main/res/layout/layout_instruments_sheet.xml +++ b/android-app/app/src/main/res/layout/layout_instruments_sheet.xml @@ -24,113 +24,28 @@ app:layout_constraintEnd_toEndOf="parent" /> <!-- - 3×2 grid: AWS/HDG/BSP top row, TWS/COG/SOG bottom row. - Cells with direction: AWS, TWS (kts + unit + arrow inline) - HDG, COG (°-in-value + arrow inline) - Cells without: BSP, SOG (kts + unit, no arrow) + Area-conditions header row: Wind (kts + arrow) | Temp (°C) | Baro (hPa) + Always shows conditions for the current map center. --> - <androidx.gridlayout.widget.GridLayout - android:id="@+id/instrument_grid" + <LinearLayout + android:id="@+id/conditions_header" android:layout_width="match_parent" android:layout_height="wrap_content" + android:orientation="horizontal" android:layout_marginTop="12dp" - app:columnCount="3" - app:rowCount="2" app:layout_constraintTop_toBottomOf="@id/drag_handle" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"> - <!-- AWS --> - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - app:layout_columnWeight="1" - android:orientation="vertical" - android:gravity="center" - android:padding="8dp"> - <TextView style="@style/InstrumentLabel" android:text="AWS" /> - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:orientation="horizontal" - android:gravity="center_vertical"> - <TextView - android:id="@+id/value_aws" - style="@style/InstrumentPrimaryValue" - tools:text="18.2" /> - <TextView style="@style/InstrumentUnit" android:text="kts" /> - <org.terst.nav.ui.DirectionArrowView - android:id="@+id/arrow_aws" - android:layout_width="14dp" - android:layout_height="14dp" - android:layout_marginStart="3dp" - android:layout_marginBottom="3dp" - android:layout_gravity="bottom" /> - </LinearLayout> - </LinearLayout> - - <!-- HDG: ° is part of the value string --> - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - app:layout_columnWeight="1" - android:orientation="vertical" - android:gravity="center" - android:padding="8dp"> - <TextView style="@style/InstrumentLabel" android:text="HDG" /> - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:orientation="horizontal" - android:gravity="center_vertical"> - <TextView - android:id="@+id/value_hdg" - style="@style/InstrumentPrimaryValue" - tools:text="247°" /> - <org.terst.nav.ui.DirectionArrowView - android:id="@+id/arrow_hdg" - android:layout_width="14dp" - android:layout_height="14dp" - android:layout_marginStart="3dp" - android:layout_marginBottom="3dp" - android:layout_gravity="bottom" /> - </LinearLayout> - </LinearLayout> - - <!-- BSP: no direction --> + <!-- Wind --> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" - app:layout_columnWeight="1" - android:orientation="vertical" - android:gravity="center" - android:padding="8dp"> - <TextView style="@style/InstrumentLabel" android:text="BSP" /> - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:orientation="horizontal" - android:gravity="center_vertical"> - <TextView - android:id="@+id/value_bsp" - style="@style/InstrumentPrimaryValue" - tools:text="6.8" /> - <TextView style="@style/InstrumentUnit" android:text="kts" /> - </LinearLayout> - </LinearLayout> - - <!-- TWS --> - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - app:layout_columnWeight="1" + android:layout_weight="1" android:orientation="vertical" android:gravity="center" android:padding="8dp"> - <TextView style="@style/InstrumentLabel" android:text="TWS" /> + <TextView style="@style/InstrumentLabel" android:text="Wind" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -150,73 +65,18 @@ android:layout_marginBottom="3dp" android:layout_gravity="bottom" /> </LinearLayout> + <TextView + android:id="@+id/bearing_tws" + style="@style/InstrumentLabel" + tools:text="270°" /> </LinearLayout> - <!-- COG: ° is part of the value string --> - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - app:layout_columnWeight="1" - android:orientation="vertical" - android:gravity="center" - android:padding="8dp"> - <TextView style="@style/InstrumentLabel" android:text="COG" /> - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:orientation="horizontal" - android:gravity="center_vertical"> - <TextView - android:id="@+id/value_cog" - style="@style/InstrumentPrimaryValue" - tools:text="253°" /> - <org.terst.nav.ui.DirectionArrowView - android:id="@+id/arrow_cog" - android:layout_width="14dp" - android:layout_height="14dp" - android:layout_marginStart="3dp" - android:layout_marginBottom="3dp" - android:layout_gravity="bottom" /> - </LinearLayout> - </LinearLayout> - - <!-- SOG: no direction --> - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - app:layout_columnWeight="1" - android:orientation="vertical" - android:gravity="center" - android:padding="8dp"> - <TextView style="@style/InstrumentLabel" android:text="SOG" /> - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:orientation="horizontal" - android:gravity="center_vertical"> - <TextView - android:id="@+id/value_sog" - style="@style/InstrumentPrimaryValue" - tools:text="7.1" /> - <TextView style="@style/InstrumentUnit" android:text="kts" /> - </LinearLayout> - </LinearLayout> - - </androidx.gridlayout.widget.GridLayout> - - <!-- Depth + Baro side by side --> - <LinearLayout - android:id="@+id/expanded_instruments" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:layout_marginTop="4dp" - app:layout_constraintTop_toBottomOf="@id/instrument_grid" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent"> + <View + android:layout_width="1dp" + android:layout_height="match_parent" + android:background="@color/md_theme_outline" /> + <!-- Temp --> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" @@ -224,7 +84,7 @@ android:orientation="vertical" android:gravity="center" android:padding="8dp"> - <TextView style="@style/InstrumentLabel" android:text="Depth" /> + <TextView style="@style/InstrumentLabel" android:text="Temp" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -232,18 +92,19 @@ android:orientation="horizontal" android:gravity="center_vertical"> <TextView - android:id="@+id/value_depth" + android:id="@+id/value_temp" style="@style/InstrumentPrimaryValue" - tools:text="42.0" /> - <TextView style="@style/InstrumentUnit" android:text="ft" /> + tools:text="18" /> + <TextView style="@style/InstrumentUnit" android:text="°C" /> </LinearLayout> </LinearLayout> <View android:layout_width="1dp" android:layout_height="match_parent" - android:background="#2B2930" /> + android:background="@color/md_theme_outline" /> + <!-- Baro --> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" @@ -275,7 +136,7 @@ android:layout_height="72dp" android:layout_marginStart="-16dp" android:layout_marginEnd="-16dp" - app:layout_constraintTop_toBottomOf="@id/expanded_instruments" + app:layout_constraintTop_toBottomOf="@id/conditions_header" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" /> diff --git a/android-app/app/src/main/res/layout/layout_nav_hud.xml b/android-app/app/src/main/res/layout/layout_nav_hud.xml new file mode 100644 index 0000000..4623bb1 --- /dev/null +++ b/android-app/app/src/main/res/layout/layout_nav_hud.xml @@ -0,0 +1,161 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Persistent boat-instrument HUD strip. + Lives at the top of the map; always visible; shows dashes when NMEA unavailable. + Fields: SOG | COG | BSP | Depth +--> +<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="48dp" + android:orientation="horizontal" + android:background="#CC000000"> + + <!-- SOG --> + <LinearLayout + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="1" + android:orientation="vertical" + android:gravity="center"> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="SOG" + android:textSize="9sp" + android:textColor="#99FFFFFF" + android:letterSpacing="0.08" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/hud_sog" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="16sp" + android:textColor="#FFFFFF" + android:fontFamily="sans-serif-medium" + tools:text="7.1" /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="kt" + android:textSize="10sp" + android:textColor="#99FFFFFF" + android:layout_marginStart="2dp" /> + </LinearLayout> + </LinearLayout> + + <View android:layout_width="1dp" android:layout_height="match_parent" android:background="#33FFFFFF" /> + + <!-- COG --> + <LinearLayout + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="1" + android:orientation="vertical" + android:gravity="center"> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="COG" + android:textSize="9sp" + android:textColor="#99FFFFFF" + android:letterSpacing="0.08" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/hud_cog" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="16sp" + android:textColor="#FFFFFF" + android:fontFamily="sans-serif-medium" + tools:text="253°" /> + </LinearLayout> + </LinearLayout> + + <View android:layout_width="1dp" android:layout_height="match_parent" android:background="#33FFFFFF" /> + + <!-- BSP --> + <LinearLayout + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="1" + android:orientation="vertical" + android:gravity="center"> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="BSP" + android:textSize="9sp" + android:textColor="#99FFFFFF" + android:letterSpacing="0.08" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/hud_bsp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="16sp" + android:textColor="#FFFFFF" + android:fontFamily="sans-serif-medium" + tools:text="6.8" /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="kt" + android:textSize="10sp" + android:textColor="#99FFFFFF" + android:layout_marginStart="2dp" /> + </LinearLayout> + </LinearLayout> + + <View android:layout_width="1dp" android:layout_height="match_parent" android:background="#33FFFFFF" /> + + <!-- Depth --> + <LinearLayout + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="1" + android:orientation="vertical" + android:gravity="center"> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Depth" + android:textSize="9sp" + android:textColor="#99FFFFFF" + android:letterSpacing="0.08" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/hud_depth" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="16sp" + android:textColor="#FFFFFF" + android:fontFamily="sans-serif-medium" + tools:text="42.0" /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="ft" + android:textSize="10sp" + android:textColor="#99FFFFFF" + android:layout_marginStart="2dp" /> + </LinearLayout> + </LinearLayout> + +</LinearLayout> |
