feat(nav): per-entry inset for the v2 tab bar (no push jump) - #1246
Merged
Conversation
The v2 nav bar stays a single persistent overlay at the app root (seamless tab switches: one instance, sliding selection pill, one haze source). Only the reserved inset moves per entry. NavTabBarInsetEntryDecorator provides LocalTabBarPadding per NavEntry — the bar height on tab-home entries, zero on pushed/detail entries — resolved once by the entry's stable contentKey (not the live backstack, which would flip mid-animation on a replaceAll). This keeps the inset fixed for the entry's lifetime, so the outgoing tab keeps its inset through a push while the incoming detail has none — no mid-transition collapse, no jump. NewAppContent wires the decorator in and feeds it the hoisted bar's measured height via a shared State<Dp>.
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.
Summary
Fix the "content jumps on push" behaviour of the v2 tab bar without giving up the seamless, hoisted bar.
The bar stays a single persistent overlay at the app root, so tab switches are seamless — one instance, the selection pill slides, one haze source, no crossfade/remount. Only the reserved inset is made per-entry:
NavTabBarInsetEntryDecoratorprovidesLocalTabBarPaddingperNavEntry— the bar height on tab-home entries, zero on pushed/detail entries.contentKey(not the live backstack — areplaceAllremoves the outgoing entry mid-animation, which would flip the value and, because it also movedentry.Content()between branches, remount the screen).NewAppContentwires the decorator in and feeds it the hoisted bar's measured height via a sharedState<Dp>.Background: an earlier attempt moved the whole bar into the decorator (per-entry rendering). That fixed the jump but made tab switches crossfade two bars and remount the screen (bar disappeared / wallet locked up). This keeps the bar hoisted and moves only the inset.
Verified on device (emulator)
./gradlew :apps:flipcash:app:compileDebugKotlinpasses.