feat(tipping): fade the Chats list under its title bar - #1385
Merged
Conversation
The Chats list was cut off at the title bar instead of passing under it, unlike the chat screen's message list. M2's Scaffold shortens its body by the bar heights and places it between them, so CodeScaffold could not express that placement and the chat screen carried a private ChatInputScaffold instead. CodeScaffold now takes a ScaffoldBarPlacement: Overlay leaves the Scaffold's own bar slots empty and subcomposes the bars over a full-size content, handing their measured heights back as the content's padding. Measuring both in one pass keeps the content correctly padded on the first frame; onSizeChanged gives it zero on frame one and snaps on frame two. Inset stays the default, so no other caller moves. The Chats tab uses Overlay with a background-to-transparent scrim behind AppBarWithTitle, drawn with drawBehind so the scrim's tail past the bar's bottom edge stays out of the height the list pads by. The messenger screen moves onto the same scaffold and its private one is deleted.
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.
The Chats list was cut off at the title bar instead of passing under it, unlike the chat screen's message list, which dissolves into the bar's scrim as it scrolls.
CodeScaffoldcould not express that placement. Material 2'sScaffoldshortens its body by the bar heights and places it between them, so the list can never run underneath; the chat screen worked around it with a privateChatInputScaffoldin the messenger module.CodeScaffoldnow takes aScaffoldBarPlacement. InOverlaytheScaffold's own bar slots are left empty and the bars go to a subcomposed layout inside the content slot: the bars are measured first, the content is measured at full size and placed at (0, 0), and the bars' heights come back as thePaddingValuesthe content already receives. Both are measured in the same pass, which is what keeps the content correctly padded on the first frame —onSizeChangedhands it zero on frame one and snaps on frame two, which the message list showed as a jump on every open. Background, snackbar host, drawer and FAB are untouched, andInsetremains the default, so no existing caller moves.The Chats tab uses
Overlaywith a background-to-transparent scrim behindAppBarWithTitle. The scrim is drawn withdrawBehindso its 48dp reach past the bar's bottom edge stays out of the bar's measured height, which is what the list pads by: rows begin dissolving below the title and still come to rest clear of it. The list's own start-edge gradient is dropped, since the scrim now does that work and two fades darken rows twice over.MessengerScreenmoves onto the same scaffold and its private one is deleted.ChatsTabLayoutTestpins the contract: the list spans the full height between the bars, and the first row rests below the top bar.