Remove TextOverline and replace by TextLabelSmall

This commit is contained in:
Wolf-Martell Montwé 2024-04-22 14:51:57 +02:00
parent e01c1ab895
commit c2465c6e92
No known key found for this signature in database
GPG key ID: 6D45B21512ACBF72
5 changed files with 6 additions and 88 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.TextOverline
import app.k9mail.core.ui.compose.designsystem.atom.text.TextSubtitle1
import app.k9mail.core.ui.compose.designsystem.atom.text.TextSubtitle2
import app.k9mail.ui.catalog.ui.common.list.itemDefaultPadding
@ -68,13 +67,6 @@ private fun LazyGridScope.textItems(
color = color,
)
}
item {
TextOverline(
text = annotatedString("Overline", isAnnotated),
modifier = Modifier.itemDefaultPadding(),
color = color,
)
}
}
private fun annotatedString(

View file

@ -1,74 +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 TextOverline(
text: String,
modifier: Modifier = Modifier,
color: Color = Color.Unspecified,
textAlign: TextAlign? = null,
) {
MaterialText(
text = text.uppercase(),
modifier = modifier,
color = color,
textAlign = textAlign,
style = MainTheme.typography.overline,
)
}
@Composable
fun TextOverline(
text: AnnotatedString,
modifier: Modifier = Modifier,
color: Color = Color.Unspecified,
textAlign: TextAlign? = null,
) {
MaterialText(
text = AnnotatedString(
text = text.text.uppercase(),
spanStyles = text.spanStyles,
paragraphStyles = text.paragraphStyles,
),
modifier = modifier,
color = color,
textAlign = textAlign,
style = MainTheme.typography.overline,
)
}
@Preview(showBackground = true)
@Composable
internal fun TextOverlinePreview() {
PreviewWithThemes {
TextOverline(text = "TextOverline")
}
}
@Preview(showBackground = true)
@Composable
internal fun TextOverlineWithAnnotatedStringPreview() {
PreviewWithThemes {
TextOverline(
text = buildAnnotatedString {
append("Normal")
withStyle(style = SpanStyle(fontWeight = FontWeight.Bold)) {
append("Annotated")
}
},
)
}
}

View file

@ -11,7 +11,7 @@ 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.TextOverline
import app.k9mail.core.ui.compose.designsystem.atom.text.TextLabelSmall
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
@ -68,7 +68,7 @@ internal fun ServerCertificateView(
Spacer(modifier = Modifier.height(MainTheme.spacings.double))
TextOverline(text = stringResource(R.string.account_server_certificate_fingerprints_section))
TextLabelSmall(text = stringResource(R.string.account_server_certificate_fingerprints_section))
Spacer(modifier = Modifier.height(MainTheme.spacings.default))
Fingerprint("SHA-1", serverCertificateProperties.fingerprintSha1, fingerprintFormatter)

View file

@ -18,7 +18,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.atom.text.TextOverline
import app.k9mail.core.ui.compose.designsystem.atom.text.TextLabelSmall
import app.k9mail.core.ui.compose.designsystem.molecule.input.TextInput
import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
import app.k9mail.core.ui.compose.theme.K9Theme
@ -61,7 +61,7 @@ internal fun DisplayOptionsContent(
}
item {
TextOverline(
TextLabelSmall(
text = stringResource(id = R.string.account_setup_options_section_display_options),
modifier = Modifier
.fillMaxWidth()

View file

@ -18,7 +18,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.atom.text.TextOverline
import app.k9mail.core.ui.compose.designsystem.atom.text.TextLabelSmall
import app.k9mail.core.ui.compose.designsystem.molecule.input.SelectInput
import app.k9mail.core.ui.compose.designsystem.molecule.input.SwitchInput
import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
@ -64,7 +64,7 @@ internal fun SyncOptionsContent(
}
item {
TextOverline(
TextLabelSmall(
text = stringResource(id = R.string.account_setup_options_section_sync_options),
modifier = Modifier
.fillMaxWidth()