mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 15:29:15 +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.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.statusBars
|
import androidx.compose.foundation.layout.statusBars
|
||||||
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.rounded.Star
|
import androidx.compose.material.icons.rounded.Star
|
||||||
@@ -309,13 +310,17 @@ fun StarredBadge(
|
|||||||
starred: Boolean,
|
starred: Boolean,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
size: Dp = 14.dp,
|
size: Dp = 14.dp,
|
||||||
|
shadow: Boolean = false,
|
||||||
) {
|
) {
|
||||||
if (starred) {
|
if (starred) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Rounded.Star,
|
imageVector = Icons.Rounded.Star,
|
||||||
contentDescription = "Starred",
|
contentDescription = "Starred",
|
||||||
tint = MaterialTheme.colorScheme.primary,
|
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(
|
StarredBadge(
|
||||||
starred = album.starred != null,
|
starred = album.starred != null,
|
||||||
size = 16.dp,
|
size = 16.dp,
|
||||||
|
shadow = true,
|
||||||
modifier = Modifier.align(Alignment.TopEnd).padding(6.dp),
|
modifier = Modifier.align(Alignment.TopEnd).padding(6.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,6 +287,7 @@ fun ArtistDetailScreen(
|
|||||||
StarredBadge(
|
StarredBadge(
|
||||||
starred = album.starred != null,
|
starred = album.starred != null,
|
||||||
size = 16.dp,
|
size = 16.dp,
|
||||||
|
shadow = true,
|
||||||
modifier = Modifier.align(Alignment.TopEnd).padding(6.dp),
|
modifier = Modifier.align(Alignment.TopEnd).padding(6.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user