Skip to content

Commit

Permalink
Don't show AM/PM for 24 hour systems
Browse files Browse the repository at this point in the history
  • Loading branch information
sadellie committed Oct 14, 2023
1 parent 7c53768 commit 0d9a322
Showing 1 changed file with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,22 @@ internal fun DateTimeSelectorBlock(
)
}

AnimatedContent(
targetState = dateTime,
transitionSpec = {
slideInVertically { height -> height } + fadeIn() togetherWith
slideOutVertically { height -> -height } + fadeOut() using
SizeTransform()
},
label = "Animated am/pm",
) { time ->
Text(
text = time.formatTimeAmPm(locale),
style = MaterialTheme.typography.bodyLarge,
maxLines = 1
)
if (is24Hour) {
AnimatedContent(
targetState = dateTime,
transitionSpec = {
slideInVertically { height -> height } + fadeIn() togetherWith
slideOutVertically { height -> -height } + fadeOut() using
SizeTransform()
},
label = "Animated am/pm",
) { time ->
Text(
text = time.formatTimeAmPm(locale),
style = MaterialTheme.typography.bodyLarge,
maxLines = 1
)
}
}
}

Expand Down

0 comments on commit 0d9a322

Please sign in to comment.