Remove TextHeadline6 and replace by TextTitleLarge

This commit is contained in:
Wolf-Martell Montwé 2024-04-22 14:45:21 +02:00
parent 03635bec2c
commit e01c1ab895
No known key found for this signature in database
GPG key ID: 6D45B21512ACBF72
7 changed files with 8 additions and 130 deletions

View file

@ -10,7 +10,6 @@ import androidx.compose.ui.text.withStyle
import app.k9mail.core.ui.compose.designsystem.atom.text.TextButton
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline1
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline3
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline6
import app.k9mail.core.ui.compose.designsystem.atom.text.TextOverline
import app.k9mail.core.ui.compose.designsystem.atom.text.TextSubtitle1
import app.k9mail.core.ui.compose.designsystem.atom.text.TextSubtitle2
@ -48,13 +47,6 @@ private fun LazyGridScope.textItems(
)
}
item {
TextHeadline6(
text = annotatedString("Headline6", isAnnotated),
modifier = Modifier.itemDefaultPadding(),
color = color,
)
}
item {
TextSubtitle1(
text = annotatedString("Subtitle1", isAnnotated),

View file

@ -1,44 +0,0 @@
package app.k9mail.ui.catalog.ui.common.drawer
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.atom.DividerHorizontal
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline6
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
@Composable
fun DrawerHeaderItem(
text: String,
modifier: Modifier = Modifier,
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(
start = MainTheme.spacings.double,
top = MainTheme.spacings.double,
end = MainTheme.spacings.double,
)
.then(modifier),
) {
TextHeadline6(
text = text,
)
DividerHorizontal()
}
}
@Preview
@Composable
internal fun DrawerHeaderItemPreview() {
PreviewWithThemes {
DrawerHeaderItem(
text = "Category",
)
}
}

View file

@ -7,7 +7,7 @@ import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyGridScope
import androidx.compose.ui.Modifier
import app.k9mail.core.ui.compose.designsystem.atom.DividerHorizontal
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline6
import app.k9mail.core.ui.compose.designsystem.atom.text.TextTitleLarge
import app.k9mail.core.ui.compose.theme.MainTheme
fun LazyGridScope.sectionHeaderItem(
@ -23,7 +23,7 @@ fun LazyGridScope.sectionHeaderItem(
end = MainTheme.spacings.double,
),
) {
TextHeadline6(
TextTitleLarge(
text = text,
)
DividerHorizontal()

View file

@ -1,70 +0,0 @@
package app.k9mail.core.ui.compose.designsystem.atom.text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
import androidx.compose.material.Text as MaterialText
@Composable
fun TextHeadline6(
text: String,
modifier: Modifier = Modifier,
color: Color = Color.Unspecified,
textAlign: TextAlign? = null,
) {
MaterialText(
text = text,
modifier = modifier,
color = color,
textAlign = textAlign,
style = MainTheme.typography.h6,
)
}
@Composable
fun TextHeadline6(
text: AnnotatedString,
modifier: Modifier = Modifier,
color: Color = Color.Unspecified,
textAlign: TextAlign? = null,
) {
MaterialText(
text = text,
modifier = modifier,
color = color,
textAlign = textAlign,
style = MainTheme.typography.h6,
)
}
@Preview(showBackground = true)
@Composable
internal fun TextHeadline6Preview() {
PreviewWithThemes {
TextHeadline6(text = "TextHeadline6")
}
}
@Preview(showBackground = true)
@Composable
internal fun TextHeadline6WithAnnotatedStringPreview() {
PreviewWithThemes {
TextHeadline6(
text = buildAnnotatedString {
append("Normal")
withStyle(style = SpanStyle(fontWeight = FontWeight.Bold)) {
append("Annotated")
}
},
)
}
}

View file

@ -11,9 +11,9 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.common.koin.koinPreview
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodyLarge
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline6
import app.k9mail.core.ui.compose.designsystem.atom.text.TextOverline
import app.k9mail.core.ui.compose.designsystem.atom.text.TextSubtitle2
import app.k9mail.core.ui.compose.designsystem.atom.text.TextTitleLarge
import app.k9mail.core.ui.compose.theme.K9Theme
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.feature.account.server.certificate.R
@ -36,7 +36,7 @@ internal fun ServerCertificateView(
top = MainTheme.spacings.double,
),
) {
TextHeadline6(stringResource(R.string.account_server_certificate_section_title))
TextTitleLarge(stringResource(R.string.account_server_certificate_section_title))
Spacer(modifier = Modifier.height(MainTheme.spacings.double))
if (serverCertificateProperties.subjectAlternativeNames.isNotEmpty()) {

View file

@ -14,7 +14,7 @@ import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.atom.icon.Icon
import app.k9mail.core.ui.compose.designsystem.atom.icon.Icons
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodyMedium
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline6
import app.k9mail.core.ui.compose.designsystem.atom.text.TextTitleLarge
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
@ -47,7 +47,7 @@ internal fun AutoDiscoveryResultHeaderView(
bottom = MainTheme.spacings.half,
),
) {
TextHeadline6(
TextTitleLarge(
text = stringResource(state.titleResourceId),
)
TextBodyMedium(

View file

@ -25,7 +25,7 @@ import app.k9mail.core.ui.compose.designsystem.atom.icon.Icon
import app.k9mail.core.ui.compose.designsystem.atom.icon.Icons
import app.k9mail.core.ui.compose.designsystem.atom.icon.IconsWithBottomRightOverlay
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodyMedium
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline6
import app.k9mail.core.ui.compose.designsystem.atom.text.TextTitleLarge
import app.k9mail.core.ui.compose.theme.K9Theme
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.feature.onboarding.permissions.R
@ -57,7 +57,7 @@ internal fun PermissionBox(
IconWithPermissionStateOverlay(icon, permissionState)
}
Column {
TextHeadline6(text = title)
TextTitleLarge(text = title)
TextBodyMedium(text = description)
}
}