Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Center text in LoadingView, SuccessView, and ErrorView #7576

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.R
import app.k9mail.core.ui.compose.designsystem.atom.button.ButtonText
Expand Down Expand Up @@ -54,6 +55,7 @@ fun ErrorView(
)
TextSubtitle1(
text = title,
textAlign = TextAlign.Center,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.atom.CircularProgressIndicator
import app.k9mail.core.ui.compose.designsystem.atom.text.TextSubtitle1
Expand All @@ -36,7 +37,10 @@ fun LoadingView(
verticalArrangement = Arrangement.Center,
) {
if (message != null) {
TextSubtitle1(text = message)
TextSubtitle1(
text = message,
textAlign = TextAlign.Center,
)
}
Row(
modifier = Modifier.height(MainTheme.sizes.larger),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.requiredSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.atom.Icon
import app.k9mail.core.ui.compose.designsystem.atom.text.TextSubtitle1
Expand All @@ -28,7 +29,10 @@ fun SuccessView(
.then(modifier),
horizontalAlignment = Alignment.CenterHorizontally,
) {
TextSubtitle1(text = message)
TextSubtitle1(
text = message,
textAlign = TextAlign.Center,
)
Row(
modifier = Modifier.height(MainTheme.sizes.larger),
verticalAlignment = Alignment.CenterVertically,
Expand All @@ -47,7 +51,7 @@ fun SuccessView(
internal fun SuccessViewPreview() {
PreviewWithThemes {
SuccessView(
message = "Success",
message = "The app tried really hard and managed to successfully complete the operation.",
)
}
}
Loading