diff options
Diffstat (limited to 'android-app/app/src/main/res/layout')
8 files changed, 1007 insertions, 126 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> diff --git a/android-app/app/src/main/res/layout/fragment_pretrip_report.xml b/android-app/app/src/main/res/layout/fragment_pretrip_report.xml new file mode 100644 index 0000000..d7ede49 --- /dev/null +++ b/android-app/app/src/main/res/layout/fragment_pretrip_report.xml @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="utf-8"?> +<ScrollView 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"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Pre-Trip Planning" + android:textSize="24sp" + android:textStyle="bold" + android:layout_marginBottom="16dp" /> + + <!-- Boat Config (Simple for now) --> + <com.google.android.material.card.MaterialCardView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="24dp" + app:cardCornerRadius="12dp" + app:strokeWidth="1dp" + app:strokeColor="?attr/colorOutlineVariant"> + + <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="Vessel Profile" + android:textStyle="bold" + android:layout_marginBottom="8dp" /> + + <TextView + android:id="@+id/tv_vessel_info" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="35ft Sloop (Monohull)" + android:textSize="14sp" /> + + </LinearLayout> + </com.google.android.material.card.MaterialCardView> + + <!-- Report Content --> + <com.google.android.material.card.MaterialCardView + android:id="@+id/card_report" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:visibility="gone" + app:cardCornerRadius="16dp" + app:cardElevation="4dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="20dp"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Weather Summary" + android:textStyle="bold" + android:textSize="18sp" + android:layout_marginBottom="8dp" /> + + <TextView + android:id="@+id/tv_weather_summary" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textSize="16sp" + android:layout_marginBottom="16dp" /> + + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:background="?attr/colorOutlineVariant" + android:layout_marginBottom="16dp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Routing Suggestion" + android:textStyle="bold" + android:textSize="18sp" + android:layout_marginBottom="8dp" /> + + <TextView + android:id="@+id/tv_routing_content" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textSize="16sp" + android:layout_marginBottom="16dp" /> + + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:background="?attr/colorOutlineVariant" + android:layout_marginBottom="16dp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Sail Plan" + android:textStyle="bold" + android:textSize="18sp" + android:layout_marginBottom="8dp" /> + + <TextView + android:id="@+id/tv_sail_plan_content" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textSize="16sp" /> + + </LinearLayout> + </com.google.android.material.card.MaterialCardView> + + <com.google.android.material.button.MaterialButton + android:id="@+id/btn_generate_pretrip" + android:layout_width="match_parent" + android:layout_height="60dp" + android:layout_marginTop="24dp" + android:text="GENERATE PRE-TRIP REPORT" /> + + <ProgressBar + android:id="@+id/progress_pretrip" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginTop="16dp" + android:visibility="gone" /> + + </LinearLayout> +</ScrollView> 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 5b2397e..f90420e 100644 --- a/android-app/app/src/main/res/layout/fragment_safety.xml +++ b/android-app/app/src/main/res/layout/fragment_safety.xml @@ -104,4 +104,13 @@ </com.google.android.material.card.MaterialCardView> + <com.google.android.material.button.MaterialButton + android:id="@+id/button_plan_trip" + style="@style/Widget.Material3.Button.TonalButton" + android:layout_width="match_parent" + android:layout_height="60dp" + android:layout_marginTop="24dp" + android:text="PLAN TRIP (PRE-TRIP REPORT)" + app:layout_constraintTop_toBottomOf="@id/card_anchor" /> + </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/android-app/app/src/main/res/layout/fragment_trip_report.xml b/android-app/app/src/main/res/layout/fragment_trip_report.xml new file mode 100644 index 0000000..1ce0bde --- /dev/null +++ b/android-app/app/src/main/res/layout/fragment_trip_report.xml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="utf-8"?> +<ScrollView 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"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Trip Narrative" + android:textSize="24sp" + android:textStyle="bold" + android:layout_marginBottom="16dp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Choose Narrative Style:" + android:textSize="14sp" + android:layout_marginBottom="8dp" /> + + <HorizontalScrollView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="24dp"> + + <com.google.android.material.chip.ChipGroup + android:id="@+id/chip_group_styles" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:singleSelection="true" + app:selectionRequired="true"> + + <com.google.android.material.chip.Chip + android:id="@+id/chip_professional" + style="@style/Widget.Material3.Chip.Filter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Professional" + android:checked="true" /> + + <com.google.android.material.chip.Chip + android:id="@+id/chip_adventurous" + style="@style/Widget.Material3.Chip.Filter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Adventurous" /> + + <com.google.android.material.chip.Chip + android:id="@+id/chip_journal" + style="@style/Widget.Material3.Chip.Filter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Journal" /> + + <com.google.android.material.chip.Chip + android:id="@+id/chip_pirate" + style="@style/Widget.Material3.Chip.Filter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Pirate" /> + + </com.google.android.material.chip.ChipGroup> + </HorizontalScrollView> + + <com.google.android.material.card.MaterialCardView + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:cardCornerRadius="16dp" + app:cardElevation="4dp" + app:strokeWidth="1dp" + app:strokeColor="?attr/colorOutlineVariant"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="16dp"> + + <TextView + android:id="@+id/tv_narrative_content" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="Generate a report to see your story..." + android:textSize="16sp" + android:lineSpacingExtra="4dp" /> + + </LinearLayout> + </com.google.android.material.card.MaterialCardView> + + <com.google.android.material.button.MaterialButton + android:id="@+id/btn_refresh_report" + android:layout_width="match_parent" + android:layout_height="60dp" + android:layout_marginTop="24dp" + android:text="REFRESH REPORT" /> + + <ProgressBar + android:id="@+id/progress_report" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginTop="16dp" + android:visibility="gone" /> + + </LinearLayout> +</ScrollView> diff --git a/android-app/app/src/main/res/layout/fragment_voice_log.xml b/android-app/app/src/main/res/layout/fragment_voice_log.xml index e5f864c..6d136be 100644 --- a/android-app/app/src/main/res/layout/fragment_voice_log.xml +++ b/android-app/app/src/main/res/layout/fragment_voice_log.xml @@ -63,4 +63,18 @@ android:text="" android:textSize="14sp" android:layout_marginTop="16dp" /> + + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:background="#DDDDDD" + android:layout_marginTop="32dp" + android:layout_marginBottom="32dp" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/btn_generate_report" + style="@style/Widget.Material3.Button.TonalButton" + android:layout_width="match_parent" + android:layout_height="60dp" + android:text="GENERATE TRIP REPORT" /> </LinearLayout> 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 0a84418..33a7bd9 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 @@ -1,32 +1,46 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.constraintlayout.widget.ConstraintLayout + 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="wrap_content" - android:padding="16dp" - android:background="?attr/colorSurface"> + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:paddingBottom="16dp" + android:background="?attr/colorSurface" + android:clickable="true" + android:focusable="true"> + <!-- Drag handle --> <View android:id="@+id/drag_handle" - android:layout_width="40dp" + android:layout_width="36dp" android:layout_height="4dp" + android:layout_marginTop="12dp" android:background="@color/md_theme_outline" app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" /> - <!-- Grid of Instruments --> + <!-- + 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) + --> <androidx.gridlayout.widget.GridLayout android:id="@+id/instrument_grid" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="16dp" + android:layout_marginTop="12dp" app:columnCount="3" - app:rowCount="3" - app:layout_constraintTop_toBottomOf="@id/drag_handle"> + app:rowCount="2" + app:layout_constraintTop_toBottomOf="@id/drag_handle" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> - <!-- Wind: AWS --> + <!-- AWS --> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" @@ -35,10 +49,28 @@ android:gravity="center" android:padding="8dp"> <TextView style="@style/InstrumentLabel" android:text="AWS" /> - <TextView android:id="@+id/value_aws" style="@style/InstrumentPrimaryValue" tools:text="12.5" /> + <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> - <!-- Compass: HDG --> + <!-- HDG: ° is part of the value string --> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" @@ -47,10 +79,27 @@ android:gravity="center" android:padding="8dp"> <TextView style="@style/InstrumentLabel" android:text="HDG" /> - <TextView android:id="@+id/value_hdg" style="@style/InstrumentPrimaryValue" tools:text="225" /> + <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> - <!-- Performance: BSP --> + <!-- BSP: no direction --> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" @@ -59,10 +108,21 @@ android:gravity="center" android:padding="8dp"> <TextView style="@style/InstrumentLabel" android:text="BSP" /> - <TextView android:id="@+id/value_bsp" style="@style/InstrumentPrimaryValue" tools:text="6.2" /> + <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> - <!-- Wind: TWS --> + <!-- TWS --> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" @@ -71,10 +131,28 @@ android:gravity="center" android:padding="8dp"> <TextView style="@style/InstrumentLabel" android:text="TWS" /> - <TextView android:id="@+id/value_tws" style="@style/InstrumentPrimaryValue" tools:text="15.0" /> + <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_tws" + style="@style/InstrumentPrimaryValue" + tools:text="15.5" /> + <TextView style="@style/InstrumentUnit" android:text="kts" /> + <org.terst.nav.ui.DirectionArrowView + android:id="@+id/arrow_tws" + android:layout_width="14dp" + android:layout_height="14dp" + android:layout_marginStart="3dp" + android:layout_marginBottom="3dp" + android:layout_gravity="bottom" /> + </LinearLayout> </LinearLayout> - <!-- Compass: COG --> + <!-- COG: ° is part of the value string --> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" @@ -83,10 +161,27 @@ android:gravity="center" android:padding="8dp"> <TextView style="@style/InstrumentLabel" android:text="COG" /> - <TextView android:id="@+id/value_cog" style="@style/InstrumentPrimaryValue" tools:text="230" /> + <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> - <!-- Performance: SOG --> + <!-- SOG: no direction --> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" @@ -95,72 +190,232 @@ android:gravity="center" android:padding="8dp"> <TextView style="@style/InstrumentLabel" android:text="SOG" /> - <TextView android:id="@+id/value_sog" style="@style/InstrumentPrimaryValue" tools:text="6.5" /> + <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> - <!-- VMG --> + </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"> + <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="VMG" /> - <TextView android:id="@+id/value_vmg" style="@style/InstrumentPrimaryValue" tools:text="4.2" /> + <TextView style="@style/InstrumentLabel" android:text="Depth" /> + <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_depth" + style="@style/InstrumentPrimaryValue" + tools:text="42.0" /> + <TextView style="@style/InstrumentUnit" android:text="ft" /> + </LinearLayout> </LinearLayout> - <!-- Depth --> + <View + android:layout_width="1dp" + android:layout_height="match_parent" + android:background="#2B2930" /> + <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="Depth" /> - <TextView android:id="@+id/value_depth" style="@style/InstrumentPrimaryValue" tools:text="12.0" /> + <TextView style="@style/InstrumentLabel" android:text="Baro" /> + <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_baro" + style="@style/InstrumentPrimaryValue" + tools:text="1013" /> + <TextView style="@style/InstrumentUnit" android:text="hPa" /> + </LinearLayout> + </LinearLayout> + + </LinearLayout> + + <!-- Animated wave divider --> + <org.terst.nav.ui.WaveView + android:id="@+id/wave_divider" + android:layout_width="match_parent" + android:layout_height="72dp" + android:layout_marginStart="-16dp" + android:layout_marginEnd="-16dp" + app:layout_constraintTop_toBottomOf="@id/expanded_instruments" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> + + <!-- Forecast section (ocean) --> + <LinearLayout + android:id="@+id/forecast_row" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:background="#0D2137" + android:paddingTop="14dp" + android:paddingBottom="20dp" + android:layout_marginStart="-16dp" + android:layout_marginEnd="-16dp" + app:layout_constraintTop_toBottomOf="@id/wave_divider" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toBottomOf="parent"> + + <!-- Current --> + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical" + android:gravity="center" + android:padding="4dp"> + <TextView style="@style/ForecastLabel" android:text="Current" /> + <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_curr_spd" + style="@style/ForecastValue" + tools:text="0.8" /> + <TextView style="@style/ForecastUnit" android:text="kts" /> + </LinearLayout> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:orientation="horizontal" + android:gravity="center_vertical" + android:layout_marginTop="4dp"> + <org.terst.nav.ui.DirectionArrowView + android:id="@+id/arrow_curr" + android:layout_width="14dp" + android:layout_height="14dp" /> + <TextView + android:id="@+id/bearing_curr" + style="@style/ForecastBearing" + tools:text="185°" /> + </LinearLayout> </LinearLayout> - <!-- Polar % --> + <!-- Waves --> <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="Polar %" /> - <TextView android:id="@+id/value_polar_pct" style="@style/InstrumentPrimaryValue" tools:text="95%" /> + android:padding="4dp"> + <TextView style="@style/ForecastLabel" android:text="Waves" /> + <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_wave_ht" + style="@style/ForecastValue" + tools:text="3.5" /> + <TextView style="@style/ForecastUnit" android:text="ft" /> + </LinearLayout> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:orientation="horizontal" + android:gravity="center_vertical" + android:layout_marginTop="4dp"> + <org.terst.nav.ui.DirectionArrowView + android:id="@+id/arrow_waves" + android:layout_width="14dp" + android:layout_height="14dp" /> + <TextView + android:id="@+id/bearing_waves" + style="@style/ForecastBearing" + tools:text="275°" /> + </LinearLayout> </LinearLayout> - </androidx.gridlayout.widget.GridLayout> + <!-- Swell --> + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical" + android:gravity="center" + android:padding="4dp"> + <TextView style="@style/ForecastLabel" android:text="Swell" /> + <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_swell_ht" + style="@style/ForecastValue" + tools:text="5.2" /> + <TextView style="@style/ForecastUnit" android:text="ft" /> + </LinearLayout> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:orientation="horizontal" + android:gravity="center_vertical" + android:layout_marginTop="4dp"> + <org.terst.nav.ui.DirectionArrowView + android:id="@+id/arrow_swell" + android:layout_width="14dp" + android:layout_height="14dp" /> + <TextView + android:id="@+id/bearing_swell" + style="@style/ForecastBearing" + tools:text="260°" /> + <TextView + android:id="@+id/value_swell_per" + style="@style/ForecastPeriod" + tools:text="· 14s" /> + </LinearLayout> + </LinearLayout> - <!-- Additional Detail (Visible when expanded) --> - <TextView - android:id="@+id/label_baro" - style="@style/InstrumentLabel" - android:text="Barometer" - android:layout_marginTop="24dp" - app:layout_constraintTop_toBottomOf="@id/instrument_grid" - app:layout_constraintStart_toStartOf="parent" /> - - <TextView - android:id="@+id/value_baro" - style="@style/InstrumentPrimaryValue" - tools:text="1013.2 hPa" - app:layout_constraintTop_toBottomOf="@id/label_baro" - app:layout_constraintStart_toStartOf="parent" /> - - <org.terst.nav.PolarDiagramView - android:id="@+id/polar_diagram_view" - android:layout_width="0dp" - android:layout_height="0dp" - android:layout_marginTop="24dp" - app:layout_constraintDimensionRatio="1:1" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@id/value_baro" - app:layout_constraintBottom_toBottomOf="parent" /> + </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/android-app/app/src/main/res/layout/layout_layer_picker_sheet.xml b/android-app/app/src/main/res/layout/layout_layer_picker_sheet.xml new file mode 100644 index 0000000..c424606 --- /dev/null +++ b/android-app/app/src/main/res/layout/layout_layer_picker_sheet.xml @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingStart="24dp" + android:paddingEnd="24dp" + android:paddingBottom="32dp" + android:background="?attr/colorSurface"> + + <View + android:layout_width="36dp" + android:layout_height="4dp" + android:layout_gravity="center_horizontal" + android:layout_marginTop="12dp" + android:layout_marginBottom="20dp" + android:background="@color/md_theme_outline" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="16dp" + android:text="MAP LAYERS" + android:textSize="11sp" + android:textAllCaps="true" + android:letterSpacing="0.12" + android:fontFamily="sans-serif-light" + android:textColor="@color/instrument_text_secondary" /> + + <!-- Base map selection --> + <com.google.android.material.chip.ChipGroup + android:id="@+id/chip_group_base" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="24dp" + app:singleSelection="true" + app:selectionRequired="true" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + <com.google.android.material.chip.Chip + android:id="@+id/chip_satellite" + style="@style/Widget.Material3.Chip.Filter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Satellite" /> + + <com.google.android.material.chip.Chip + android:id="@+id/chip_charts" + style="@style/Widget.Material3.Chip.Filter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Charts" /> + + <com.google.android.material.chip.Chip + android:id="@+id/chip_hybrid" + style="@style/Widget.Material3.Chip.Filter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Hybrid" /> + + </com.google.android.material.chip.ChipGroup> + + <!-- Wind divider --> + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:layout_marginBottom="16dp" + android:background="@color/md_theme_surfaceVariant" /> + + <!-- Wind toggle --> + <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="Wind overlay" + android:textSize="15sp" + android:textColor="@color/instrument_text_normal" /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="OpenWeatherMap wind speed" + android:textSize="12sp" + android:textColor="@color/instrument_text_secondary" /> + </LinearLayout> + + <com.google.android.material.switchmaterial.SwitchMaterial + android:id="@+id/switch_wind" + android:layout_width="wrap_content" + android:layout_height="wrap_content" /> + + </LinearLayout> + +</LinearLayout> diff --git a/android-app/app/src/main/res/layout/layout_track_summary_sheet.xml b/android-app/app/src/main/res/layout/layout_track_summary_sheet.xml new file mode 100644 index 0000000..a26b76e --- /dev/null +++ b/android-app/app/src/main/res/layout/layout_track_summary_sheet.xml @@ -0,0 +1,199 @@ +<?xml version="1.0" encoding="utf-8"?> +<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="wrap_content" + android:orientation="vertical" + android:paddingStart="24dp" + android:paddingEnd="24dp" + android:paddingBottom="32dp" + android:background="?attr/colorSurface"> + + <!-- Drag handle --> + <View + android:layout_width="36dp" + android:layout_height="4dp" + android:layout_gravity="center_horizontal" + android:layout_marginTop="12dp" + android:layout_marginBottom="20dp" + android:background="@color/md_theme_outline" /> + + <!-- Title --> + <TextView + android:id="@+id/summary_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="20dp" + android:textSize="13sp" + android:textAllCaps="true" + android:letterSpacing="0.12" + android:fontFamily="sans-serif-light" + android:textColor="@color/instrument_text_secondary" + tools:text="Track · 06 Apr 14:32" /> + + <!-- Distance + Duration row --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:layout_marginBottom="16dp"> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical"> + <TextView + style="@style/InstrumentLabel" + android:text="Distance" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/summary_distance" + style="@style/InstrumentPrimaryValue" + tools:text="12.3" /> + <TextView + style="@style/InstrumentUnit" + android:text="nm" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical"> + <TextView + style="@style/InstrumentLabel" + android:text="Duration" /> + <TextView + android:id="@+id/summary_duration" + style="@style/InstrumentPrimaryValue" + tools:text="2h 14m" /> + </LinearLayout> + + </LinearLayout> + + <!-- Speed row --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:layout_marginBottom="16dp"> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical"> + <TextView + style="@style/InstrumentLabel" + android:text="Max Speed" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/summary_max_sog" + style="@style/InstrumentPrimaryValue" + tools:text="8.1" /> + <TextView + style="@style/InstrumentUnit" + android:text="kt" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical"> + <TextView + style="@style/InstrumentLabel" + android:text="Avg Speed" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/summary_avg_sog" + style="@style/InstrumentPrimaryValue" + tools:text="5.5" /> + <TextView + style="@style/InstrumentUnit" + android:text="kt" /> + </LinearLayout> + </LinearLayout> + + </LinearLayout> + + <!-- Wind + Waves row (conditionally visible) --> + <LinearLayout + android:id="@+id/summary_conditions_row" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:visibility="gone" + tools:visibility="visible"> + + <LinearLayout + android:id="@+id/summary_wind_cell" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical" + android:visibility="gone" + tools:visibility="visible"> + <TextView + style="@style/InstrumentLabel" + android:text="Avg Wind" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/summary_avg_wind" + style="@style/InstrumentPrimaryValue" + tools:text="14" /> + <TextView + style="@style/InstrumentUnit" + android:text="kt" /> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:id="@+id/summary_wave_cell" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical" + android:visibility="gone" + tools:visibility="visible"> + <TextView + style="@style/InstrumentLabel" + android:text="Avg Waves" /> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical"> + <TextView + android:id="@+id/summary_avg_wave" + style="@style/InstrumentPrimaryValue" + tools:text="2.1" /> + <TextView + style="@style/InstrumentUnit" + android:text="ft" /> + </LinearLayout> + </LinearLayout> + + </LinearLayout> + +</LinearLayout> |
