mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
clamp the now playing title and subtitle heights
This commit is contained in:
@@ -195,33 +195,36 @@ fun NowPlayingScreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
val density = LocalDensity.current
|
val density = LocalDensity.current
|
||||||
|
val titleHeight =
|
||||||
|
with(density) {
|
||||||
|
MaterialTheme.typography.headlineSmall.lineHeight
|
||||||
|
.toDp()
|
||||||
|
}
|
||||||
|
val subtitleHeight =
|
||||||
|
with(density) {
|
||||||
|
MaterialTheme.typography.bodyMedium.lineHeight
|
||||||
|
.toDp()
|
||||||
|
}
|
||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
verticalArrangement = Arrangement.spacedBy(6.dp),
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.padding(top = 28.dp)
|
.padding(top = 28.dp)
|
||||||
.height(
|
.height(titleHeight + 6.dp + subtitleHeight),
|
||||||
with(density) {
|
|
||||||
MaterialTheme.typography.headlineSmall.lineHeight
|
|
||||||
.toDp() +
|
|
||||||
6.dp +
|
|
||||||
MaterialTheme.typography.bodyMedium.lineHeight
|
|
||||||
.toDp()
|
|
||||||
},
|
|
||||||
),
|
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = state.item?.title.orEmpty(),
|
text = state.item?.title.orEmpty(),
|
||||||
style = titleStyle,
|
style = titleStyle,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
modifier = Modifier.basicMarquee(),
|
modifier = Modifier.height(titleHeight).basicMarquee(),
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = listOfNotNull(state.item?.artist, state.item?.album).joinToString(" • "),
|
text = listOfNotNull(state.item?.artist, state.item?.album).joinToString(" • "),
|
||||||
style = subtitleStyle,
|
style = subtitleStyle,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
modifier = Modifier.padding(top = 6.dp).basicMarquee(),
|
modifier = Modifier.height(subtitleHeight).basicMarquee(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
SeekBar(
|
SeekBar(
|
||||||
|
|||||||
Reference in New Issue
Block a user