M1/#291: wire Postgres migrations + pgxpool #4
@@ -38,6 +38,32 @@ private const val MINI_BAR_HEIGHT_DP = 64
|
|||||||
private const val MINI_BAR_TONAL_ELEVATION_DP = 4
|
private const val MINI_BAR_TONAL_ELEVATION_DP = 4
|
||||||
private const val COVER_SIZE_DP = 48
|
private const val COVER_SIZE_DP = 48
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun MiniCover(coverUrl: String, contentDescription: String) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.size(COVER_SIZE_DP.dp)
|
||||||
|
.clip(RoundedCornerShape(FabledSwordFlatTokens.radiusSm))
|
||||||
|
.background(MaterialTheme.colorScheme.surfaceVariant),
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) {
|
||||||
|
if (coverUrl.isEmpty()) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Lucide.Music,
|
||||||
|
contentDescription = null,
|
||||||
|
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
AsyncImage(
|
||||||
|
model = coverUrl,
|
||||||
|
contentDescription = contentDescription,
|
||||||
|
modifier = Modifier.size(COVER_SIZE_DP.dp),
|
||||||
|
contentScale = ContentScale.Crop,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collapsed player bar shown above the bottom nav. Returns nothing
|
* Collapsed player bar shown above the bottom nav. Returns nothing
|
||||||
* when no track is loaded so it doesn't take screen space on a
|
* when no track is loaded so it doesn't take screen space on a
|
||||||
@@ -69,28 +95,7 @@ fun MiniPlayer(
|
|||||||
modifier = Modifier.padding(horizontal = 12.dp),
|
modifier = Modifier.padding(horizontal = 12.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
Box(
|
MiniCover(coverUrl = track.coverUrl, contentDescription = track.title)
|
||||||
modifier = Modifier
|
|
||||||
.size(COVER_SIZE_DP.dp)
|
|
||||||
.clip(RoundedCornerShape(FabledSwordFlatTokens.radiusSm))
|
|
||||||
.background(MaterialTheme.colorScheme.surfaceVariant),
|
|
||||||
contentAlignment = Alignment.Center,
|
|
||||||
) {
|
|
||||||
if (track.coverUrl.isEmpty()) {
|
|
||||||
Icon(
|
|
||||||
imageVector = Lucide.Music,
|
|
||||||
contentDescription = null,
|
|
||||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
AsyncImage(
|
|
||||||
model = track.coverUrl,
|
|
||||||
contentDescription = track.title,
|
|
||||||
modifier = Modifier.size(COVER_SIZE_DP.dp),
|
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Spacer(Modifier.width(12.dp))
|
Spacer(Modifier.width(12.dp))
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
Reference in New Issue
Block a user