Remove TextOverline and replace by TextLabelSmall
This commit is contained in:
parent
e01c1ab895
commit
c2465c6e92
5 changed files with 6 additions and 88 deletions
|
@ -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.TextButton
|
||||||
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline1
|
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.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.TextSubtitle1
|
||||||
import app.k9mail.core.ui.compose.designsystem.atom.text.TextSubtitle2
|
import app.k9mail.core.ui.compose.designsystem.atom.text.TextSubtitle2
|
||||||
import app.k9mail.ui.catalog.ui.common.list.itemDefaultPadding
|
import app.k9mail.ui.catalog.ui.common.list.itemDefaultPadding
|
||||||
|
@ -68,13 +67,6 @@ private fun LazyGridScope.textItems(
|
||||||
color = color,
|
color = color,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
item {
|
|
||||||
TextOverline(
|
|
||||||
text = annotatedString("Overline", isAnnotated),
|
|
||||||
modifier = Modifier.itemDefaultPadding(),
|
|
||||||
color = color,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun annotatedString(
|
private fun annotatedString(
|
||||||
|
|
|
@ -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")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -11,7 +11,7 @@ import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import app.k9mail.core.ui.compose.common.koin.koinPreview
|
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.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.TextSubtitle2
|
||||||
import app.k9mail.core.ui.compose.designsystem.atom.text.TextTitleLarge
|
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.K9Theme
|
||||||
|
@ -68,7 +68,7 @@ internal fun ServerCertificateView(
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(MainTheme.spacings.double))
|
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))
|
Spacer(modifier = Modifier.height(MainTheme.spacings.default))
|
||||||
|
|
||||||
Fingerprint("SHA-1", serverCertificateProperties.fingerprintSha1, fingerprintFormatter)
|
Fingerprint("SHA-1", serverCertificateProperties.fingerprintSha1, fingerprintFormatter)
|
||||||
|
|
|
@ -18,7 +18,7 @@ import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.testTag
|
import androidx.compose.ui.platform.testTag
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
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.molecule.input.TextInput
|
||||||
import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
|
import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
|
||||||
import app.k9mail.core.ui.compose.theme.K9Theme
|
import app.k9mail.core.ui.compose.theme.K9Theme
|
||||||
|
@ -61,7 +61,7 @@ internal fun DisplayOptionsContent(
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
TextOverline(
|
TextLabelSmall(
|
||||||
text = stringResource(id = R.string.account_setup_options_section_display_options),
|
text = stringResource(id = R.string.account_setup_options_section_display_options),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
|
|
@ -18,7 +18,7 @@ import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.testTag
|
import androidx.compose.ui.platform.testTag
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
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.SelectInput
|
||||||
import app.k9mail.core.ui.compose.designsystem.molecule.input.SwitchInput
|
import app.k9mail.core.ui.compose.designsystem.molecule.input.SwitchInput
|
||||||
import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
|
import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
|
||||||
|
@ -64,7 +64,7 @@ internal fun SyncOptionsContent(
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
TextOverline(
|
TextLabelSmall(
|
||||||
text = stringResource(id = R.string.account_setup_options_section_sync_options),
|
text = stringResource(id = R.string.account_setup_options_section_sync_options),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
|
Loading…
Reference in a new issue