diff options
| author | Claude <noreply@anthropic.com> | 2026-04-09 09:39:20 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-04-09 09:39:20 +0000 |
| commit | e109271f563327e461191c7c2988243c75cd58ab (patch) | |
| tree | e8401f41bb7f96421175d242bee77245eb68c738 /android-app/app/src/main/res/layout/activity_main.xml | |
| parent | 3cddcd3b0a8719da5e828734a1d3054cef803235 (diff) | |
| parent | 5ee2dd8925afa858f466ae63db3f7df5c7516953 (diff) | |
merge: reconcile master particle-wind work with origin/main redesign
Merged divergent branches (common ancestor a9d87b6). Took origin/main
as base (layer manager, recenter, quit button, GPX tracks, marine
conditions, dark theme, user position layer, active/past track layers)
and layered in particle wind simulation work:
- MapHandler: added setupWindLayer, updateWindLayer, updateWindGridLayer;
kept their user-pos layer, follow/recenter state, active+past tracks
- WeatherRepository: kept their fetchCurrentConditions, added fetchWindGrid
- MainViewModel: kept their track/marine/summary changes, added windGrid
StateFlow, loadWindGrid, buildGrid
- MainActivity: kept their full UI (layer picker, quit, recenter, fade
animations), added particleWindView wiring, weatherLoaded guard,
windArrow/windGrid observers
- activity_main.xml: took their LinearLayout redesign, added ParticleWindView
overlay inside ConstraintLayout
https://claude.ai/code/session_01HXPjBsogsJVRwCiekDGkJX
Diffstat (limited to 'android-app/app/src/main/res/layout/activity_main.xml')
| -rw-r--r-- | android-app/app/src/main/res/layout/activity_main.xml | 174 |
1 files changed, 108 insertions, 66 deletions
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 feeb43d..1741c62 100644 --- a/android-app/app/src/main/res/layout/activity_main.xml +++ b/android-app/app/src/main/res/layout/activity_main.xml @@ -1,91 +1,133 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:orientation="vertical" tools:context=".MainActivity"> - <!-- Main Content Area --> - <androidx.constraintlayout.widget.ConstraintLayout + <androidx.coordinatorlayout.widget.CoordinatorLayout android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_marginBottom="56dp"> <!-- Space for BottomNav --> + android:layout_height="0dp" + android:layout_weight="1"> - <org.maplibre.android.maps.MapView - android:id="@+id/mapView" + <!-- Main Content Area --> + <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="match_parent"> - <org.terst.nav.ui.map.ParticleWindView - android:id="@+id/particle_wind_view" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:clickable="false" - android:focusable="false" /> + <org.maplibre.android.maps.MapView + android:id="@+id/mapView" + android:layout_width="match_parent" + android:layout_height="match_parent" /> - <!-- Overlay Fragment Container (for Log, Safety, Help) --> - <FrameLayout - android:id="@+id/fragment_container" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:visibility="gone" - android:background="?attr/colorSurface" /> + <org.terst.nav.ui.map.ParticleWindView + android:id="@+id/particle_wind_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:clickable="false" + android:focusable="false" /> - </androidx.constraintlayout.widget.ConstraintLayout> + <!-- Overlay Fragment Container (for Log, Safety, Help) --> + <FrameLayout + android:id="@+id/fragment_container" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:visibility="gone" + android:background="?attr/colorSurface" /> - <!-- Collapsible Instrument Bottom Sheet --> - <androidx.cardview.widget.CardView - android:id="@+id/instrument_bottom_sheet" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:behavior_hideable="false" - app:behavior_peekHeight="120dp" - app:cardElevation="16dp" - app:cardCornerRadius="24dp" - app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> - - <include - layout="@layout/layout_instruments_sheet" + <!-- Quit button — stops all services and exits --> + <com.google.android.material.button.MaterialButton + android:id="@+id/btn_quit" + style="@style/Widget.Material3.Button.IconButton.Filled.Tonal" + android:layout_width="40dp" + android:layout_height="40dp" + android:alpha="0.7" + app:icon="@drawable/ic_close" + app:iconSize="18dp" + app:iconGravity="textStart" + app:iconPadding="0dp" + app:cornerRadius="20dp" + app:elevation="4dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintEnd_toEndOf="parent" + android:layout_marginTop="16dp" + android:layout_marginEnd="16dp" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/fab_recenter" + android:layout_width="wrap_content" + android:layout_height="40dp" + android:text="⊙ Recenter" + android:textSize="13sp" + android:paddingStart="20dp" + android:paddingEnd="20dp" + android:visibility="gone" + app:cornerRadius="20dp" + app:elevation="20dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + android:layout_marginBottom="24dp" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <!-- Collapsible Instrument Bottom Sheet --> + <androidx.cardview.widget.CardView + android:id="@+id/instrument_bottom_sheet" android:layout_width="match_parent" - android:layout_height="wrap_content" /> + android:layout_height="wrap_content" + app:behavior_hideable="false" + app:behavior_peekHeight="120dp" + app:cardElevation="16dp" + app:cardCornerRadius="24dp" + app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> - </androidx.cardview.widget.CardView> + <include + layout="@layout/layout_instruments_sheet" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + </androidx.cardview.widget.CardView> + + <!-- Persistent MOB Button (Crucial for safety, always on top) --> + <com.google.android.material.floatingactionbutton.FloatingActionButton + android:id="@+id/fab_mob" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:clickable="true" + android:focusable="true" + android:contentDescription="Man Overboard" + app:srcCompat="@android:drawable/ic_dialog_alert" + app:backgroundTint="@color/mob_button_background" + app:elevation="20dp" + app:layout_anchor="@id/instrument_bottom_sheet" + app:layout_anchorGravity="top|start" /> + + <!-- Record Track Button --> + <com.google.android.material.floatingactionbutton.FloatingActionButton + android:id="@+id/fab_record_track" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:clickable="true" + android:focusable="true" + android:contentDescription="Record Track" + app:srcCompat="@drawable/ic_track_record" + app:elevation="20dp" + app:layout_anchor="@id/instrument_bottom_sheet" + app:layout_anchorGravity="top|end" /> + + </androidx.coordinatorlayout.widget.CoordinatorLayout> <!-- Bottom Navigation --> <com.google.android.material.bottomnavigation.BottomNavigationView android:id="@+id/bottom_navigation" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="bottom" android:background="?attr/colorSurface" app:menu="@menu/bottom_nav_menu" /> - <!-- Persistent MOB Button (Crucial for safety, always on top) --> - <com.google.android.material.floatingactionbutton.FloatingActionButton - android:id="@+id/fab_mob" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="16dp" - android:clickable="true" - android:focusable="true" - android:contentDescription="Man Overboard" - app:srcCompat="@android:drawable/ic_dialog_alert" - app:backgroundTint="@color/mob_button_background" - app:layout_anchor="@id/instrument_bottom_sheet" - app:layout_anchorGravity="top|start" /> - - <!-- Record Track Button --> - <com.google.android.material.floatingactionbutton.FloatingActionButton - android:id="@+id/fab_record_track" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="16dp" - android:clickable="true" - android:focusable="true" - android:contentDescription="Record Track" - app:srcCompat="@drawable/ic_track_record" - app:layout_anchor="@id/instrument_bottom_sheet" - app:layout_anchorGravity="top|end" /> - -</androidx.coordinatorlayout.widget.CoordinatorLayout> +</LinearLayout> |
