diff options
| author | Claude <noreply@anthropic.com> | 2026-04-22 09:02:46 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-04-22 09:02:46 +0000 |
| commit | e141e1ef46ebb2a61f452122201a77527a5a1c9e (patch) | |
| tree | 3f19528a27b243a5574e7b7ed6d629db9f0b6cb8 /android-app/app/src/main/res | |
| parent | ce555a54b47c5bbb8df3eb9dd9ac69bd6a65be24 (diff) | |
fix+feat: CI build fixes and hardware source feature flags
CI fixes:
- ParticleWindView: bounds.lonEast → bounds.northEast.longitude
(MapLibre 13.x API; lonEast not available as property)
- VesselRegistryFragment: Vessel(id="") and CrewMember(id="") →
include required name="" so copy() compiles
Hardware source feature flags:
- HardwareSource enum: AIS_RECEIVER, NMEA_INSTRUMENTS
- FeatureFlags: SharedPreferences-backed; all sources default OFF
(app works phone-only out of the box)
- NavApplication: exposes featureFlags singleton
- SafetyFragment: "HARDWARE DATA SOURCES" card with two MaterialSwitch
toggles; reads initial state from FeatureFlags; calls
SafetyListener.onHardwareSourceChanged on change
- AIS_RECEIVER flag:
- MainViewModel.processAisSentence() / refreshAisFromInternet() skip
when disabled; onHardwareSourceChanged() clears targets + cpaAlerts
- NMEA_INSTRUMENTS flag:
- LocationService skips nmeaStreamManager.start() on service launch
when disabled
- New ACTION_START_NMEA / ACTION_STOP_NMEA intents allow live toggle
- MainActivity.onHardwareSourceChanged() sends the appropriate intent
Tests: 102 total, all GREEN (+7 FeatureFlagsTest)
https://claude.ai/code/session_011h2dXbgXg3PesQMmQUNTCW
Diffstat (limited to 'android-app/app/src/main/res')
| -rw-r--r-- | android-app/app/src/main/res/layout/fragment_safety.xml | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/android-app/app/src/main/res/layout/fragment_safety.xml b/android-app/app/src/main/res/layout/fragment_safety.xml index c270d1f..806598e 100644 --- a/android-app/app/src/main/res/layout/fragment_safety.xml +++ b/android-app/app/src/main/res/layout/fragment_safety.xml @@ -139,4 +139,111 @@ </com.google.android.material.card.MaterialCardView> + <!-- Hardware Data Sources --> + <com.google.android.material.card.MaterialCardView + android:id="@+id/card_data_sources" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + app:cardCornerRadius="16dp" + app:layout_constraintTop_toBottomOf="@id/card_anchor"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="16dp"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="HARDWARE DATA SOURCES" + android:textStyle="bold" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="4dp" + android:layout_marginBottom="12dp" + android:text="Enable only the hardware you have connected" + android:textSize="12sp" + android:textColor="?attr/colorOnSurfaceVariant" /> + + <!-- AIS Receiver row --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical" + 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="AIS Receiver" + android:textSize="15sp" + android:textColor="?attr/colorOnSurface" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Vessel tracking, collision alerts" + android:textSize="12sp" + android:textColor="?attr/colorOnSurfaceVariant" /> + + </LinearLayout> + + <com.google.android.material.materialswitch.MaterialSwitch + android:id="@+id/switch_ais" + android:layout_width="wrap_content" + android:layout_height="wrap_content" /> + + </LinearLayout> + + <!-- NMEA Instruments row --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + + <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="NMEA Instruments" + android:textSize="15sp" + android:textColor="?attr/colorOnSurface" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Wind, depth, boat speed" + android:textSize="12sp" + android:textColor="?attr/colorOnSurfaceVariant" /> + + </LinearLayout> + + <com.google.android.material.materialswitch.MaterialSwitch + android:id="@+id/switch_nmea" + android:layout_width="wrap_content" + android:layout_height="wrap_content" /> + + </LinearLayout> + + </LinearLayout> + + </com.google.android.material.card.MaterialCardView> + </androidx.constraintlayout.widget.ConstraintLayout> |
