fix the now playing shadow ratio, CJK shift and notification icon size

This commit is contained in:
austinried
2026-10-04 00:29:54 +00:00
parent 92ef7bfcfb
commit 5e114f6edc
4 changed files with 65 additions and 48 deletions
@@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
@@ -17,8 +18,10 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import coil3.compose.AsyncImage import coil3.compose.AsyncImage
import coil3.compose.AsyncImagePainter import coil3.compose.AsyncImagePainter
@@ -36,6 +39,7 @@ fun CoverArt(
thumbnailRef: CoverArtRef? = null, thumbnailRef: CoverArtRef? = null,
showPlaceholder: Boolean = true, showPlaceholder: Boolean = true,
square: Boolean = true, square: Boolean = true,
elevation: Dp = 0.dp,
) { ) {
val context = LocalPlatformContext.current val context = LocalPlatformContext.current
var thumbnailLoaded by remember(ref, thumbnailRef) { mutableStateOf(false) } var thumbnailLoaded by remember(ref, thumbnailRef) { mutableStateOf(false) }
@@ -49,7 +53,13 @@ fun CoverArt(
} else { } else {
1f 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)) { if (showPlaceholder || (failed && !thumbnailLoaded)) {
Text( Text(
text = name.trim().take(1).uppercase(), text = name.trim().take(1).uppercase(),
@@ -234,11 +234,8 @@ fun HeroHeader(
name = name, name = name,
thumbnailRef = thumbnailRef, thumbnailRef = thumbnailRef,
square = false, square = false,
modifier = elevation = 3.dp,
Modifier modifier = Modifier.fillMaxWidth(0.86f),
.fillMaxWidth(0.86f)
.shadow(elevation = 3.dp, shape = RoundedCornerShape(2.dp), clip = false)
.clip(RoundedCornerShape(2.dp)),
) )
Spacer(Modifier.height(20.dp)) Spacer(Modifier.height(20.dp))
Text( Text(
@@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.CircleShape
@@ -45,8 +46,8 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.PlatformTextStyle import androidx.compose.ui.text.PlatformTextStyle
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@@ -183,18 +184,31 @@ fun NowPlayingScreen(
name = state.item?.title.orEmpty(), name = state.item?.title.orEmpty(),
thumbnailRef = thumbnailRef, thumbnailRef = thumbnailRef,
square = false, square = false,
modifier = elevation = 3.dp,
Modifier modifier = Modifier.fillMaxHeight(),
.fillMaxHeight()
.shadow(elevation = 3.dp, shape = RoundedCornerShape(2.dp), clip = false)
.clip(RoundedCornerShape(2.dp)),
) )
} }
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(
text = state.item?.title.orEmpty(), text = state.item?.title.orEmpty(),
style = titleStyle, style = titleStyle,
maxLines = 1, maxLines = 1,
modifier = Modifier.padding(top = 28.dp).basicMarquee(), modifier = Modifier.basicMarquee(),
) )
Text( Text(
text = listOfNotNull(state.item?.artist, state.item?.album).joinToString(" • "), text = listOfNotNull(state.item?.artist, state.item?.album).joinToString(" • "),
@@ -203,6 +217,7 @@ fun NowPlayingScreen(
maxLines = 1, maxLines = 1,
modifier = Modifier.padding(top = 6.dp).basicMarquee(), modifier = Modifier.padding(top = 6.dp).basicMarquee(),
) )
}
var dragging by remember { mutableStateOf(false) } var dragging by remember { mutableStateOf(false) }
var dragPosition by remember { mutableFloatStateOf(0f) } var dragPosition by remember { mutableFloatStateOf(0f) }
Slider( Slider(
@@ -3,10 +3,6 @@
android:height="24dp" android:height="24dp"
android:viewportWidth="299.84" android:viewportWidth="299.84"
android:viewportHeight="219.51"> android:viewportHeight="219.51">
<group android:scaleX="0.43"
android:scaleY="0.3147989"
android:translateX="85.4544"
android:translateY="75.20425">
<path <path
android:pathData="m23.84,-0c-12.76,0 -23.44,13 -23.65,25.12 -0.42,79.03 0,160.73 0,170.4 0,12.59 9.8,23.99 23.41,23.99l253.58,0c11.4,0 22.66,-12.38 22.66,-22.79L299.84,24.12c0,-10.8 -10.24,-23.81 -21.84,-23.81 -11.6,0 -254.16,-0.31 -254.16,-0.31zM39.05,25.28c0,0 217.71,0.71 223.67,0.71 6.07,0 12.17,6.83 12.17,12.06l0,142.25c0,8.97 -6.97,14.63 -12.48,14.64l-33.42,0.07c-5.32,0.01 -9.93,-7.19 -11.35,-10.61 -1.89,-4.55 -11.08,-25.75 -12.1,-28.1 -0.6,-1.38 -2.9,-2.83 -5.89,-2.83L98.33,153.45c-2.68,0 -4.89,2.87 -5.67,4.71 -1.12,2.66 -9.02,21.39 -11.63,27.57 -2.73,6.46 -4.37,9.06 -11.47,9.06l-30.97,0c-7.44,0 -13.69,-7.17 -13.67,-15.18l0.28,-139.51c0,-6.88 5.54,-14.83 13.85,-14.83z" android:pathData="m23.84,-0c-12.76,0 -23.44,13 -23.65,25.12 -0.42,79.03 0,160.73 0,170.4 0,12.59 9.8,23.99 23.41,23.99l253.58,0c11.4,0 22.66,-12.38 22.66,-22.79L299.84,24.12c0,-10.8 -10.24,-23.81 -21.84,-23.81 -11.6,0 -254.16,-0.31 -254.16,-0.31zM39.05,25.28c0,0 217.71,0.71 223.67,0.71 6.07,0 12.17,6.83 12.17,12.06l0,142.25c0,8.97 -6.97,14.63 -12.48,14.64l-33.42,0.07c-5.32,0.01 -9.93,-7.19 -11.35,-10.61 -1.89,-4.55 -11.08,-25.75 -12.1,-28.1 -0.6,-1.38 -2.9,-2.83 -5.89,-2.83L98.33,153.45c-2.68,0 -4.89,2.87 -5.67,4.71 -1.12,2.66 -9.02,21.39 -11.63,27.57 -2.73,6.46 -4.37,9.06 -11.47,9.06l-30.97,0c-7.44,0 -13.69,-7.17 -13.67,-15.18l0.28,-139.51c0,-6.88 5.54,-14.83 13.85,-14.83z"
android:strokeWidth="0.9" android:strokeWidth="0.9"
@@ -25,5 +21,4 @@
android:fillColor="#FFFFFFFF" android:fillColor="#FFFFFFFF"
android:fillType="nonZero" android:fillType="nonZero"
android:strokeColor="#00000000"/> android:strokeColor="#00000000"/>
</group>
</vector> </vector>