Repository navigation
Conversation
NavPage's top-level `hidesBottomBarWhenPushed` prop was previously iOS-only even though `TabBar` works on both iOS and Android: Android did not encode `hides_bottom_bar_when_pushed` in `screen_config` or track it in `Mounter` / `StackBox` / `TabBarComponent`. Match UIKit / iOS semantics on Android: - Encode `c.hides_bottom_bar_when_pushed` in `encode.rs` and read it in `Mounter.screenConfig`, propagating it onto `ScreenBox` before `StackBox.reconcile()` so pushed screens apply immediately. - Hide the visible stack's `TabBarComponent` while any screen in the stack requests it, animated with stack transitions, and prevent hidden / background retained tab stacks from controlling the bar. - Track navigation vs app visibility reasons independently in `BottomBarVisibility`, matching iOS's `bottom_bar::Visibility`.
This branch has not been deployed
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.
Description
NavPageexposeshidesBottomBarWhenPushedas a top-level prop alongsidensh/mobile's cross-platformTabBar, but only the iOS backend implemented it. On Android,screen_configskippedhides_bottom_bar_when_pushed, leavingTabBarvisible on pushed detail screens.This brings the iOS semantics to Android:
c.hides_bottom_bar_when_pushedincrates/nsh-platform-android/src/encode.rsand decodes it inMounter.screenConfig, syncing it ontoScreenBoxbeforeStackBox.reconcile()starts transitions.BottomBarVisibility(mirroring iOSbottom_bar::Visibility) andTabBarComponent.setNavigationHidden(hidden, animated)to slide the bar out/in cleanly while keepingBar.onLayoutbottom insets intact.StackBoxandMountersoTabBarstays hidden while any screen in the visible stack requests it, and background retained tab stacks cannot override the visible stack.Pairs cleanly with #3109 (
TabBar.hiddenon Android), which sharesBottomBarVisibility.How to Test
javac -d target/java-tests crates/nsh-platform-android/java/com/longbridge/nsh/BottomBarVisibility.java crates/nsh-platform-android/tests/java/com/longbridge/nsh/BottomBarVisibilityTest.java && java -cp target/java-tests com.longbridge.nsh.BottomBarVisibilityTest(ok)cargo xtask android --dev --abi arm64-v8acargo clippy --locked --no-deps -p nsh-platform-android --target aarch64-linux-android --all-features -- -D warnings -A clippy::missing-const-for-thread-local(and--no-default-features; flag needed only for hostrustc 1.100.0-beta.5lint in untouchednotifications.rs)cargo test --locked -p nsh-core(1891 unit + 2 integration + 4 doc tests passed)emulator-5554,arm64-v8a):./target/debug/nsh test crates/nsh-platform-android/tests/hides-bottom-bar.test.tsx --target android(1 passed)./target/debug/nsh test crates/nsh-platform-android/tests/scroll-to-late.test.tsx --target android(2 passed)