summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-02 01:35:07 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-02 01:35:07 +0000
commit1893aee8e9a23fdc51e203c918f52374fa601d7d (patch)
treeb36481a695a940fea34ad1bb6afa475f3fcf3bc3
parent801288968198814b77e0a740da72db3cfb584872 (diff)
fix(ui): layer previews, fishing pole icon, button alignment, safety page cleanup
- Layer picker: change android:src→android:background on preview ImageViews; shape drawables have no intrinsic size so centerCrop renders blank — background fills correctly - Replace ic_fish with ic_fishing_pole (rod + reel + line + hook vector) - Move fab_fishing to CoordinatorLayout with layout_anchor on instrument_bottom_sheet top|start, matching fab_record_track positioning so both FABs sit level at sheet top - Raise fishing_overlay marginBottom 140dp→200dp to clear the realigned FAB - Safety: remove HELP button + DocFragment import from SafetyFragment; rename Quit→Quit App Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rw-r--r--android-app/app/src/main/kotlin/org/terst/nav/ui/safety/SafetyFragment.kt8
-rw-r--r--android-app/app/src/main/res/drawable/ic_fishing_pole.xml33
-rw-r--r--android-app/app/src/main/res/layout/activity_main.xml28
-rw-r--r--android-app/app/src/main/res/layout/fragment_safety.xml9
-rw-r--r--android-app/app/src/main/res/layout/layout_layer_picker_sheet.xml39
5 files changed, 61 insertions, 56 deletions
diff --git a/android-app/app/src/main/kotlin/org/terst/nav/ui/safety/SafetyFragment.kt b/android-app/app/src/main/kotlin/org/terst/nav/ui/safety/SafetyFragment.kt
index e4b2d97..c3bef8f 100644
--- a/android-app/app/src/main/kotlin/org/terst/nav/ui/safety/SafetyFragment.kt
+++ b/android-app/app/src/main/kotlin/org/terst/nav/ui/safety/SafetyFragment.kt
@@ -20,7 +20,6 @@ import org.terst.nav.ais.CpaSeverity
import org.terst.nav.ais.label
import org.terst.nav.safety.AnchorWatchState
import org.terst.nav.settings.HardwareSource
-import org.terst.nav.ui.doc.DocFragment
class SafetyFragment : Fragment() {
@@ -45,13 +44,6 @@ class SafetyFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
- view.findViewById<MaterialButton>(R.id.button_help_safety).setOnClickListener {
- parentFragmentManager.beginTransaction()
- .replace(R.id.fragment_container, DocFragment.newInstance("docs/safety.md"))
- .addToBackStack(null)
- .commit()
- }
-
view.findViewById<MaterialButton>(R.id.button_mob_activate).setOnClickListener {
listener?.onActivateMob()
}
diff --git a/android-app/app/src/main/res/drawable/ic_fishing_pole.xml b/android-app/app/src/main/res/drawable/ic_fishing_pole.xml
new file mode 100644
index 0000000..a8cbfdc
--- /dev/null
+++ b/android-app/app/src/main/res/drawable/ic_fishing_pole.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <!-- Rod -->
+ <path
+ android:fillColor="#00000000"
+ android:pathData="M4,20 L20,4"
+ android:strokeColor="@android:color/white"
+ android:strokeWidth="2.5"
+ android:strokeLineCap="round"/>
+ <!-- Reel at butt end -->
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M6,18 m-2,0 a2,2 0 1,0 4,0 a2,2 0 1,0 -4,0"/>
+ <!-- Fishing line from tip, curving down -->
+ <path
+ android:fillColor="#00000000"
+ android:pathData="M20,4 C23,9 22,15 20,19"
+ android:strokeColor="@android:color/white"
+ android:strokeWidth="1"
+ android:strokeLineCap="round"/>
+ <!-- Hook -->
+ <path
+ android:fillColor="#00000000"
+ android:pathData="M20,19 Q21,23 18,23 Q16,23 16,21"
+ android:strokeColor="@android:color/white"
+ android:strokeWidth="1.5"
+ android:strokeLineCap="round"
+ android:strokeLineJoin="round"/>
+</vector>
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 a1939c1..fc60c80 100644
--- a/android-app/app/src/main/res/layout/activity_main.xml
+++ b/android-app/app/src/main/res/layout/activity_main.xml
@@ -95,24 +95,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
- android:layout_marginBottom="140dp"
+ android:layout_marginBottom="200dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
- <!-- Fishing mode FAB — bottom-start -->
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/fab_fishing"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginBottom="136dp"
- android:src="@drawable/ic_fish"
- android:contentDescription="Fishing mode"
- app:fabSize="mini"
- app:elevation="8dp"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/fab_recenter"
@@ -169,6 +156,19 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
+ <!-- Fishing mode FAB — anchored to sheet top-start, vertically aligned with record track -->
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/fab_fishing"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="16dp"
+ android:src="@drawable/ic_fishing_pole"
+ android:contentDescription="Fishing mode"
+ app:fabSize="mini"
+ 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"
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 420ccef..2c06431 100644
--- a/android-app/app/src/main/res/layout/fragment_safety.xml
+++ b/android-app/app/src/main/res/layout/fragment_safety.xml
@@ -34,17 +34,10 @@
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Quit"
+ android:text="Quit App"
android:textColor="?attr/colorOnSurfaceVariant"
app:icon="@drawable/ic_close" />
- <com.google.android.material.button.MaterialButton
- android:id="@+id/button_help_safety"
- style="@style/Widget.Material3.Button.TextButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="HELP" />
-
</LinearLayout>
<!-- MOB Section -->
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
index cba4be1..ce52108 100644
--- 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
@@ -61,8 +61,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="80dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_ocean"
+ android:background="@drawable/preview_ocean"
android:contentDescription="Ocean base map preview"/>
<TextView
android:layout_width="match_parent"
@@ -92,8 +91,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="80dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_satellite"
+ android:background="@drawable/preview_satellite"
android:contentDescription="Satellite base map preview"/>
<TextView
android:layout_width="match_parent"
@@ -123,8 +121,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="80dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_charts"
+ android:background="@drawable/preview_charts"
android:contentDescription="Charts base map preview"/>
<TextView
android:layout_width="match_parent"
@@ -154,8 +151,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="80dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_hybrid"
+ android:background="@drawable/preview_hybrid"
android:contentDescription="Hybrid base map preview"/>
<TextView
android:layout_width="match_parent"
@@ -211,8 +207,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="48dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_seamarks"
+ android:background="@drawable/preview_seamarks"
android:contentDescription="Seamarks preview"/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_seamarks"
@@ -241,8 +236,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="48dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_ocean"
+ android:background="@drawable/preview_ocean"
android:contentDescription="ATON preview"/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_aton"
@@ -271,8 +265,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="48dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_charts"
+ android:background="@drawable/preview_charts"
android:contentDescription="TSS preview"/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_tss"
@@ -326,8 +319,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="48dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_depth"
+ android:background="@drawable/preview_depth"
android:contentDescription="Depth preview"/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_depth"
@@ -356,8 +348,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="48dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_sst"
+ android:background="@drawable/preview_sst"
android:contentDescription="SST preview"/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_sst"
@@ -386,8 +377,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="48dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_ocean"
+ android:background="@drawable/preview_ocean"
android:contentDescription="FADs preview"/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_fads"
@@ -441,8 +431,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="48dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_wind"
+ android:background="@drawable/preview_wind"
android:contentDescription="Wind preview"/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_wind"
@@ -471,8 +460,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="48dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_wind"
+ android:background="@drawable/preview_wind"
android:contentDescription="Particles preview"/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_particles"
@@ -526,8 +514,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="48dp"
- android:scaleType="centerCrop"
- android:src="@drawable/preview_satellite"
+ android:background="@drawable/preview_satellite"
android:contentDescription="Past tracks preview"/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_past_tracks"