Repository navigation
Conversation
PullToRefresh pushes the whole list down while dragging, so a playlist page showed a blank strip in the page surface colour above the blurred hero cover. Paint the artwork instead: a single backdrop under PullToRefresh, bottom-aligned with the hero and scaled up so its top edge reaches the window top, and hide the hero's own backdrop once that layer takes over so the same cover is never drawn twice at different scales. Sizes are read during layout/draw only, so dragging does not recompose the page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Opening a playlist and pulling down left a blank strip above the hero.
PullToRefreshshifts the whole list down by the header height, and the page surface colour (white in light theme) showed through that gap.This keeps the blurred cover filling the strip, growing as the user pulls, and shrinking back on release.
Screenshots
Both captured on the same device, Android 17, light theme, mid-pull.
How
PlaylistHeroStretchBackdrop, painted underPullToRefreshso the refresh indicator stays on top. Its height isgap + heroHeight(both read during layout, so dragging does not recompose the page), and the artwork is scaled around its bottom edge by(heroHeight + gap) / heroHeightwithtranslationY = gap. That puts the top edge exactly at the window top while the bottom edge stays welded to the hero.PlaylistHeroHeaderhides its own backdrop (alpha = 0) as soon as the stretch layer is active. Keeping both copies on screen shows the same cover at two different scales, which reads as a doubled, misaligned image right at the seam.CollectionPagemeasures the page top, hero top and hero height withonGloballyPositionedto drive the above.Only
LibraryPages.ktchanges. No user-facing strings, soen.json/ja.json/example.jsonare untouched. Light and dark themes both work because the layer reuses the existing banner theme surface colours and scrim.Testing
./gradlew :app:assembleDebugpasses.Unrelated:
testDebugUnitTestis currently red onmainHeads-up, not caused by this PR —
./gradlew :app:testDebugUnitTestdoes not compile onmainas-is:OfficialNeteaseClienttakes(cookie, client, webOrigin, streamOrigin, eapiOrigin, clientlogOrigin, clientlog3Origin, metadataCache), but that test still passes the cache as the 5th positional argument. Looks like a leftover from ff00e1d. Making itmetadataCache = CloudMetadataCache(...)lets the task compile.With that one line patched, on JDK 23, 344 tests run and 6 fail, all unrelated to this PR:
AuraAudioProcessorTest.antiClippingTamesInterSampleOversInBypassWhileLeavingNormalSignalsUntouched—BufferUnderflowExceptionCloudMetadataCacheTest.boundedCacheEvictsAndSelectiveInvalidationKeepsOtherPlaylists— expected null, was{"id":1}CloudMetadataCacheTest.repeatedPagesUseDiskButRefreshAndDifferentAccountsUseNetwork— expected 2, was 1OfficialNeteaseClientTest.requestsPlaybackAtOfficialEapiWithoutPuttingSessionInUrl— expected/eapi/..., was/weapi/...OfficialNeteaseClientTest.musicDetailUsesEapiFirstAndFallsBackToWeapiWhenEmptyQqMusicApiTest.customAndOfficialArtistAlbumsAndTrackListsClassifyConsistently— expected cover URL, was empty(With JDK 17 another 8 fail on
UnsupportedClassVersionError, so JDK 21+ is required to read the results.)Happy to open a separate PR for the one-line test compile fix if you want it.