From 9b8bd9078f2b78c77aadc52a08f79eac48dd32a9 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Wed, 1 Jul 2026 06:43:01 +0000 Subject: feat(ui): Windy-style layer picker layout with base map cards and overlay sections Replaces ScrollView + flat switch list with NestedScrollView + GridLayout card sections: BASE MAP (2x2 preview cards), NAVIGATION, OCEAN DATA, WEATHER, MY DATA (toggle cards with 48dp previews), and UNITS (unchanged). Stubs out old chip_group_base wiring in LayerPickerSheet.kt pending Task 7 rewrite. Co-Authored-By: Claude Sonnet 4.6 --- .../kotlin/org/terst/nav/ui/LayerPickerSheet.kt | 23 +- .../main/res/layout/layout_layer_picker_sheet.xml | 734 +++++++++++++-------- 2 files changed, 473 insertions(+), 284 deletions(-) (limited to 'android-app/app/src/main') diff --git a/android-app/app/src/main/kotlin/org/terst/nav/ui/LayerPickerSheet.kt b/android-app/app/src/main/kotlin/org/terst/nav/ui/LayerPickerSheet.kt index 81346a8..b83b638 100644 --- a/android-app/app/src/main/kotlin/org/terst/nav/ui/LayerPickerSheet.kt +++ b/android-app/app/src/main/kotlin/org/terst/nav/ui/LayerPickerSheet.kt @@ -6,6 +6,7 @@ import android.view.View import android.view.ViewGroup import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.google.android.material.chip.ChipGroup +import com.google.android.material.card.MaterialCardView import com.google.android.material.switchmaterial.SwitchMaterial import org.terst.nav.DepthUnit import org.terst.nav.PressureUnit @@ -32,24 +33,10 @@ class LayerPickerSheet( inflater.inflate(R.layout.layout_layer_picker_sheet, container, false) override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - // ── Base layer chips ────────────────────────────────────────────────── - val chipGroup = view.findViewById(R.id.chip_group_base) - chipGroup.check(when (manager.basePreset) { - MapBasePreset.OCEAN -> R.id.chip_ocean - MapBasePreset.SATELLITE -> R.id.chip_satellite - MapBasePreset.CHARTS -> R.id.chip_charts - MapBasePreset.HYBRID -> R.id.chip_hybrid - }) - chipGroup.setOnCheckedStateChangeListener { _, checkedIds -> - val preset = when (checkedIds.firstOrNull()) { - R.id.chip_ocean -> MapBasePreset.OCEAN - R.id.chip_satellite -> MapBasePreset.SATELLITE - R.id.chip_charts -> MapBasePreset.CHARTS - R.id.chip_hybrid -> MapBasePreset.HYBRID - else -> return@setOnCheckedStateChangeListener - } - onBaseChanged(preset) - } + // ── Base map cards (TODO Task 7: wire up click listeners) ──────────── + // chip_group_base / chip_ocean / chip_satellite / chip_charts / chip_hybrid + // replaced by card_ocean / card_satellite / card_charts / card_hybrid + // Full wiring deferred to Task 7 rewrite. // ── Wind overlay switch ─────────────────────────────────────────────── val windSwitch = view.findViewById(R.id.switch_wind) 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 b8db879..cba4be1 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 @@ -1,343 +1,545 @@ - + android:paddingTop="8dp" + android:paddingBottom="24dp"> + + android:layout_marginBottom="12dp" + android:background="@drawable/drag_handle_bg"/> - + + android:textColor="@color/instrument_text_secondary" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:paddingBottom="8dp"/> - - - - + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + android:layout_margin="4dp" + app:layout_columnWeight="1" + app:cardCornerRadius="12dp" + app:strokeWidth="0dp"> + + + + + + + + + - + android:layout_height="wrap_content" + android:text="NAVIGATION" + android:textSize="11sp" + android:textAllCaps="true" + android:letterSpacing="0.12" + android:fontFamily="sans-serif-light" + android:textColor="@color/instrument_text_secondary" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:paddingBottom="8dp"/> - - - - + + - + - - - - - - - - - - - + + + + + + - + - - - - - - - - - - - + + + + + + - - + - - - - - - - - - + android:orientation="vertical" + android:padding="8dp"> + + + + + + + + + android:textColor="@color/instrument_text_secondary" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:paddingBottom="8dp"/> - - - - + + - - + - - - - - - - - - - + + + + + + - + - + + + + + + + - - - - - + android:orientation="vertical" + android:padding="8dp"> + + + + + + + + - - + android:text="WEATHER" + android:textSize="11sp" + android:textAllCaps="true" + android:letterSpacing="0.12" + android:fontFamily="sans-serif-light" + android:textColor="@color/instrument_text_secondary" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:paddingBottom="8dp"/> - + + - + - + + + + + + + - - - - - + android:orientation="vertical" + android:padding="8dp"> + + + + + + + + - - + android:text="MY DATA" + android:textSize="11sp" + android:textAllCaps="true" + android:letterSpacing="0.12" + android:fontFamily="sans-serif-light" + android:textColor="@color/instrument_text_secondary" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:paddingBottom="8dp"/> - + + - - + - - - - - + android:orientation="vertical" + android:padding="8dp"> + + + + + + @@ -505,4 +707,4 @@ - + -- cgit v1.2.3