Skip to content

Commit

Permalink
Fix album info title style (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
siper authored Aug 25, 2024
1 parent 4c628e5 commit 06d25be
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -216,11 +217,15 @@ private fun Header(

Column(
verticalArrangement = Arrangement.spacedBy(4.dp),
horizontalAlignment = Alignment.CenterHorizontally
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.padding(horizontal = 24.dp)
) {
Text(
text = state.title,
style = MaterialTheme.typography.titleLarge
style = MaterialTheme.typography.titleLarge,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
textAlign = TextAlign.Center
)

val subtitle = if (state.year != null) {
Expand All @@ -231,7 +236,10 @@ private fun Header(
Text(
text = subtitle,
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.secondary
color = MaterialTheme.colorScheme.secondary,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
textAlign = TextAlign.Center
)
}

Expand Down Expand Up @@ -310,7 +318,7 @@ private fun AlbumInfoScreenPreview() {
AlbumInfoScreen(
state = AlbumInfoStateUi(
progress = false,
error = true,
error = false,
content = AlbumInfoUi(
artworkUrl = null,
title = "Test",
Expand Down

0 comments on commit 06d25be

Please sign in to comment.