-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
NavigationView Handler for Android #2336
Conversation
internal void InitialNativeNavigationStackLoaded() | ||
{ | ||
SendNavigated(null); | ||
} | ||
|
||
internal async Task<Page> PopAsyncInner( |
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.
Moved all of this to NavigationPage.Legacy.cs
@@ -6,33 +6,28 @@ | |||
|
|||
namespace Microsoft.Maui.Handlers | |||
{ | |||
internal partial class NavigationPageHandler : | |||
internal partial class NavigationViewHandler : |
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.
This handler currently doesn't work so you can ignore changes here.
@@ -10,12 +10,16 @@ | |||
|
|||
namespace Microsoft.Maui.Handlers | |||
{ | |||
internal partial class NavigationPageHandler : | |||
internal partial class NavigationViewHandler : |
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.
This handler currently doesn't work so you can ignore changes here.
@@ -3,5 +3,6 @@ | |||
<color name="colorPrimary">#2c3e50</color> | |||
<color name="colorPrimaryDark">#1B3147</color> | |||
<color name="colorAccent">#3498db</color> | |||
<color name="colorActionMenuTextColor">#FFFFFF</color> |
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.
Currently in non Forms Shell apps this value is only settable through style attributes. The default in Forms is white so we are using white here
* upstream/main: (326 commits) Re-enable interpreter on blazor by default Determine size of auto cells in GridLayout correctly when views occupy same cell (dotnet#2391) [main] Update dependencies from xamarin/xamarin-macios (dotnet#2326) [Android] Fix Horizontal Scrollbar Visibility (dotnet#2374) Try start vs4mac with local dotnet (dotnet#2386) [workoad] include missing dependencies in the workload (dotnet#2281) Update project templates to work with safe characters (dotnet#2368) [release/6.0.1xx-rc1] Update dependencies from xamarin/xamarin-android (dotnet#2369) Update dependencies from https://github.com/xamarin/xamarin-macios build 20210903.3 (dotnet#2384) Bump manifest to use api 31 (dotnet#2366) BoxView Handlers (dotnet#2250) Implement IsTextPredictionEnabled in WinUI Editor (dotnet#1478) Implement PlaceholderColor property in EntryHandlers (dotnet#1513) Automated dotnet-format update (dotnet#2355) Show entire search bar by default and make it not collapse (dotnet#2351) Remove test cloud if def for now (dotnet#2350) Add support for JS root components in BlazorWebView (dotnet#2293) Set base viewmapper to work against IViewHandler (dotnet#2339) NavigationView Handler for Android (dotnet#2336) Update OutputType to WinExe on -windows (dotnet#2340) ...
TODO
I need to add Unit tests but otherwise ready to review
Description of Change
INavigationView
The idea with only using requests is that it forces immutable communication about navigation stack changes. Once the xplat layer requests a change that's the change that gets applied and the native layer only applies changes related to those args. Requests are also useful because you need to convey information about the navigation operation (i.e. animated) which can't be indicated through a property change.
The nice thing about doing everything through stack mutations is that it allows you to modify the stack atomically opposed to having to chain navigation operations together.
For example in XF if you want to swap out the Main Page users would typically do
Or if you want to pop down multiple pages but not to root
Where as now we can add APIs that just let users perform multiple operations in one go.
Alternative API (possibly for future PR)
NavigationManager
If users want to customize any of the behavior of navigation they can provide a custom Navigation Manager
PR Checklist
Does this PR touch anything that might affect accessibility?
If any of the above checkboxes apply to your PR, then the PR will need to provide testing to demonstrate that accessibility still works.