From 5a101aa25e9420165655351ce199bc7e95e2b17d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 20 Oct 2026 13:57:26 +0000 Subject: [PATCH] Snap-a-meal home screen widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A single-button 1×1 widget ("Log meal", mint camera on the GMind ink square with the mint frame). Tapping it opens the camera straight into the AI meal analysis: the same ACTION_LOG_MEAL path as the launcher shortcut and the meal reminder, so it also works with the app open. Plain RemoteViews, since it shows no data and never needs refreshing. Without the coach's AI the photo flow falls back to the manual form, as the other entry points do. Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w --- app/src/main/AndroidManifest.xml | 13 +++++++ .../com/pulseloop/widgets/SnapMealWidget.kt | 37 +++++++++++++++++++ .../main/res/drawable/ic_widget_camera.xml | 6 +++ app/src/main/res/drawable/widget_snap_bg.xml | 7 ++++ app/src/main/res/layout/widget_snap_meal.xml | 28 ++++++++++++++ app/src/main/res/values/strings.xml | 3 ++ .../main/res/xml/widget_snap_meal_info.xml | 13 +++++++ 7 files changed, 107 insertions(+) create mode 100644 app/src/main/java/com/pulseloop/widgets/SnapMealWidget.kt create mode 100644 app/src/main/res/drawable/ic_widget_camera.xml create mode 100644 app/src/main/res/drawable/widget_snap_bg.xml create mode 100644 app/src/main/res/layout/widget_snap_meal.xml create mode 100644 app/src/main/res/xml/widget_snap_meal_info.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 24b62fe8..f9558d2f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -174,6 +174,19 @@ android:resource="@xml/widget_dual_info" /> + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/widget_snap_bg.xml b/app/src/main/res/drawable/widget_snap_bg.xml new file mode 100644 index 00000000..dbb5a883 --- /dev/null +++ b/app/src/main/res/drawable/widget_snap_bg.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/layout/widget_snap_meal.xml b/app/src/main/res/layout/widget_snap_meal.xml new file mode 100644 index 00000000..80026af2 --- /dev/null +++ b/app/src/main/res/layout/widget_snap_meal.xml @@ -0,0 +1,28 @@ + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8888a79e..9edd6629 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -11,4 +11,7 @@ A Today tile of your choice — activity, sleep, heart rate, and more. Two Metric Tiles Two Today tiles side by side, each configurable. + Snap a meal + Log meal + One tap opens the camera to log a meal with AI analysis. diff --git a/app/src/main/res/xml/widget_snap_meal_info.xml b/app/src/main/res/xml/widget_snap_meal_info.xml new file mode 100644 index 00000000..a36b8d9b --- /dev/null +++ b/app/src/main/res/xml/widget_snap_meal_info.xml @@ -0,0 +1,13 @@ + + +