Skip to content

Feature/digital world clock - #165

Open
miguelsg29 wants to merge 12 commits into
starbrightlab:mainfrom
miguelsg29:feature/digital-world-clock
Open

Feature/digital world clock#165
miguelsg29 wants to merge 12 commits into
starbrightlab:mainfrom
miguelsg29:feature/digital-world-clock

Conversation

@miguelsg29

Copy link
Copy Markdown

This PR introduces a new built-in Digital World Clock widget alongside the existing analog world clock:

  • Displays digital time for configured world clock time zones.
  • Automatically respects ImmortalSettings.use24HourClock (12-hour vs 24-hour format).
  • Responsive design: dynamically adjusts font size and alignment for 1, 2, 3, or 4 active time zones.
  • Includes Spanish translations in I18n.kt.

@starbrightlab starbrightlab left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition — reviewed the two world-clock commits (independent of the i18n base). Correctness is solid: DST-safe (TimeZone.getTimeZone(zone)), respects use24HourClock (AUTO/12/24), and the LaunchedEffect tick actually updates. Integration follows the existing analog-widget pattern at all the right points, DisposableEffect cleans up the observer, no new persisted setting → tripwires stay green. This is close to mergeable.

A few nits before merge:

  1. Don't repurpose the Timers glyph. ca7cab9 changed the shipped Timers icon ⏱ → ⌛ purely to free for the new clock (HomeActivity.kt:3198). That silently alters an existing widget (and an hourglass suits a timer worse). Please give the digital clock its own glyph and leave Timers as-is.
  2. Tick per-minute, not per-second. The digital face shows only HH:mm yet wakes every second (delay(1000)), and remember(zone, now, ...) re-keys on now so it memoizes nothing. On an always-on OLED launcher, per-minute is easier on power/burn-in.
  3. Optional: the digital and analog widgets share ~all their scaffolding (state, lifecycle observer, tick, responsive layout) — a shared helper would avoid future double-maintenance. And at 3–4 zones the time Text is maxLines=1 with no overflow = Ellipsis, so a wide "12:45 PM" can clip.

Fix 1 and 2 and I'm happy to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants