diff options
| author | Claude <noreply@anthropic.com> | 2026-04-22 05:35:49 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-04-22 05:35:49 +0000 |
| commit | eeafe2f0f3a3718bd52e9c333894e1abbc0611ab (patch) | |
| tree | 68ba329f0cadd64333fb5d72587f684fc38a500a /android-app/app/src/main/res/layout | |
| parent | 3cddcd3b0a8719da5e828734a1d3054cef803235 (diff) | |
feat: vessel registry, crew management, and thermal alarm
- Vessel/CrewMember data classes with full profile fields
(MMSI, callsign, flag, home port, hull type, dimensions, roles)
- VesselRepository: in-memory CRUD for own vessel, fleet, and crew;
getOwnVessel(), getSkipper(), getCrewByRole() helpers
- VesselRegistryFragment: own-vessel card + crew list + known-vessels
list; AlertDialog editors for add/edit; long-press to delete
- ic_vessel.xml sailboat icon; 5th bottom-nav tab "Vessel"
- ThermalMonitor: thermalFlow() using Intent.ACTION_BATTERY_CHANGED
(battery °C) + PowerManager.OnThermalStatusChangedListener (API 29+);
ThermalState OK/WARM/HOT/CRITICAL with distinct-until-changed filter
- MainActivity: startThermalMonitoring() sounds mob_alarm + Toast on
HOT (≥45°C) and CRITICAL (≥50°C); auto-silences on OK/WARM
- MainViewModel: thermalState and thermalReading StateFlows
- 18 VesselRepositoryTest cases — all GREEN (test-runner)
- design.md: updated competitive matrix + feature implementation status
https://claude.ai/code/session_011h2dXbgXg3PesQMmQUNTCW
Diffstat (limited to 'android-app/app/src/main/res/layout')
| -rw-r--r-- | android-app/app/src/main/res/layout/fragment_vessel_registry.xml | 177 |
1 files changed, 177 insertions, 0 deletions
diff --git a/android-app/app/src/main/res/layout/fragment_vessel_registry.xml b/android-app/app/src/main/res/layout/fragment_vessel_registry.xml new file mode 100644 index 0000000..6b55fa6 --- /dev/null +++ b/android-app/app/src/main/res/layout/fragment_vessel_registry.xml @@ -0,0 +1,177 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.core.widget.NestedScrollView + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="?attr/colorSurface"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="24dp"> + + <!-- Title row --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + + <TextView + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="Vessel Registry" + android:textSize="24sp" + android:textStyle="bold" + android:textColor="?attr/colorOnSurface" /> + + </LinearLayout> + + <!-- OWN VESSEL card --> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="20dp" + android:layout_marginBottom="8dp" + android:text="OWN VESSEL" + android:textSize="12sp" + android:textStyle="bold" + android:letterSpacing="0.1" + android:textColor="?attr/colorPrimary" /> + + <com.google.android.material.card.MaterialCardView + android:id="@+id/card_own_vessel" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:cardCornerRadius="12dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="16dp"> + + <TextView + android:id="@+id/tv_own_vessel_name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="No vessel configured" + android:textSize="18sp" + android:textStyle="bold" + android:textColor="?attr/colorOnSurface" /> + + <TextView + android:id="@+id/tv_own_vessel_details" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="4dp" + android:text="" + android:textSize="14sp" + android:textColor="?attr/colorOnSurfaceVariant" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/button_edit_own_vessel" + style="@style/Widget.Material3.Button.TonalButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="12dp" + android:text="EDIT VESSEL" /> + + </LinearLayout> + + </com.google.android.material.card.MaterialCardView> + + <!-- CREW section --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical" + android:layout_marginTop="24dp" + android:layout_marginBottom="8dp"> + + <TextView + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="CREW" + android:textSize="12sp" + android:textStyle="bold" + android:letterSpacing="0.1" + android:textColor="?attr/colorPrimary" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/button_add_crew" + style="@style/Widget.Material3.Button.TextButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="+ ADD" /> + + </LinearLayout> + + <LinearLayout + android:id="@+id/crew_list_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" /> + + <TextView + android:id="@+id/tv_crew_empty" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:text="No crew members added yet." + android:textSize="14sp" + android:textColor="?attr/colorOnSurfaceVariant" + android:visibility="visible" /> + + <!-- FLEET section --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical" + android:layout_marginTop="24dp" + android:layout_marginBottom="8dp"> + + <TextView + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="KNOWN VESSELS" + android:textSize="12sp" + android:textStyle="bold" + android:letterSpacing="0.1" + android:textColor="?attr/colorPrimary" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/button_add_vessel" + style="@style/Widget.Material3.Button.TextButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="+ ADD" /> + + </LinearLayout> + + <LinearLayout + android:id="@+id/vessel_list_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" /> + + <TextView + android:id="@+id/tv_vessel_empty" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:text="No additional vessels recorded." + android:textSize="14sp" + android:textColor="?attr/colorOnSurfaceVariant" + android:visibility="visible" /> + + </LinearLayout> + +</androidx.core.widget.NestedScrollView> |
