[.Net 10] Shell.SetNavBarVisibilityAnimationEnabled property#29279
[.Net 10] Shell.SetNavBarVisibilityAnimationEnabled property#29279PureWeen merged 2 commits intodotnet:net10.0from
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new public property, NavBarVisibilityAnimationEnabled, to control whether navigation bar visibility changes are animated (currently only implemented for iOS). The key changes include:
- Adding the new attached BindableProperty and its getter/setter in Shell.cs with XML documentation.
- Updating PublicAPI.Unshipped.txt files across multiple platforms to include the new public API.
- Propagating the property in property propagation logic and using its value in iOS renderers to drive the navigation bar animation behavior.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Controls/src/Core/Shell/Shell.cs | Added NavBarVisibilityAnimationEnabled property and related API methods. |
| src/Controls/src/Core/PublicAPI/... | Updated public API definitions to reflect the newly added property. |
| src/Controls/src/Core/Internals/PropertyPropagationExtensions.cs | Propagated the new property from parent elements. |
| src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs | Updated navigation bar hide logic to use the new animation flag. |
| src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellItemRenderer.cs | Incorporated the new property in updating navigation bar appearance. |
Files not reviewed (1)
- src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt: Language not supported
| BindableProperty.CreateAttached("NavBarIsVisible", typeof(bool), typeof(Shell), true, propertyChanged: OnNavBarIsVisibleChanged); | ||
|
|
||
| /// <summary> | ||
| /// Determines if the navigation bar visibility change should be animated. |
There was a problem hiding this comment.
Consider updating the documentation to explicitly mention that the current implementation of NavBarVisibilityAnimationEnabled only applies to iOS and does not affect Android/Windows behavior.
| /// Determines if the navigation bar visibility change should be animated. | |
| /// Determines if the navigation bar visibility change should be animated. | |
| /// This property is currently only applicable on iOS and does not affect behavior on Android or Windows. |
| /// </summary> | ||
| /// <param name="obj">The object that retrieves the animation setting.</param> | ||
| /// <returns><see langword="true"/> if the animation is enabled; otherwise, <see langword="false"/>.</returns> | ||
| public static bool GetNavBarVisibilityAnimationEnabled(BindableObject obj) => (bool)obj.GetValue(NavBarVisibilityAnimationEnabledProperty); |
There was a problem hiding this comment.
Ensure that tests in TestCases.HostApp and TestCases.Shared.Tests cover the behavior of the new NavBarVisibilityAnimationEnabled property, especially to verify that navigation bar animations behave as expected on iOS.
c1c55ed to
1af5ea3
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
| navBarVisible = Shell.GetNavBarIsVisible(element); | ||
| } | ||
|
|
||
| navigationController.SetNavigationBarHidden(!navBarVisible, true); |
There was a problem hiding this comment.
Are we sure this doesn't break anything? What's the advantage of removing this line?
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs
Show resolved
Hide resolved
4f8521a to
2fde877
Compare
|
/rebase |
2fde877 to
f4bcacd
Compare
|
/rebase |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Description of Change
This PR introduces a new public property:
NavBarVisibilityAnimationEnabledFor now, the implementation only applies to iOS. If support for Android/Windows is desired in the future, it can be added separately.
NavBarVisibilityAnimationEnabled is a bool property added to Shell. It controls whether the navigation bar's visibility changes are animated. The default value is true to preserve existing behavior.
Issues Fixed
Fixes #26994
Demo
Screen.Recording.2025-06-24.at.19.49.27.mov