diff --git a/app/src/main/java/com/ztftrue/music/ui/public/Bottom.kt b/app/src/main/java/com/ztftrue/music/ui/public/Bottom.kt index 0d755b0..8fe4fa2 100644 --- a/app/src/main/java/com/ztftrue/music/ui/public/Bottom.kt +++ b/app/src/main/java/com/ztftrue/music/ui/public/Bottom.kt @@ -4,6 +4,7 @@ import android.graphics.Bitmap import android.support.v4.media.session.PlaybackStateCompat import androidx.compose.foundation.Image import androidx.compose.foundation.clickable +import androidx.compose.foundation.horizontalScroll import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.aspectRatio @@ -11,6 +12,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -20,8 +22,10 @@ import androidx.compose.runtime.key import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import androidx.media3.common.util.UnstableApi @@ -50,10 +54,11 @@ fun Bottom(musicViewModel: MusicViewModel, navController: NavController) { Row( Modifier .fillMaxWidth() - .height(50.dp) + .height(60.dp) ) { Row( - modifier = modifier + modifier = modifier, + verticalAlignment = Alignment.CenterVertically, ) { key(musicViewModel.currentPlay.value) { Image( @@ -62,17 +67,28 @@ fun Bottom(musicViewModel: MusicViewModel, navController: NavController) { ), contentDescription = "song cover", modifier = Modifier - .width(50.dp) - .height(50.dp) + .width(60.dp) + .height(60.dp) .aspectRatio(1f), ) + val configuration = LocalConfiguration.current Column( Modifier - .padding(start = 5.dp, end = 5.dp) - .fillMaxWidth(0.5f) + .padding(start = 5.dp, end = 5.dp, top = 5.dp, bottom = 5.dp) + .width((configuration.screenWidthDp - 220).dp) ) { - Text(text = currentMusic.name, color = MaterialTheme.colorScheme.onBackground) - Text(text = currentMusic.artist, color = MaterialTheme.colorScheme.onBackground) + Text( + text = currentMusic.name, + color = MaterialTheme.colorScheme.onBackground, + modifier = Modifier.horizontalScroll( + rememberScrollState(0) + ) + ) + Text( + text = currentMusic.artist, + color = MaterialTheme.colorScheme.onBackground, + modifier = Modifier.horizontalScroll(rememberScrollState(0)) + ) } }