Skip to content

Instantly share code, notes, and snippets.

@aqua30
Created May 28, 2022 08:04
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/c0c61deb97350683b98883caf891efe1 to your computer and use it in GitHub Desktop.
Save aqua30/c0c61deb97350683b98883caf891efe1 to your computer and use it in GitHub Desktop.
private fun addTime(value: String) {
val intValue = value.toInt()
val hours = TimeUnit(
leftDigit = timeState.value.hours.rightDigit,
rightDigit = timeState.value.mins.leftDigit,
)
val mins = TimeUnit(
leftDigit = timeState.value.mins.rightDigit,
rightDigit = timeState.value.secs.leftDigit,
)
val secs = TimeUnit(
leftDigit = timeState.value.secs.rightDigit,
rightDigit = intValue,
)
timeState.value = timeState.value.copy(
hours = hours,
mins = mins,
secs = secs
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment