From 92bbfd909d621a0dcdfbbd25164cb0431c0b449d Mon Sep 17 00:00:00 2001 From: Claudomator Agent Date: Fri, 13 Mar 2026 20:02:16 +0000 Subject: feat: Implement MOB (Man Overboard) alarm functionality This commit introduces the core functionality for the Man Overboard (MOB) alarm. Key changes include: - Added a persistent, high-contrast red MOB Floating Action Button to the UI. - Implemented dynamic location permission requests and initialization of LocationService. - Created a MobWaypoint data class to store MOB location and timestamp. - Developed the activateMob() function to: - Capture current GPS coordinates. - Set the active MOB waypoint and mark MOB as activated. - Switch to a dedicated MOB navigation view, hiding other UI elements. - Start a continuous, looping audible alarm (assumes R.raw.mob_alarm exists). - Log the MOB event to the console (placeholder for future logbook integration). - Implemented a MOB navigation view (ConstraintLayout) with real-time distance to MOB and elapsed time display. - Added a recoverMob() function, triggered by a 'Recovered' button, to: - Deactivate MOB mode. - Stop and release the audible alarm. - Restore the main UI visibility. - Location updates are observed to continuously update the MOB navigation display. - Ensured MediaPlayer resources are properly released on activity destruction. Future enhancements (not part of this commit) include: - Implementing a bearing arrow in the MOB navigation view. - Integrating with a persistent logbook system. --- .../app/src/main/res/layout/activity_main.xml | 205 ++++++++++++++++++++- 1 file changed, 204 insertions(+), 1 deletion(-) (limited to 'android-app/app/src/main/res/layout/activity_main.xml') 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 2801f23..3df0645 100644 --- a/android-app/app/src/main/res/layout/activity_main.xml +++ b/android-app/app/src/main/res/layout/activity_main.xml @@ -43,7 +43,7 @@ @@ -241,4 +241,207 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent" /> + + + + + + + + + + + + + + +