Timer Info
Timer Info
The TimerInfo component handles live counting timers. It is used across various layouts—including Animated Info and the Dynamic Island (Big Island)—to display countdowns or stopwatches that update in real-time without needing constant push updates.
Usage
| |
Data Model (TimerInfo)
| Parameter | Type | Description |
|---|---|---|
timerType | Int | Required. Controls the timer mode and state.-2: Stop/Pause Countdown.-1: Start Countdown (Counts down to timerWhen).0: Default / Standard.1: Start Chronometer (Counts up).2: Stop/Pause Chronometer. |
timerWhen | Long | Required. The absolute target timestamp (milliseconds). For countdowns, this is the time when the timer hits 0. |
timerTotal | Long | Required. The total duration of the timer in milliseconds. Used to calculate progress bars (if applicable). |
timerSystemCurrent | Long | Required. The System.currentTimeMillis() at the moment of creation. This is used to synchronize the timer and calculate accurate offsets. |