Don't show AM/PM for 24 hour systems

This commit is contained in:
Sad Ellie 2023-10-14 22:44:08 +03:00
parent 7c53768c01
commit 0d9a3226f5

View File

@ -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
)
}
}
}