overlay a translucent header onto the library content

This commit is contained in:
austinried
2026-10-04 00:29:57 +00:00
parent 40f20eaa40
commit ab39fc259e
6 changed files with 125 additions and 81 deletions
@@ -96,6 +96,35 @@ class AppScreenshotTest {
composeRule.onRoot().captureRoboImage("src/test/screenshots/library_albums.png")
}
@Test
fun libraryScrolledUnderHeader() {
val albums = (1..60).map { Fixtures.albums.first().copy(id = "scrolled-$it", name = "Album $it") }
composeRule.setContent {
SubtracksTheme {
LibraryScreen(
selectedTab = LibraryTab.Albums,
onTabSelected = {},
albums = remember { flowOf(PagingData.from(albums)) }.collectAsLazyPagingItems(),
artists = remember { flowOf(PagingData.empty<Artist>()) }.collectAsLazyPagingItems(),
songs = remember { flowOf(PagingData.empty<SongListItem>()) }.collectAsLazyPagingItems(),
playlists = remember { flowOf(PagingData.empty<Playlist>()) }.collectAsLazyPagingItems(),
coverArt = { id, _ -> id?.let { CoverArtRef(it, "test:$it") } },
onAlbumClick = {},
onArtistClick = {},
onPlaylistClick = {},
onSongClick = {},
onSync = {},
onOpenSettings = {},
artwork = artworkColorsFromSeed(Color.rgb(120, 80, 200)),
)
}
}
awaitTag(ALBUM_COVER_TAG)
composeRule.onRoot().performTouchInput { swipeUp(startY = centerY + 600f, endY = centerY - 600f, durationMillis = 400) }
composeRule.waitForIdle()
composeRule.onRoot().captureRoboImage("src/test/screenshots/library_scrolled_under_header.png")
}
@Test
fun libraryArtists() {
setLibraryContent(LibraryTab.Artists)