Skip to content

Commit

Permalink
update: modify bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
ZTFtrue committed Jan 28, 2024
1 parent c813168 commit 7088b9c
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions app/src/main/java/com/ztftrue/music/ui/public/Bottom.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ 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
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
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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))
)
}
}

Expand Down

0 comments on commit 7088b9c

Please sign in to comment.