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