mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
fix the now playing shadow ratio, CJK shift and notification icon size
This commit is contained in:
@@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.aspectRatio
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
@@ -17,8 +18,10 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import coil3.compose.AsyncImage
|
||||
import coil3.compose.AsyncImagePainter
|
||||
@@ -36,6 +39,7 @@ fun CoverArt(
|
||||
thumbnailRef: CoverArtRef? = null,
|
||||
showPlaceholder: Boolean = true,
|
||||
square: Boolean = true,
|
||||
elevation: Dp = 0.dp,
|
||||
) {
|
||||
val context = LocalPlatformContext.current
|
||||
var thumbnailLoaded by remember(ref, thumbnailRef) { mutableStateOf(false) }
|
||||
@@ -49,7 +53,13 @@ fun CoverArt(
|
||||
} else {
|
||||
1f
|
||||
}
|
||||
Box(modifier = modifier.aspectRatio(ratio).background(MaterialTheme.colorScheme.surfaceVariant)) {
|
||||
Box(
|
||||
modifier =
|
||||
modifier
|
||||
.aspectRatio(ratio)
|
||||
.shadow(elevation, RoundedCornerShape(2.dp), clip = elevation > 0.dp)
|
||||
.background(MaterialTheme.colorScheme.surfaceVariant),
|
||||
) {
|
||||
if (showPlaceholder || (failed && !thumbnailLoaded)) {
|
||||
Text(
|
||||
text = name.trim().take(1).uppercase(),
|
||||
|
||||
@@ -234,11 +234,8 @@ fun HeroHeader(
|
||||
name = name,
|
||||
thumbnailRef = thumbnailRef,
|
||||
square = false,
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxWidth(0.86f)
|
||||
.shadow(elevation = 3.dp, shape = RoundedCornerShape(2.dp), clip = false)
|
||||
.clip(RoundedCornerShape(2.dp)),
|
||||
elevation = 3.dp,
|
||||
modifier = Modifier.fillMaxWidth(0.86f),
|
||||
)
|
||||
Spacer(Modifier.height(20.dp))
|
||||
Text(
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.aspectRatio
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
@@ -45,8 +46,8 @@ import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.text.PlatformTextStyle
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
@@ -183,26 +184,40 @@ fun NowPlayingScreen(
|
||||
name = state.item?.title.orEmpty(),
|
||||
thumbnailRef = thumbnailRef,
|
||||
square = false,
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxHeight()
|
||||
.shadow(elevation = 3.dp, shape = RoundedCornerShape(2.dp), clip = false)
|
||||
.clip(RoundedCornerShape(2.dp)),
|
||||
elevation = 3.dp,
|
||||
modifier = Modifier.fillMaxHeight(),
|
||||
)
|
||||
}
|
||||
val density = LocalDensity.current
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier =
|
||||
Modifier
|
||||
.padding(top = 28.dp)
|
||||
.height(
|
||||
with(density) {
|
||||
MaterialTheme.typography.headlineSmall.lineHeight
|
||||
.toDp() +
|
||||
6.dp +
|
||||
MaterialTheme.typography.bodyMedium.lineHeight
|
||||
.toDp()
|
||||
},
|
||||
),
|
||||
) {
|
||||
Text(
|
||||
text = state.item?.title.orEmpty(),
|
||||
style = titleStyle,
|
||||
maxLines = 1,
|
||||
modifier = Modifier.basicMarquee(),
|
||||
)
|
||||
Text(
|
||||
text = listOfNotNull(state.item?.artist, state.item?.album).joinToString(" • "),
|
||||
style = subtitleStyle,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
maxLines = 1,
|
||||
modifier = Modifier.padding(top = 6.dp).basicMarquee(),
|
||||
)
|
||||
}
|
||||
Text(
|
||||
text = state.item?.title.orEmpty(),
|
||||
style = titleStyle,
|
||||
maxLines = 1,
|
||||
modifier = Modifier.padding(top = 28.dp).basicMarquee(),
|
||||
)
|
||||
Text(
|
||||
text = listOfNotNull(state.item?.artist, state.item?.album).joinToString(" • "),
|
||||
style = subtitleStyle,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
maxLines = 1,
|
||||
modifier = Modifier.padding(top = 6.dp).basicMarquee(),
|
||||
)
|
||||
var dragging by remember { mutableStateOf(false) }
|
||||
var dragPosition by remember { mutableFloatStateOf(0f) }
|
||||
Slider(
|
||||
|
||||
Reference in New Issue
Block a user