-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[.Net 10] Shell.SetNavBarVisibilityAnimationEnabled property #29279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hey there @@kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this 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 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
@@ -68,6 +68,12 @@ static void OnBackButonBehaviorPropertyChanged(BindableObject bindable, object o | |||
public static readonly BindableProperty NavBarIsVisibleProperty = | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Copilot uses AI. Check for mistakes.
/// </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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Copilot uses AI. Check for mistakes.
Description of Change
This PR introduces a new public property:
NavBarVisibilityAnimationEnabled
For 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