feat: add cross-platform NativeWindow implementation#11181
Draft
edusperoni wants to merge 3 commits intomainfrom
Draft
feat: add cross-platform NativeWindow implementation#11181edusperoni wants to merge 3 commits intomainfrom
edusperoni wants to merge 3 commits intomainfrom
Conversation
- Introduced NativeWindow class to manage platform-specific window behavior for iOS and Android. - Added interfaces and common functionality for NativeWindow, including event handling and lifecycle management. - Implemented Android-specific NativeWindow logic to wrap AppCompatActivity and manage its lifecycle. - Implemented iOS-specific NativeWindow logic to wrap UIWindowScene and UIWindow, handling view controller setup and trait collection changes. - Updated core index files to export new NativeWindow functionality.
|
View your CI Pipeline Execution ↗ for commit 50f8880
☁️ Nx Cloud last updated this comment at |
Contributor
|
Great start here, it might be helpful to setup a new demo page in toolbox or repurpose |
…ling - Refactored NativeWindow to separate platform-specific implementations for Android and iOS. - Introduced AndroidNativeWindow and IOSNativeWindow classes extending a common NativeWindow base class. - Updated lifecycle event notifications to emit events directly from NativeWindow instances instead of the Application class. - Deprecated direct event listeners on the Application class in favor of listening on NativeWindow instances. - Removed redundant index files for native-window on both Android and iOS platforms. - Enhanced type definitions for NativeWindow events and interfaces to improve clarity and maintainability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a draft POC implementation.
The goal is mostly to discuss the approach and refine it.
We introduce a new class (NativeWindow) which will handle most multi-window functions.
We slowly deprecate 'launch' event and other Application events in favor of the window events.
Ideally we also add something like:
View.getNativeWindow()so you can get the NativeWindow of a specific view. All plugins will have to adapt to this new API, but we'll provide backwards compatibility.In sum, we the following concept:
The developer can choose how to handle this. Example from my angular background:
bootstrapApplication(...)("root" services are per-window, "platform" services are shared)createComponent("root" services are shared, navigation has to be similar to modal navigation)