mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 15:29:15 +01:00
artists: tighten the header and drop the dead star/more on track artists
Lift the type label to the artist name's inset and centre the album count on the star/more row. A credited track artist has no artists row, so its star is disabled and more does nothing; hide both there.
This commit is contained in:
@@ -363,22 +363,25 @@ fun ArtistDetailScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth().padding(start = 16.dp, end = 8.dp, top = 34.dp, bottom = 0.dp),
|
modifier = Modifier.fillMaxWidth().padding(start = 16.dp, end = 8.dp, top = TITLE_INSET),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
) {
|
) {
|
||||||
Column(Modifier.weight(1f)) {
|
|
||||||
Text(
|
Text(
|
||||||
text = artistType,
|
text = artistType,
|
||||||
style = MaterialTheme.typography.labelLarge,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
)
|
)
|
||||||
|
Row(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = pluralStringResource(R.plurals.resources_album_count, albumCount.toInt(), albumCount),
|
text = pluralStringResource(R.plurals.resources_album_count, albumCount.toInt(), albumCount),
|
||||||
style = MaterialTheme.typography.bodyLarge,
|
style = MaterialTheme.typography.bodyLarge,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
modifier = Modifier.weight(1f),
|
||||||
)
|
)
|
||||||
}
|
if (artist != null) {
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = { onToggleStar?.invoke() },
|
onClick = { onToggleStar?.invoke() },
|
||||||
enabled = onToggleStar != null,
|
enabled = onToggleStar != null,
|
||||||
@@ -403,6 +406,8 @@ fun ArtistDetailScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
itemsIndexed(albums, key = { _, album -> album.id }) { index, album ->
|
itemsIndexed(albums, key = { _, album -> album.id }) { index, album ->
|
||||||
val art = coverArt(album.coverArt, false)
|
val art = coverArt(album.coverArt, false)
|
||||||
val thumbnail = coverArt(album.coverArt, true)
|
val thumbnail = coverArt(album.coverArt, true)
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.subtracks.ui.library
|
package com.subtracks.ui.library
|
||||||
|
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
|
import androidx.compose.ui.test.assertCountEquals
|
||||||
import androidx.compose.ui.test.junit4.v2.createAndroidComposeRule
|
import androidx.compose.ui.test.junit4.v2.createAndroidComposeRule
|
||||||
|
import androidx.compose.ui.test.onAllNodesWithContentDescription
|
||||||
import androidx.compose.ui.test.onAllNodesWithText
|
import androidx.compose.ui.test.onAllNodesWithText
|
||||||
|
import androidx.compose.ui.test.onNodeWithContentDescription
|
||||||
import androidx.compose.ui.test.onNodeWithText
|
import androidx.compose.ui.test.onNodeWithText
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import com.subtracks.data.model.Artist
|
import com.subtracks.data.model.Artist
|
||||||
@@ -45,6 +48,7 @@ class ArtistDetailScreenTest {
|
|||||||
|
|
||||||
composeRule.onAllNodesWithText("Guest")[0].assertExists()
|
composeRule.onAllNodesWithText("Guest")[0].assertExists()
|
||||||
composeRule.onNodeWithText("Artist").assertExists()
|
composeRule.onNodeWithText("Artist").assertExists()
|
||||||
|
composeRule.onAllNodesWithContentDescription("More options").assertCountEquals(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -56,5 +60,6 @@ class ArtistDetailScreenTest {
|
|||||||
)
|
)
|
||||||
|
|
||||||
composeRule.onNodeWithText("Album artist").assertExists()
|
composeRule.onNodeWithText("Album artist").assertExists()
|
||||||
|
composeRule.onNodeWithContentDescription("More options").assertExists()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user