The BreakPoint
05/29/2023, 11:19 AM@Composable
fun Tag(
type: TagType,
text: String,
modifier: Modifier
) {
Row(
modifier = modifier
.background(
color = type.bgColor,
shape = RoundedCornerShape(type.borderRadius)
)
.padding(vertical = SPACE_2_DP),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
) {
RowSpacer(space = SPACE_8_DP)
Box(contentAlignment = Alignment.Center) {
Text(
text = text,
style = AppTheme.typography.labelLarge,
color = type.contentColor,
textAlign = TextAlign.Center
)
}
RowSpacer(space = SPACE_8_DP)
}
}
The fonts family is picked from Theme. So the top preview is Default theme and the bottom preview is with our Theme which has this Notosans fonts.chanjungskim
05/29/2023, 12:51 PMHalil Ozercan
05/29/2023, 2:49 PMchanjungskim
05/30/2023, 1:57 AMtextStyle = TextStyle(
platformStyle = PlatformTextStyle(
includeFontPadding = false
)
this is deprecated, is there any other way to set includeFontPadding to false?chanjungskim
05/30/2023, 2:07 AMincludeFontPadding = false
, the font can be cut.chanjungskim
05/30/2023, 2:20 AMThe BreakPoint
05/30/2023, 4:52 AMincludeFontPadding = false
it remove that top padding but the content still seems not centered.The BreakPoint
05/30/2023, 4:53 AMchanjungskim
05/30/2023, 5:14 AMThe BreakPoint
05/30/2023, 6:54 AMchanjungskim
05/31/2023, 2:00 AMThe BreakPoint
05/31/2023, 5:06 AMThe BreakPoint
05/31/2023, 5:06 AMadte
05/31/2023, 1:51 PMThe BreakPoint
06/01/2023, 4:52 AMColton Idle
06/01/2023, 1:46 PMtextStyle = TextStyle(
platformStyle = PlatformTextStyle(
includeFontPadding = false
)
but now in recent alphas is no longer deprecatedMayur
06/28/2023, 8:13 AM• UseAPI fromPlatformTextStyle
to configureCompose 1.2.0
. For few compose versions it was deprecated on purpose to indicate that it is a compatibility API, but has been undeprecated in compose 1.5 to encourage developers to use it.includeFontPadding
https://medium.com/androiddevelopers/fixing-font-padding-in-compose-text-768cd232425b