When to use it
Keep the target instant in host state. Backgrounding pauses updates while absolute time continues. Invalid targets show a placeholder; countdowns stop at zero and report completion once after running. The timer uses no animation.
Display absolute-clock countdowns and elapsed time with controlled announcement frequency.
Native example
Keep the target instant in host state. Backgrounding pauses updates while absolute time continues. Invalid targets show a placeholder; countdowns stop at zero and report completion once after running. The timer uses no animation.
val deadline = remember { System.currentTimeMillis() + 65_000L }
LumenTimer(
label = "Time remaining",
to = deadline,
units = listOf(LumenTimerUnit.Minutes, LumenTimerUnit.Seconds),
announce = LumenTimerAnnounce.Complete,
completeLabel = "Countdown finished"
)Reference
The primary shared and platform-specific options exposed by LumenTimer.
| API | Values or type | Default | Description |
|---|---|---|---|
| label | Localized string | Required | Names the timer independently of its changing digits. |
| mode | countdown · elapsed | countdown | Counts toward to or from the elapsed start. |
| to / from | Long? epoch milliseconds | Absent | Supplies an absolute instant. Missing or invalid targets show --:--. |
| format | clock · units | clock | Selects a clock or localized duration units. |
| units | days · hours · minutes · seconds | Countdown: all; elapsed: hours/minutes/seconds | The largest selected unit absorbs larger values. |
| announce | off · complete · minute | off | Limits polite announcements to completion or minute changes. |
| completeLabel | String | Timer complete | Application-localized completion copy. |
| onComplete | Optional callback | Absent | Reports one running-to-complete transition per target; an already-expired target is silent. |
Native behavior
Keep the target instant in host state. Backgrounding pauses updates while absolute time continues. Invalid targets show a placeholder; countdowns stop at zero and report completion once after running. The timer uses no animation.
One named timer exposes its current value. Ticking digits are not a live region; opt into polite completion or minute announcements.
Shared component