summaryrefslogtreecommitdiff
path: root/android-app/app/src/main/res/layout
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-05-25 18:12:11 +0000
committerClaude <noreply@anthropic.com>2026-05-25 18:12:11 +0000
commit02776054778c3cbc8aefc43376b105becfec2b86 (patch)
tree1ab6db199bc09ff4a6c83e51e271124ee08b7960 /android-app/app/src/main/res/layout
parent619deab18a0cd56d844c5911a9bbda20d4439269 (diff)
Persist log entries and photos; stamp with GPS location
- LogbookStorage: Moshi-backed JSON persistence to getExternalFilesDir, photos saved to Pictures/Nav/ instead of cache - LogbookRepository: file-backed replacement for in-memory store, loads saved entries on init so they survive app restarts - VoiceLogViewModel: expose entries StateFlow, accept lat/lon in save() - VoiceLogFragment: switch camera to TakePicture(Uri) via FileProvider for full-res photos; gallery copies content URI to persistent storage; passes current GPS position to save(); shows scrollable entries list - MainViewModel: expose currentPosition StateFlow updated on each GPS fix - AndroidManifest: add FileProvider for Pictures/Nav/ directory - TripReportViewModel: updated to use LogbookRepository https://claude.ai/code/session_01YUbuZNDAoLea4cf9UGQ9qn
Diffstat (limited to 'android-app/app/src/main/res/layout')
-rw-r--r--android-app/app/src/main/res/layout/fragment_voice_log.xml28
-rw-r--r--android-app/app/src/main/res/layout/item_logbook_entry.xml50
2 files changed, 78 insertions, 0 deletions
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 389add1..4a2ff14 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
@@ -160,6 +160,34 @@
</LinearLayout>
<!-- end layout_log_entry -->
+ <!-- ── Log entries section ── -->
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Log Entries"
+ android:textSize="13sp"
+ android:textAllCaps="true"
+ android:letterSpacing="0.08"
+ android:textColor="?attr/colorOnSurfaceVariant"
+ android:layout_marginBottom="8dp" />
+
+ <TextView
+ android:id="@+id/tv_no_log_entries"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="No log entries yet."
+ android:textColor="?attr/colorOnSurfaceVariant"
+ android:layout_marginBottom="8dp"
+ android:visibility="visible" />
+
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/rv_log_entries"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:nestedScrollingEnabled="false"
+ android:clipToPadding="false"
+ android:layout_marginBottom="16dp" />
+
<!-- Generate Trip Report — always accessible -->
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_generate_report"
diff --git a/android-app/app/src/main/res/layout/item_logbook_entry.xml b/android-app/app/src/main/res/layout/item_logbook_entry.xml
new file mode 100644
index 0000000..10cec4a
--- /dev/null
+++ b/android-app/app/src/main/res/layout/item_logbook_entry.xml
@@ -0,0 +1,50 @@
+<?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="horizontal"
+ android:padding="12dp"
+ android:gravity="center_vertical"
+ android:background="?attr/selectableItemBackground">
+
+ <ImageView
+ android:id="@+id/iv_logbook_photo"
+ android:layout_width="64dp"
+ android:layout_height="48dp"
+ android:scaleType="centerCrop"
+ android:layout_marginEnd="12dp"
+ android:contentDescription="Log photo"
+ android:visibility="gone" />
+
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/tv_logbook_timestamp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="12sp"
+ android:textColor="?attr/colorOnSurfaceVariant" />
+
+ <TextView
+ android:id="@+id/tv_logbook_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="14sp"
+ android:layout_marginTop="2dp" />
+
+ <TextView
+ android:id="@+id/tv_logbook_location"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="12sp"
+ android:textColor="?attr/colorOnSurfaceVariant"
+ android:layout_marginTop="2dp"
+ android:visibility="gone" />
+
+ </LinearLayout>
+
+</LinearLayout>