fix(android): drop AvatarShape enum (detekt MatchingDeclarationName)
DiscoverTiles.kt held only one non-composable top-level decl (`enum class AvatarShape`), so detekt wanted the file renamed. The enum had two variants discriminating circle vs. rounded; a Boolean `circular` arg is the same information with no extra cost — collapses the `when` into a one-line `if`. Two call sites updated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -30,8 +30,6 @@ import com.composables.icons.lucide.User
|
||||
import com.fabledsword.minstrel.models.ArtistSuggestionRef
|
||||
import com.fabledsword.minstrel.models.LidarrSearchResultRef
|
||||
|
||||
internal enum class AvatarShape { CIRCLE, ROUNDED }
|
||||
|
||||
@Composable
|
||||
internal fun SuggestionTile(s: ArtistSuggestionRef, onRequest: () -> Unit) {
|
||||
Row(
|
||||
@@ -41,7 +39,7 @@ internal fun SuggestionTile(s: ArtistSuggestionRef, onRequest: () -> Unit) {
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
) {
|
||||
Avatar(imageUrl = s.imageUrl, fallback = Lucide.User, shape = AvatarShape.CIRCLE)
|
||||
Avatar(imageUrl = s.imageUrl, fallback = Lucide.User, circular = true)
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text(
|
||||
text = s.name,
|
||||
@@ -78,7 +76,7 @@ internal fun ResultTile(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
) {
|
||||
Avatar(imageUrl = row.imageUrl, fallback = Lucide.Disc3, shape = AvatarShape.ROUNDED)
|
||||
Avatar(imageUrl = row.imageUrl, fallback = Lucide.Disc3, circular = false)
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text(
|
||||
text = row.name,
|
||||
@@ -107,11 +105,8 @@ internal fun ResultTile(
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Avatar(imageUrl: String, fallback: ImageVector, shape: AvatarShape) {
|
||||
val clip = when (shape) {
|
||||
AvatarShape.CIRCLE -> CircleShape
|
||||
AvatarShape.ROUNDED -> RoundedCornerShape(6.dp)
|
||||
}
|
||||
private fun Avatar(imageUrl: String, fallback: ImageVector, circular: Boolean) {
|
||||
val clip = if (circular) CircleShape else RoundedCornerShape(6.dp)
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(56.dp)
|
||||
|
||||
Reference in New Issue
Block a user