-
Notifications
You must be signed in to change notification settings - Fork 801
feat: Close popups and flyout on hardware back button #20764
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: master
Are you sure you want to change the base?
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 introduces functionality to handle hardware back button events by closing popups and flyouts. Key changes include:
- Refactoring the singleton pattern in SystemNavigationManager.
- Adding BackButtonIntegration for managing back button listeners.
- Creating runtime tests for back button integration.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/Uno.UWP/UI/Core/SystemNavigationManager.cs | Simplified singleton implementation via internal Instance property. |
src/Uno.UI/UI/Xaml/Application.cs | Added initialization for back button integration. |
src/Uno.UI/DirectUI/BackButton/IBackButtonListener.cs | Introduced new interface for back button listeners. |
src/Uno.UI/DirectUI/BackButton/BackButtonIntegration.cs | Implemented listener registration and cleanup using a weak reference pool. |
src/Uno.UI.RuntimeTests/Tests/DirectUI/Given_BackButtonIntegration.cs | Added tests to verify back button listener behavior. |
Comments suppressed due to low confidence (2)
src/Uno.UWP/UI/Core/SystemNavigationManager.cs:9
- The simplified singleton implementation looks clear and concise; please ensure that changing the visibility to 'internal' is intentional and does not expose the instance beyond its intended scope.
internal static SystemNavigationManager Instance { get; } = new();
src/Uno.UI/DirectUI/BackButton/BackButtonIntegration.cs:45
- [nitpick] Consider verifying that the weak reference pooling mechanism and removal pattern here meet the application's concurrency requirements, even if it's currently used on the UI thread.
WeakReferencePool.ReturnWeakReference(_listeners, weakListener);
π€ Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-20764/wasm-skia-net9/index.html |
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-20764/docs/index.html |
afb7760
to
cece779
Compare
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-20764/docs/index.html |
cece779
to
d16d83c
Compare
π€ Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-20764/wasm-skia-net9/index.html |
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-20764/docs/index.html |
π€ Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-20764/wasm-skia-net9/index.html |
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-20764/docs/index.html |
π€ Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-20764/wasm-skia-net9/index.html |
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-20764/docs/index.html |
π€ Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-20764/wasm-skia-net9/index.html |
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-20764/docs/index.html |
55bb9b8
to
e4e4aba
Compare
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-20764/docs/index.html |
π€ Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-20764/wasm-skia-net9/index.html |
GitHub Issue: closes #20757
PR Type:
What is the current behavior? π€
What is the new behavior? π
PR Checklist β
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.Other information βΉοΈ