diff --git a/app/src/main/kotlin/com/subtracks/ui/components/Components.kt b/app/src/main/kotlin/com/subtracks/ui/components/Components.kt index c3b8a1bf..a4a55f0d 100644 --- a/app/src/main/kotlin/com/subtracks/ui/components/Components.kt +++ b/app/src/main/kotlin/com/subtracks/ui/components/Components.kt @@ -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(), diff --git a/app/src/main/kotlin/com/subtracks/ui/components/HeroDetailScaffold.kt b/app/src/main/kotlin/com/subtracks/ui/components/HeroDetailScaffold.kt index 3af16cd2..9527b357 100644 --- a/app/src/main/kotlin/com/subtracks/ui/components/HeroDetailScaffold.kt +++ b/app/src/main/kotlin/com/subtracks/ui/components/HeroDetailScaffold.kt @@ -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( diff --git a/app/src/main/kotlin/com/subtracks/ui/playback/NowPlayingScreen.kt b/app/src/main/kotlin/com/subtracks/ui/playback/NowPlayingScreen.kt index ae46b429..6e2be62d 100644 --- a/app/src/main/kotlin/com/subtracks/ui/playback/NowPlayingScreen.kt +++ b/app/src/main/kotlin/com/subtracks/ui/playback/NowPlayingScreen.kt @@ -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( diff --git a/app/src/main/res/drawable/media3_notification_small_icon.xml b/app/src/main/res/drawable/media3_notification_small_icon.xml index 8d65de57..cb1fb7ea 100644 --- a/app/src/main/res/drawable/media3_notification_small_icon.xml +++ b/app/src/main/res/drawable/media3_notification_small_icon.xml @@ -3,27 +3,22 @@ android:height="24dp" android:viewportWidth="299.84" android:viewportHeight="219.51"> - - - - - + + +