Alvin Dizon
02/23/2024, 8:19 AM2024.02.00
from 2023.10.01
and the Text
inside my CenterAlignedTopAppBar
suddenly isn't center-aligned, has anyone experienced something similar? My code looks like this:
CenterAlignedTopAppBar(
colors =
TopAppBarDefaults.centerAlignedTopAppBarColors(
containerColor = LocalColors.current.container
),
title = {
Column(
modifier = Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
color = LocalColors.current.textTernary,
text = state.chatInfo?.recipientName.orEmpty(),
style = LocalTypography.current.title2
)
Text(
color = LocalColors.current.placeholderSecondary,
text = state.chatInfo?.displayAddress.orEmpty(),
style = LocalTypography.current.smallNormal,
overflow = TextOverflow.Ellipsis
)
}
},
navigationIcon = {
IconButton(onClick = onNavigationIconClick) {
Icon(
tint = LocalColors.current.textTernary,
imageVector = Icons.Filled.Close,
contentDescription = "Close"
)
}
}
)
Stylianos Gakis
02/23/2024, 8:23 AMStylianos Gakis
02/23/2024, 8:31 AMStylianos Gakis
02/23/2024, 8:34 AMCenterAlignedTopAppBar(
colors =
TopAppBarDefaults.centerAlignedTopAppBarColors(
containerColor = LocalColors.current.container,
),
title = {
Column(
modifier = Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
color = LocalColors.current.textTernary,
text = state.chatInfo?.recipientName.orEmpty(),
style = LocalTypography.current.title2,
)
Text(
color = LocalColors.current.placeholderSecondary,
text = state.chatInfo?.displayAddress.orEmpty(),
style = LocalTypography.current.smallNormal,
overflow = TextOverflow.Ellipsis,
)
}
},
navigationIcon = {
IconButton(onClick = onNavigationIconClick) {
Icon(
tint = LocalColors.current.textTernary,
imageVector = Icons.Filled.Close,
contentDescription = "Close",
)
}
},
actions = {
IconButton(
onClick = {},
modifier = Modifier.layout { measurable, constraints ->
val placeable = measurable.measure(constraints)
layout(placeable.width, placeable.height) {}
}
) {
Icon(
tint = LocalColors.current.textTernary,
imageVector = Icons.Filled.Close,
contentDescription = "Close",
)
}
}
)
Stylianos Gakis
02/23/2024, 8:37 AMAlvin Dizon
02/23/2024, 9:15 AMAlvin Dizon
02/23/2024, 9:36 AMStylianos Gakis
02/23/2024, 9:37 AMColton Idle
02/24/2024, 10:05 PMStylianos Gakis
02/25/2024, 8:56 AM