summaryrefslogtreecommitdiff
path: root/android-app/app/src/main/res/layout/fragment_learn.xml
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-04-11 02:27:51 +0000
committerClaude <noreply@anthropic.com>2026-04-11 02:27:51 +0000
commit4a2d0298ab2caa3d62cfbd54c0071ae47eb89ccf (patch)
tree78ae008c64934fadee7fb20f76b4d90237f67cf9 /android-app/app/src/main/res/layout/fragment_learn.xml
parenta287abc937eb036271717e0867398fb68711c51e (diff)
Four features: outbound link markers, offline content, log text/photo, departure picker
Learn tab - ic_open_in_new.xml: external link icon (box + arrow) applied to all browser-opening cards - Migration guide cards retain internal › chevron; ASA/Flashcards cards show ↗ icon - New REFERENCE section (offline, works without connectivity): - ColRegs Rules of the Road → colregs_reference.md (rules 1–38, lights table, sound signals, day shapes, memory aids) - Sailing Quick Reference → sailing_reference.md (points of sail, Beaufort scale, nav lights, knots, buoyage IALA-B, VHF channels, distress signals, tide rule of 12) - ColRegs card moved from external ASA section to offline REFERENCE section Log entry - LogEntry: add photoPath field (absolute file path or content URI string) - VoiceLogViewModel: replace confirmAndSave() with save(text, photoPath?) so the fragment controls text (user may edit recognized speech before saving) - VoiceLogFragment: redesigned layout with EditText (editable, voice fills it), camera button (TakePicturePreview → JPEG in cacheDir), gallery button (GetContent), photo thumbnail with remove button, Save / Clear row - Manifest: add android.hardware.camera uses-feature (required=false) Departure date/time picker (trip planning) - ic_calendar.xml: calendar icon for the picker button - PreTripReportViewModel: _departureMs StateFlow (default = now), setDeparture(ms) - PreTripReportGenerator.generateReport(): departureDateTimeMs param; findDepartureSlot() matches nearest UTC forecast item; condition window labels show actual local times (e.g. "2 PM") when departure is not near-now; buildWatchList uses departure hour for Kona trades warning instead of system clock - fragment_pretrip_report.xml: DEPART card with label + calendar button above generate - PreTripReportFragment: MaterialDatePicker (future dates only) → MaterialTimePicker chain; auto-regenerates after picker confirms https://claude.ai/code/session_01HXPjBsogsJVRwCiekDGkJX
Diffstat (limited to 'android-app/app/src/main/res/layout/fragment_learn.xml')
-rw-r--r--android-app/app/src/main/res/layout/fragment_learn.xml226
1 files changed, 174 insertions, 52 deletions
diff --git a/android-app/app/src/main/res/layout/fragment_learn.xml b/android-app/app/src/main/res/layout/fragment_learn.xml
index f41e577..8813ba2 100644
--- a/android-app/app/src/main/res/layout/fragment_learn.xml
+++ b/android-app/app/src/main/res/layout/fragment_learn.xml
@@ -96,11 +96,11 @@
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
- <!-- ── ASA Training & Practice ──────────────────────────────── -->
+ <!-- ── Reference (offline) ──────────────────────────────────── -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="ASA TRAINING &amp; PRACTICE"
+ android:text="REFERENCE"
android:textSize="11sp"
android:textAllCaps="true"
android:letterSpacing="0.12"
@@ -108,7 +108,7 @@
android:layout_marginBottom="8dp" />
<com.google.android.material.card.MaterialCardView
- android:id="@+id/card_asa_courses"
+ android:id="@+id/card_colregs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
@@ -118,59 +118,102 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:padding="16dp">
+ android:orientation="horizontal"
+ android:padding="16dp"
+ android:gravity="center_vertical">
- <TextView
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:text="ASA Course Catalog"
- android:textAppearance="?attr/textAppearanceTitleSmall" />
+ android:layout_weight="1"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="ColRegs — Rules of the Road"
+ android:textAppearance="?attr/textAppearanceTitleSmall" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="International collision regulations, rules 1–38"
+ android:textSize="12sp"
+ android:textColor="?attr/colorOnSurfaceVariant"
+ android:layout_marginTop="2dp" />
+
+ </LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="ASA 101–114: keelboat through offshore passagemaking"
- android:textSize="12sp"
- android:textColor="?attr/colorOnSurfaceVariant"
- android:layout_marginTop="2dp" />
+ android:text="›"
+ android:textSize="20sp"
+ android:textColor="?attr/colorOnSurfaceVariant" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
- android:id="@+id/card_asa_online"
+ android:id="@+id/card_sailing_reference"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="8dp"
+ android:layout_marginBottom="24dp"
app:cardCornerRadius="12dp"
app:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:padding="16dp">
+ android:orientation="horizontal"
+ android:padding="16dp"
+ android:gravity="center_vertical">
- <TextView
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:text="ASA Online Learning"
- android:textAppearance="?attr/textAppearanceTitleSmall" />
+ android:layout_weight="1"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Sailing Quick Reference"
+ android:textAppearance="?attr/textAppearanceTitleSmall" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Points of sail, lights &amp; shapes, knots"
+ android:textSize="12sp"
+ android:textColor="?attr/colorOnSurfaceVariant"
+ android:layout_marginTop="2dp" />
+
+ </LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Self-paced online courses and study guides"
- android:textSize="12sp"
- android:textColor="?attr/colorOnSurfaceVariant"
- android:layout_marginTop="2dp" />
+ android:text="›"
+ android:textSize="20sp"
+ android:textColor="?attr/colorOnSurfaceVariant" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
+ <!-- ── ASA Training &amp; Practice (external links) ──────────── -->
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="ASA TRAINING &amp; PRACTICE"
+ android:textSize="11sp"
+ android:textAllCaps="true"
+ android:letterSpacing="0.12"
+ android:textColor="?attr/colorOnSurfaceVariant"
+ android:layout_marginBottom="8dp" />
+
<com.google.android.material.card.MaterialCardView
- android:id="@+id/card_colregs"
+ android:id="@+id/card_asa_courses"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
@@ -180,22 +223,85 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:padding="16dp">
+ android:orientation="horizontal"
+ android:padding="16dp"
+ android:gravity="center_vertical">
- <TextView
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:text="ColRegs — Rules of the Road"
- android:textAppearance="?attr/textAppearanceTitleSmall" />
+ android:layout_weight="1"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="ASA Course Catalog"
+ android:textAppearance="?attr/textAppearanceTitleSmall" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="ASA 101–114: keelboat through offshore passagemaking"
+ android:textSize="12sp"
+ android:textColor="?attr/colorOnSurfaceVariant"
+ android:layout_marginTop="2dp" />
+
+ </LinearLayout>
+
+ <ImageView
+ android:layout_width="18dp"
+ android:layout_height="18dp"
+ android:src="@drawable/ic_open_in_new"
+ android:tint="?attr/colorOnSurfaceVariant"
+ android:contentDescription="Opens in browser" />
- <TextView
- android:layout_width="wrap_content"
+ </LinearLayout>
+ </com.google.android.material.card.MaterialCardView>
+
+ <com.google.android.material.card.MaterialCardView
+ android:id="@+id/card_asa_online"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="8dp"
+ app:cardCornerRadius="12dp"
+ app:cardElevation="2dp">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:padding="16dp"
+ android:gravity="center_vertical">
+
+ <LinearLayout
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:text="USCG international collision regulations reference"
- android:textSize="12sp"
- android:textColor="?attr/colorOnSurfaceVariant"
- android:layout_marginTop="2dp" />
+ android:layout_weight="1"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="ASA Online Learning"
+ android:textAppearance="?attr/textAppearanceTitleSmall" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Self-paced online courses and study guides"
+ android:textSize="12sp"
+ android:textColor="?attr/colorOnSurfaceVariant"
+ android:layout_marginTop="2dp" />
+
+ </LinearLayout>
+
+ <ImageView
+ android:layout_width="18dp"
+ android:layout_height="18dp"
+ android:src="@drawable/ic_open_in_new"
+ android:tint="?attr/colorOnSurfaceVariant"
+ android:contentDescription="Opens in browser" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
@@ -211,22 +317,38 @@
<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="Sailing Flashcards"
- android:textAppearance="?attr/textAppearanceTitleSmall" />
+ android:orientation="horizontal"
+ android:padding="16dp"
+ android:gravity="center_vertical">
- <TextView
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:text="Quizlet decks for knots, rules, lights &amp; signals"
- android:textSize="12sp"
- android:textColor="?attr/colorOnSurfaceVariant"
- android:layout_marginTop="2dp" />
+ android:layout_weight="1"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Sailing Flashcards"
+ android:textAppearance="?attr/textAppearanceTitleSmall" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Quizlet decks for knots, rules, lights &amp; signals"
+ android:textSize="12sp"
+ android:textColor="?attr/colorOnSurfaceVariant"
+ android:layout_marginTop="2dp" />
+
+ </LinearLayout>
+
+ <ImageView
+ android:layout_width="18dp"
+ android:layout_height="18dp"
+ android:src="@drawable/ic_open_in_new"
+ android:tint="?attr/colorOnSurfaceVariant"
+ android:contentDescription="Opens in browser" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>