Skip to content

Fix SDK35 Bottom-tab positioning#7991

Merged
d4vidi merged 1 commit into
7.x.xfrom
sdk35.bottom-tabs
Apr 3, 2025
Merged

Fix SDK35 Bottom-tab positioning#7991
d4vidi merged 1 commit into
7.x.xfrom
sdk35.bottom-tabs

Conversation

@d4vidi
Copy link
Copy Markdown
Collaborator

@d4vidi d4vidi commented Apr 3, 2025

Fix bottom-tab positioning for apps targeting SDK35 (i.e. with edge-to-edge layout by default), which otherwise does not account for the bottom window inset and is therefore laid out under the navigation bar (e.g. in the 3-button mode).

Before:
image

After:
image

(in edge-to-edge the 3-btn nav bar is [80% transparent by default])

Note: This does not in any way introduce complete support for SDK35. There are still numerous adjustments to be made (see #7978).

@yedidyak @Yoavpagir

@d4vidi d4vidi requested a review from Copilot April 3, 2025 15:14
@d4vidi d4vidi changed the base branch from master to 7.x.x April 3, 2025 15:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes bottom-tab positioning for apps targeting SDK35 by updating view controller visibility handling and adjusting status bar and tab animations to support edge-to-edge layouts. Key changes include refactoring of status bar options via a dedicated StatusBarPresenter, introduction of new visibility info data classes, and removal of deprecated imports and legacy status bar methods.

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/android/app/src/test/java/com/reactnativenavigation/mocks/TitleBarReactViewCreatorMock.java Removed duplicate static import of Mockito.mock.
lib/android/app/src/test/java/com/reactnativenavigation/BaseTest.kt Initializes feature toggles by invoking RNNFeatureToggles.init().
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/ViewControllerVisibilityInfo.kt Introduces new visibility info data classes for view controllers and top bars.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/ViewController.java Adds onSelected/onDeselected methods and replaces status bar controller with push/pop animation methods.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/StatusBarColorAnimator.kt Implements status bar color animations with translucency handling.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/Presenter.java Refactors status bar option applications to use the new StatusBarPresenter.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/statusbar/StatusBarPresenter.kt Entirely new implementation managing status bar behaviors and animations.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/TopBarController.kt Adds view visibility info and a new bindNewViewController method to animate top bar transitions.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/statusbar/StatusBarPresenter.kt Removed legacy status bar presenter interface.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/statusbar/StatusBarController.kt Removed legacy status bar controller interface.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenter.java Updates status bar animation invocations to leverage the new methods.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java Passes new view controller visibility info up through the stack controller.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewController.java Removes dependency on legacy status bar controller interface and forwards animation calls.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentPresenter.java Updates push/pop animation methods to use the new StatusBarPresenter.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java Adjusts bottom tab view handling and insets application, and updates tab selection behavior.
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabPresenter.java Removes an unused import related to bottom tabs text view.
lib/android/app/src/main/java/com/reactnativenavigation/utils/SystemUiUtils.kt Removes unused Build import and simplifies status bar color setting logic.
lib/android/app/src/main/java/com/reactnativenavigation/utils/ColorUtils.java Adds helper methods for checking lightness and setting alpha on colors.
lib/android/app/src/main/java/com/reactnativenavigation/NavigationActivity.java Initializes the new StatusBarPresenter and cleans up obsolete imports.
lib/android/app/src/main/java/com/reactnativenavigation/FeatureToggles.kt Renames and adds new feature toggles for top bar color animations.

@d4vidi d4vidi changed the title SDK35 Fix SDK35 Bottom-tab positioning Apr 3, 2025
@d4vidi d4vidi force-pushed the sdk35.bottom-tabs branch from cfe2e15 to a2e6ec6 Compare April 3, 2025 15:17
@d4vidi d4vidi self-assigned this Apr 3, 2025
@d4vidi d4vidi merged commit a9a2e8e into 7.x.x Apr 3, 2025
4 of 7 checks passed
@d4vidi d4vidi deleted the sdk35.bottom-tabs branch April 3, 2025 15:35
d4vidi added a commit that referenced this pull request Apr 3, 2025
d4vidi added a commit that referenced this pull request Aug 13, 2025
markdevocht added a commit that referenced this pull request Apr 13, 2026
* Apply color animations on tab-switching (Android-only) (#7975)

* Update package.json version to 7.44.0 [buildkite skip]

* Fix npm registry and recreate package-lock.json (#7987)

* fix(sdk35): Apply inset over bottom-tabs (#7991)

* Update package.json version to 7.45.0 [buildkite skip]

* Revert "Feat/rn76 oldarch (#7967)" (#8003)

* Update package.json version to 7.46.0 [buildkite skip]

* Mocked side-menus - support (#8017)

* Update package.json version to 7.47.0 [buildkite skip]

* Support drawer menus opening as overlay instead of pushing content in ios (#7986)

* Update package.json version to 7.48.0 [buildkite skip]

* Patch-fix some recent side-menu overlay mode changes (#8039)

* Introduce options to make a floating bottom-tabs (Android) (#8064)

* Update package.json version to 7.49.0 [buildkite skip]

* fix: top bar buttons disappeared when lock screen then unlock sreen (#8053) (#8076)

Co-authored-by: NormanWangEndeavor <145947285+NormanWangEndeavor@users.noreply.github.com>

* Update package.json version to 7.50.0 [buildkite skip]

* Back-compat edge2edge for standard layout, incl. drawBehind

* merge master into me

* first config to get it running

* bottom bar edge2edge complete?

* statusbar e2e

* cleanup

* backward compatiblility

* final touches

* Fix yarn registry to use public npmjs.org instead of internal wixpress

Made-with: Cursor

* #8080

* conflict fixes

* snapshot updates

* more updates

* update e2e android

* snapsot update

* documentation

* added

* codex fixes

* enableEdgeToEdge() is now the decision hook — override it to control when edge-to-edge activates
activateEdgeToEdge() is the action method — it does both EdgeToEdge.enable(this) and SystemUiUtils.activateEdgeToEdge(), so it's impossible to enable Android edge-to-edge without also setting RNN's internal flag
The docs now show activateEdgeToEdge() in the override example instead of EdgeToEdge.enable(this)

---------

Co-authored-by: d4vidi <amit.d4vidi@gmail.com>
Co-authored-by: mobileoss <mobileoss@wix.com>
Co-authored-by: Liat Netach <60575762+liatnetach@users.noreply.github.com>
Co-authored-by: Georgy Steshin <gosha212@gmail.com>
Co-authored-by: NormanWangEndeavor <145947285+NormanWangEndeavor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants