📚 Encyclopedia

Android · updated 2026-11-02

A launcher icon that changes (today's date on a calendar icon)

androidlauncheractivity-aliasiconsadaptive-iconpackagemanager

Google's Calendar and Clock icons show today's date or the time because the Pixel launcher draws them specially. Launchers do not draw live icons for third-party apps. The workaround is to ship one icon per state and swap which one the launcher sees, using activity aliases. Justin's Calendar app (io.jhampton.calendar, 0.3.0, 2026-10-28) shows the day of the month this way.

How it works

Keeping it current

Call the sync from Application.onCreate, the activity's onResume, and a receiver for an exact alarm at next midnight plus 2 s, BOOT_COMPLETED, MY_PACKAGE_REPLACED, TIME_SET and TIMEZONE_CHANGED. The receiver re-arms the next midnight alarm each time. Scheduling details are in Alarms and timers that ring on time (Android clock apps).

Generating 31 icons

Script it. The Calendar app's tool/make_icon.py writes, per day, an adaptive icon (mipmap-anydpi-v26/ic_day_N.xml) with a vector foreground and a monochrome layer for themed icons (the number cut out of the page with an even-odd fill). The digits are a real font (Noto Sans Bold) converted to vector path data with fontTools, so no font file or bitmap is needed at runtime.

Costs

See also

Linked from

Sources: calendar memory (calendar-app 0.3.0), repo ~/dev/calendar, tldr post #1871