Skip to content

Instantly share code, notes, and snippets.

@aqua30
Created May 28, 2022 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aqua30/2b11379194e274ed19d84e907601764e to your computer and use it in GitHub Desktop.
Save aqua30/2b11379194e274ed19d84e907601764e to your computer and use it in GitHub Desktop.
@Composable
fun TimeDisplay(
time: TimeData = TimeData(),
) {
val timeUnitColor = if (time.isDataEmpty()) GRAY_TEXT else BLUE_LIGHT
Row(
horizontalArrangement = Arrangement.spacedBy(16.dp)
) {
TimeDisplayUnit(
time = time.hours,
unit = "h",
textColor = timeUnitColor
)
TimeDisplayUnit(
time = time.mins,
unit = "m",
textColor = timeUnitColor
)
TimeDisplayUnit(
time = time.secs,
unit = "s",
textColor = timeUnitColor
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment