Skip to content

Commit cc53671

Browse files
committed
fix: fixes track and artist overflowing width
1 parent 4cacc79 commit cc53671

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

app/src/main/java/com/kelsos/mbrc/features/player/PlayerScreen.kt

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import androidx.compose.foundation.layout.fillMaxSize
99
import androidx.compose.foundation.layout.fillMaxWidth
1010
import androidx.compose.foundation.layout.padding
1111
import androidx.compose.foundation.layout.size
12-
import androidx.compose.foundation.shape.RoundedCornerShape
12+
import androidx.compose.foundation.layout.wrapContentWidth
1313
import androidx.compose.material.Checkbox
1414
import androidx.compose.material.DropdownMenu
1515
import androidx.compose.material.DropdownMenuItem
@@ -42,6 +42,7 @@ import androidx.compose.ui.Alignment
4242
import androidx.compose.ui.Modifier
4343
import androidx.compose.ui.platform.LocalConfiguration
4444
import androidx.compose.ui.res.stringResource
45+
import androidx.compose.ui.text.style.TextOverflow
4546
import androidx.compose.ui.tooling.preview.Preview
4647
import androidx.compose.ui.unit.Dp
4748
import androidx.compose.ui.unit.dp
@@ -369,11 +370,22 @@ private fun TrackInfo(
369370
.fillMaxWidth(),
370371
horizontalArrangement = Arrangement.SpaceBetween
371372
) {
372-
Column {
373-
Text(text = playingTrack.title, style = MaterialTheme.typography.h6)
374-
Text(text = playingTrack.artistInfo(), style = MaterialTheme.typography.subtitle2)
373+
Column(modifier = Modifier.weight(1f)) {
374+
Text(
375+
text = playingTrack.title,
376+
style = MaterialTheme.typography.h6,
377+
maxLines = 1,
378+
overflow = TextOverflow.Ellipsis
379+
)
380+
Text(
381+
text = playingTrack.artistInfo(),
382+
style = MaterialTheme.typography.subtitle2,
383+
color = MaterialTheme.colors.onSurface.copy(0.7f),
384+
maxLines = 1,
385+
overflow = TextOverflow.Ellipsis
386+
)
375387
}
376-
Column {
388+
Column(modifier = Modifier.wrapContentWidth().padding(start = 8.dp)) {
377389
VolumeControl()
378390
}
379391
}

0 commit comments

Comments
 (0)