Skip to content

Commit

Permalink
Remove TextCaption and replace by TextBodySmall
Browse files Browse the repository at this point in the history
  • Loading branch information
wmontwe committed Apr 23, 2024
1 parent 31b69be commit c422161
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
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.TextCaption
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodySmall
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.ui.catalog.ui.common.list.itemDefaultPadding
import app.k9mail.ui.catalog.ui.common.list.sectionHeaderItem
Expand Down Expand Up @@ -64,6 +64,6 @@ private fun IconItem(
tint = Color.Magenta,
)
}
TextCaption(text = name)
TextBodySmall(text = name)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.designsystem.atom.image.FixedScaleImage
import app.k9mail.core.ui.compose.designsystem.atom.text.TextCaption
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodySmall
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.ui.catalog.ui.common.list.itemDefaultPadding
import app.k9mail.ui.catalog.ui.common.list.sectionHeaderItem
Expand Down Expand Up @@ -140,6 +140,6 @@ private fun FixedScaleImageView(
allowOverflow = allowOverflow,
)
}
TextCaption(text = description)
TextBodySmall(text = description)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import app.k9mail.core.ui.compose.designsystem.atom.Checkbox
import app.k9mail.core.ui.compose.designsystem.atom.Switch
import app.k9mail.core.ui.compose.designsystem.atom.text.TextCaption
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodySmall
import app.k9mail.ui.catalog.ui.common.list.itemDefaultPadding
import app.k9mail.ui.catalog.ui.common.list.sectionHeaderItem

Expand Down Expand Up @@ -50,7 +50,7 @@ private fun LazyGridScope.captionItem(
modifier = Modifier.itemDefaultPadding(),
) {
content()
TextCaption(text = caption)
TextBodySmall(text = caption)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
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.TextCaption
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline1
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline2
import app.k9mail.core.ui.compose.designsystem.atom.text.TextHeadline3
Expand Down Expand Up @@ -102,13 +101,6 @@ private fun LazyGridScope.textItems(
color = color,
)
}
item {
TextCaption(
text = annotatedString("Caption", isAnnotated),
modifier = Modifier.itemDefaultPadding(),
color = color,
)
}
item {
TextOverline(
text = annotatedString("Overline", isAnnotated),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyGridScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import app.k9mail.core.ui.compose.designsystem.atom.text.TextCaption
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodySmall
import app.k9mail.core.ui.compose.theme.MainTheme

fun LazyGridScope.sectionInfoItem(
Expand All @@ -23,7 +23,7 @@ fun LazyGridScope.sectionInfoItem(
),
horizontalAlignment = Alignment.CenterHorizontally,
) {
TextCaption(
TextBodySmall(
text = text,
)
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import app.k9mail.core.ui.compose.common.annotation.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.atom.button.ButtonFilled
import app.k9mail.core.ui.compose.designsystem.atom.text.TextCaption
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodySmall
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.feature.account.oauth.R

Expand All @@ -25,7 +25,7 @@ internal fun SignInView(
verticalArrangement = Arrangement.spacedBy(MainTheme.spacings.double),
modifier = modifier,
) {
TextCaption(
TextBodySmall(
text = stringResource(id = R.string.account_oauth_sign_in_description),
textAlign = TextAlign.Center,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package app.k9mail.feature.account.oauth.ui

import app.k9mail.core.ui.compose.testing.ComposeTest
import app.k9mail.core.ui.compose.testing.setContent
import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.core.ui.compose.testing.setContentWithTheme
import app.k9mail.feature.account.common.domain.entity.AuthorizationState
import app.k9mail.feature.account.oauth.domain.entity.OAuthResult
import app.k9mail.feature.account.oauth.ui.AccountOAuthContract.Effect
Expand All @@ -22,13 +21,11 @@ class AccountOAuthViewKtTest : ComposeTest() {
var oAuthResult: OAuthResult? = null
val authorizationState = AuthorizationState()

setContent {
ThunderbirdTheme {
AccountOAuthView(
onOAuthResult = { oAuthResult = it },
viewModel = viewModel,
)
}
setContentWithTheme {
AccountOAuthView(
onOAuthResult = { oAuthResult = it },
viewModel = viewModel,
)
}

assertThat(oAuthResult).isNull()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodyLarge
import app.k9mail.core.ui.compose.designsystem.atom.text.TextCaption
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodySmall
import app.k9mail.core.ui.compose.designsystem.molecule.input.SelectInput
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
Expand Down Expand Up @@ -106,7 +106,7 @@ fun SpecialFoldersFormContent(
}

item {
TextCaption(
TextBodySmall(
text = stringResource(id = R.string.account_setup_special_folders_form_description_automatic),
modifier = Modifier.padding(defaultItemPadding()),
)
Expand Down

0 comments on commit c422161

Please sign in to comment.