From 2cce533490baa4fe0d14f8541be1375e8069b164 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 6 Apr 2026 05:29:18 +0000 Subject: feat(ui): restructure instrument sheet layout — inline arrows, WaveView, ocean forecast section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full layout rewrite: 3×2 GridLayout instrument grid with inline DirectionArrowView for AWS/TWS/HDG/COG, depth+baro row, animated WaveView divider, and ocean-blue forecast section for Current/Waves/Swell. Stubs valueCurrDir/valueWaveDir as nullable in InstrumentHandler to compile; full handler rewrite follows in Task 6. Co-Authored-By: Claude Sonnet 4.6 --- .../src/main/kotlin/org/terst/nav/MainActivity.kt | 4 +- .../kotlin/org/terst/nav/ui/InstrumentHandler.kt | 8 +- .../main/res/layout/layout_instruments_sheet.xml | 328 +++++++++++++++++---- 3 files changed, 279 insertions(+), 61 deletions(-) (limited to 'android-app/app/src/main') diff --git a/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt b/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt index 6197475..023cb94 100644 --- a/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt +++ b/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt @@ -190,9 +190,9 @@ class MainActivity : AppCompatActivity(), SafetyFragment.SafetyListener { valueDepth = findViewById(R.id.value_depth), valueBaro = findViewById(R.id.value_baro), valueCurrSpd = findViewById(R.id.value_curr_spd), - valueCurrDir = findViewById(R.id.value_curr_dir), + valueCurrDir = null, valueWaveHt = findViewById(R.id.value_wave_ht), - valueWaveDir = findViewById(R.id.value_wave_dir), + valueWaveDir = null, valueSwellHt = findViewById(R.id.value_swell_ht), valueSwellPer = findViewById(R.id.value_swell_per) ) diff --git a/android-app/app/src/main/kotlin/org/terst/nav/ui/InstrumentHandler.kt b/android-app/app/src/main/kotlin/org/terst/nav/ui/InstrumentHandler.kt index 91582c0..370d8cf 100644 --- a/android-app/app/src/main/kotlin/org/terst/nav/ui/InstrumentHandler.kt +++ b/android-app/app/src/main/kotlin/org/terst/nav/ui/InstrumentHandler.kt @@ -15,9 +15,9 @@ class InstrumentHandler( private val valueDepth: TextView, private val valueBaro: TextView, private val valueCurrSpd: TextView, - private val valueCurrDir: TextView, + private val valueCurrDir: TextView?, private val valueWaveHt: TextView, - private val valueWaveDir: TextView, + private val valueWaveDir: TextView?, private val valueSwellHt: TextView, private val valueSwellPer: TextView ) { @@ -57,9 +57,9 @@ class InstrumentHandler( swellPer: String? = null ) { currSpd?.let { valueCurrSpd.text = it } - currDir?.let { valueCurrDir.text = it } + currDir?.let { valueCurrDir?.text = it } waveHt?.let { valueWaveHt.text = it } - waveDir?.let { valueWaveDir.text = it } + waveDir?.let { valueWaveDir?.text = it } swellHt?.let { valueSwellHt.text = it } swellPer?.let { valueSwellPer.text = it } } 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 8c41ff3..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,34 +1,46 @@ - + - + + app:layout_constraintTop_toBottomOf="@id/drag_handle" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> - + - + + + + + - + - + + + + - + - + + + + - + - + + + + + - + - + + + + - + - + + + + - + @@ -117,87 +221,201 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:orientation="vertical"> + android:orientation="vertical" + android:gravity="center" + android:padding="8dp"> - + + + + + + + android:orientation="vertical" + android:gravity="center" + android:padding="8dp"> - + + + + - - + - - - + + - - - + android:gravity="center" + android:padding="4dp"> + + + + + + + + + + - - - + android:gravity="center" + android:padding="4dp"> + + + + + + + + + + - - - + android:gravity="center" + android:padding="4dp"> + + + + + + + + + + - -- cgit v1.2.3