mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 23:21:59 +01:00
give the starred badge a shadow when it sits over artwork
Over a cover the primary star was hard to read, so the album grid and artist album cells now draw it with a small circular shadow.
This commit is contained in:
@@ -16,6 +16,7 @@ import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.statusBars
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.Star
|
||||
@@ -309,13 +310,17 @@ fun StarredBadge(
|
||||
starred: Boolean,
|
||||
modifier: Modifier = Modifier,
|
||||
size: Dp = 14.dp,
|
||||
shadow: Boolean = false,
|
||||
) {
|
||||
if (starred) {
|
||||
Icon(
|
||||
imageVector = Icons.Rounded.Star,
|
||||
contentDescription = "Starred",
|
||||
tint = MaterialTheme.colorScheme.primary,
|
||||
modifier = modifier.size(size),
|
||||
modifier =
|
||||
modifier
|
||||
.then(if (shadow) Modifier.shadow(2.dp, CircleShape, clip = false) else Modifier)
|
||||
.size(size),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ fun AlbumsContent(
|
||||
StarredBadge(
|
||||
starred = album.starred != null,
|
||||
size = 16.dp,
|
||||
shadow = true,
|
||||
modifier = Modifier.align(Alignment.TopEnd).padding(6.dp),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -287,6 +287,7 @@ fun ArtistDetailScreen(
|
||||
StarredBadge(
|
||||
starred = album.starred != null,
|
||||
size = 16.dp,
|
||||
shadow = true,
|
||||
modifier = Modifier.align(Alignment.TopEnd).padding(6.dp),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user