fix(widgets): config saves, live world clocks, quick-timer guards
- Config screens share WidgetConfigActivity: a picker that dismisses right after selecting no longer finishes with RESULT_CANCELED (which removed a newly placed widget on API 29/30), and the save runs to completion. - Digital config shows only once stored settings are read, so an early OK or a late load can't write defaults over them. - Digital widget collects world clocks inside the composition, so edits reach a live session. - Quick timer: a second tap while its timer is active starts nothing; durations are capped at 59:59 (1 h preset dropped) to fit the readout. - Analog date hand is redrawn at local midnight and on time/zone changes (AnalogDateRefresh); updatePeriodMillis back to 0. - WidgetSync routes each flow only to the widgets that read it. - Stopwatch widget uses the ElapsedRealtimeClock seam and has a two-row minimum height. - Remove dead quick-timer helpers; share showWorldClockIntent.
This commit is contained in:
1 parent
82fff19d3d
commit
0f5cf4f1eb
21 files changed
+415
-335
No files matched your search
@@ -58,6 +58,17 @@ class ClockWidgetSettingsTest {
|
||||
assertThat(parseQuickTimerDuration(0L)).isEqualTo(QuickTimerWidgetSettings.DEFAULT)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `a quick-timer duration past 59 59 parses to the default`() {
|
||||
assertThat(parseQuickTimerDuration(3_600_000L)).isEqualTo(QuickTimerWidgetSettings.DEFAULT)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `the quick-timer options stop at 59 59`() {
|
||||
assertThat(QuickTimerWidgetSettings.OPTIONS).isNotEmpty()
|
||||
assertThat(QuickTimerWidgetSettings.OPTIONS.all { it <= QuickTimerWidgetSettings.MAX }).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `an in-range quick-timer duration round-trips`() {
|
||||
assertThat(parseQuickTimerDuration(600_000L).inWholeMilliseconds).isEqualTo(600_000L)
|
||||
|
||||
Reference in new issue
Block a user