feat(widgets): let each widget pick its theme and wallpaper colours
Every widget instance can now follow the system or be pinned to Light or Dark, and on Android 12+ turn the wallpaper's colours off in favour of the app's own palette. Both are set in the widget's config screen and stored in its own Glance state; an instance without them keeps today's look. Glance content takes them through WidgetTheme. The plain-RemoteViews parts (the analog and digital faces, readouts and chronometers) go through a new WidgetPalette, which resolves the widget_* palette under a forced day/night and sets concrete colours, or day/night pairs, on the views. The app's own tones are now widget_app_*, so they stay reachable on API 31+. The analog and digital clocks are re-coloured on API 31+ only: below that AnalogClock's hands and a shape's background tint can't be set through RemoteViews, so their config screens don't offer it. The next-alarm and timer widgets gain a config screen for this (configuration_optional, so placing one doesn't stop there). The analog, stopwatch and quick-timer config screens become settings screens with an OK, like the digital clock's, since they now hold more than one choice. Background opacity is left out: most faces are a shape with text in its container colour rather than a card, so there is no background to fade without losing contrast against the wallpaper. Closes #6
This commit is contained in:
1 parent
8cbb8b311c
commit
19ee678a1b
33 files changed
+910
-159
No files matched your search
@@ -318,6 +318,25 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- The next-alarm and timer widgets' per-instance colours: the same
|
||||
APPWIDGET_CONFIGURE contract as the four above. -->
|
||||
<activity
|
||||
android:name=".ui.widget.config.NextAlarmConfigActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.Clockula">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.widget.config.TimerConfigActivity"
|
||||
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). -->
|
||||
|
||||
Reference in new issue
Block a user