feat(widgets): M3 Expressive widget lineup — analog, digital, stopwatch, quick timer

Six widgets, each with minimal settings, styled with M3 Expressive shapes and
Material You colours, and sized proportionally to the placed widget
(SizeMode.Exact + LocalSize):

- Analog clock (new): nine faces on MaterialShapes dials (Round, Numeral,
  Day, Cookie, Sunny, Scallop, Clover, Square, Petal) with per-face hands,
  a seconds dot and Google-Clock-style orbiting date on some faces, and a
  day/date pill on others. Style picker previews inflate the real views.
- Digital clock: rebuilt as RemoteViews faces (Classic, Thin, Bold, Pill,
  Stacked) shared by the widget and its config previews; world clocks are
  opt-in and only on the card faces.
- Next alarm and Timers: shape badges, icon buttons, proportional readouts;
  a lone timer on a tall widget gets a stacked layout.
- Stopwatch (new): large readout with play/pause pill and lap/reset.
- Quick timer (new): a Scallop that is a timer of its own — tap to start a
  transient timer of its configured duration, tap again to reset/stop.

Colours resolve in the launcher (widget_* palette resources, GlanceTheme's
dynamic colours) so widgets follow day/night and the wallpaper. Data widgets
collect their flows inside the composition so a live Glance session never
shows stale state, chronometer bases use elapsedRealtime, and config
activities close cleanly on an invalid widget id.
This commit is contained in:
makiolaj committed 2026-10-02 18:01:11 +02:00
1 parent 5d03c654bf
commit 82fff19d3d
103 files changed
+3793 -280

No files matched your search

+86 -9
View File
@@ -233,15 +233,59 @@
android:value="true" />
</service>
<!-- The three M10 home-screen widgets (docs/PLAN.md §9). Each is a
GlanceAppWidgetReceiver, and each must be exported with only the
APPWIDGET_UPDATE filter — that is how the launcher delivers a
widget update, and the platform requires exported="true" for a
widget provider to be pickable at all. No permission guards it,
same as any other app's widget: APPWIDGET_UPDATE is a
platform-delivered broadcast, never a door another app can open by
naming the action itself. updatePeriodMillis is 0 in every
provider-info XML — WidgetSync is the one refresh trigger. -->
<!-- The digital clock widget's per-instance style/date/world-clocks
picker (M11). Exported with only the APPWIDGET_CONFIGURE filter,
as the launcher requires to open it on placement and on "Edit
widget"; carries no extra data of its own beyond the app widget
id the launcher passes in. -->
<activity
android:name=".ui.widget.config.ClockWidgetConfigActivity"
android:exported="true"
android:theme="@style/Theme.Clockula">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<!-- The analog clock widget's per-instance style picker (M11): the
same APPWIDGET_CONFIGURE contract as the digital widget's above. -->
<activity
android:name=".ui.widget.config.AnalogClockConfigActivity"
android:exported="true"
android:theme="@style/Theme.Clockula">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<!-- The quick-timer widget's per-instance duration picker (M11): the
same APPWIDGET_CONFIGURE contract as the two above. -->
<activity
android:name=".ui.widget.config.QuickTimerConfigActivity"
android:exported="true"
android:theme="@style/Theme.Clockula">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<!-- The quick-timer widget's one tap: creates and starts a timer at
its configured duration. A broadcast, not a service start or an
activity, for the same reason as `TimerActionReceiver` (M11 D16). -->
<receiver
android:name=".timer.receiver.QuickTimerReceiver"
android:exported="false" />
<!-- The six home-screen widgets. Each is a GlanceAppWidgetReceiver,
and each must be exported with only the APPWIDGET_UPDATE filter —
that is how the launcher delivers a widget update, and the
platform requires exported="true" for a widget provider to be
pickable at all. No permission guards it, same as any other
app's widget: APPWIDGET_UPDATE is a platform-delivered broadcast,
never a door another app can open by naming the action itself.
updatePeriodMillis is 0 in every provider-info XML — WidgetSync
is the one refresh trigger (the quick-timer widget has no live
state, so it is refreshed only by its own config save). -->
<receiver
android:name=".widget.NextAlarmWidgetReceiver"
android:exported="true">
@@ -274,6 +318,39 @@
android:name="android.appwidget.provider"
android:resource="@xml/widget_clock_info" />
</receiver>
<receiver
android:name=".widget.AnalogClockWidgetReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_analog_clock_info" />
</receiver>
<receiver
android:name=".widget.StopwatchWidgetReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_stopwatch_info" />
</receiver>
<receiver
android:name=".widget.QuickTimerWidgetReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_quick_timer_info" />
</receiver>
</application>
</manifest>