-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[NET 10] Make public some APIs for StackNavigationManager on Android #30455
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
[NET 10] Make public some APIs for StackNavigationManager on Android #30455
Conversation
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 exposes and refines navigation APIs on Android’s StackNavigationManager, allowing customization of fragment types and improving handler initialization.
- Exposed several internal navigation properties and methods in
PublicAPI.Unshipped.txt - Changed access modifiers on
StackNavigationManagermembers and addedSetNavigationViewFragmentType - Updated
NavigationViewHandlerto lazily initialize and enforce a singleStackNavigationManagerinstance
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt | Added entries for new StackNavigationManager navigation APIs |
| src/Core/src/Platform/Android/Navigation/StackNavigationManager.cs | Made navigation members protected, added _navigationViewFragmentType, SetNavigationViewFragmentType, and updated AddFragmentDestination |
| src/Core/src/Handlers/NavigationPage/NavigationViewHandler.Android.cs | Changed StackNavigationManager property to protected with setter, using lazy init and single-instance enforcement |
Comments suppressed due to low confidence (8)
src/Core/src/Platform/Android/Navigation/StackNavigationManager.cs:226
- The new SetNavigationViewFragmentType method isn't covered by existing tests. Please add UI tests in TestCases.HostApp and TestCases.Shared.Tests to validate custom fragment type injection.
public void SetNavigationViewFragmentType(Type type)
src/Core/src/Platform/Android/Navigation/StackNavigationManager.cs:226
- After introducing SetNavigationViewFragmentType and related public APIs, please update the XML documentation in the
/docs/folder to describe the new customization feature.
public void SetNavigationViewFragmentType(Type type)
src/Core/src/Platform/Android/Navigation/StackNavigationManager.cs:36
- The NavHost property is declared as protected but is listed in PublicAPI.Unshipped.txt; consider making it public to match the exposed API surface.
protected NavHostFragment NavHost =>
src/Core/src/Platform/Android/Navigation/StackNavigationManager.cs:39
- The NavController property is declared as protected but is listed in PublicAPI.Unshipped.txt; consider making it public to match the exposed API surface.
protected NavController NavController =>
src/Core/src/Platform/Android/Navigation/StackNavigationManager.cs:42
- The FragmentNavigator property is declared as protected but is listed in PublicAPI.Unshipped.txt; consider making it public to match the exposed API surface.
protected FragmentNavigator FragmentNavigator =>
src/Core/src/Platform/Android/Navigation/StackNavigationManager.cs:45
- The NavGraph property is declared as protected but is listed in PublicAPI.Unshipped.txt; consider making it public to match the exposed API surface.
protected NavGraph NavGraph => _navGraph ??
src/Core/src/Platform/Android/Navigation/StackNavigationManager.cs:48
- The HasNavHost property is declared as protected but is listed in PublicAPI.Unshipped.txt; consider making it public to match the exposed API surface.
protected bool HasNavHost => _navHost is not null;
src/Core/src/Platform/Android/Navigation/StackNavigationManager.cs:55
- The ToolbarElement property is declared as protected but is listed in PublicAPI.Unshipped.txt; consider making it public to match the exposed API surface.
protected IToolbarElement? ToolbarElement =>
src/Core/src/Handlers/NavigationPage/NavigationViewHandler.Android.cs
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
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.
There are a few more necessary pending changes:
C:\a\_work\1\s\src\Core\src\Handlers\Toolbar\ToolbarHandler.Android.cs(81,40): error CS0122: 'StackNavigationManager.NavGraph' is inaccessible due to its protection level [C:\a\_work\1\s\src\Core\src\Core.csproj::TargetFramework=net9.0-android35.0]
C:\a\_work\1\s\src\Core\src\Platform\Android\Navigation\NavigationViewFragment.cs(72,51): error CS0122: 'StackNavigationManager.HasNavHost' is inaccessible due to its protection level [C:\a\_work\1\s\src\Core\src\Core.csproj::TargetFramework=net9.0-android35.0]
2 Error(s)
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/rebase |
0cb499f to
b5fc34f
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
@pictos needs rebase on top of net10 please |
# Conflicts: # src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt
b5fc34f to
ccc2888
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/backport to release/10.0.1xx-preview7 |
|
Started backporting to release/10.0.1xx-preview7: https://github.com/dotnet/maui/actions/runs/16578966943 |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
This is building using net9, but the merge must happens on net10 branch
Issues Fixed
Fixes #30454