KPCountdownTimer

fun KPCountdownTimer(size: CountdownTimerSize, endDate: Long, modifier: Modifier = Modifier, onTimerFinish: () -> Unit = {}, style: CountdownTimerStyle = KPCountdownTimerStyle.Primary, backgroundAlpha: Float = 1.0f)

A composable function that displays a countdown timer with hours, minutes, and seconds. The timer counts down to the specified endDate and is styled according to the provided CountdownTimerStyle and CountdownTimerSize. The composable automatically handles the lifecycle of the countdown timer, including starting and stopping the timer.

Parameters

style

The style configuration for the countdown timer, which defines the text style and background color.

size

The size configuration for the countdown timer, which determines the padding and layout.

endDate

The end date for the countdown, represented as a Long timestamp in milliseconds.

modifier

A Modifier used to adjust the layout or behavior of the composable. Defaults to Modifier.

backgroundAlpha

The alpha value for the background color, allowing control over the transparency of the time boxes. Defaults to 1F.

onTimerFinish

Registers a callback to be invoked when the timer finishes.