Repository navigation
Feat api adapt iphone duo - #2603
Open
wangxiaokou wants to merge 23 commits into
Open
wangxiaokou wants to merge 23 commits into
wangxiaokou wants to merge 23 commits into
Conversation
撤掉 iOS 自定义 WindowResize 通知链路,恢复 Dimensions 监听;静态交互样式外置,保留当次尺寸和安全区计算,并调整非 iOS 窗口兜底。
hiyuki
reviewed
Nov 5, 2026
| - 使用实例 `getPageId()` 获取页面身份;框架不再将内部 pageId 注入页面 id props,节点 id 与页面身份分离。 | ||
| - 应用内 Screen 提前挂载外层容器,先初始化窗口信息再触发 App 启动回调;页面内部仅保留实例和生命周期,不调用外层 HOC,也不通过 Context 判断是否重复包裹。 | ||
|
|
||
| ## 单组件窗口布局适配 {#standalone-component-layout} |
hiyuki
reviewed
Nov 5, 2026
|
|
||
| 页面身份通过实例的 `getPageId()` 获取;框架不再把内部 `pageId` 注入页面的 `id` props。`id` 仍表示调用方传入的节点标识,不能作为内部页面身份使用。 | ||
|
|
||
| ## 单组件输出的窗口布局适配 {#standalone-component-layout} |
Collaborator
There was a problem hiding this comment.
统一走pageWrapperHOC,不需要自己又弄局部方案
hiyuki
reviewed
Nov 5, 2026
| const initialWindowMetricsInset = initialWindowMetrics?.insets || {} | ||
| const navigationInsets = navigation.insets || {} | ||
| const insets = Object.assign({}, initialWindowMetricsInset, navigationInsets) | ||
| const bottom = insets.bottom || 0 |
hiyuki
reviewed
Nov 5, 2026
| const { width, height } = Dimensions.get('window') | ||
|
|
||
| const showModal = function (options = {}) { | ||
| const { width, height } = Dimensions.get('window') |
hiyuki
reviewed
Nov 5, 2026
|
|
||
| function showToast (options = {}) { | ||
| const dimensionsScreen = Dimensions.get('screen') | ||
| const dimensionsWindow = Dimensions.get('window') |
hiyuki
reviewed
Nov 5, 2026
| // 计算胶囊按钮的位置 | ||
| const top = statusBarHeight + MARGIN_TOP | ||
| const right = screenWidth - MARGIN_RIGHT | ||
| const right = (__mpx_mode__ === 'ios' ? windowWidth : screenWidth) - MARGIN_RIGHT |
hiyuki
reviewed
Nov 5, 2026
| callbacks.forEach(cb => cb(result)) | ||
| } | ||
| subscription = __mpx_mode__ === 'ios' | ||
| ? DeviceEventEmitter.addListener('mpxWindowResize', listener) |
Collaborator
There was a problem hiding this comment.
移除这个特殊逻辑,另外返回的window也统一走customDimension
hiyuki
reviewed
Nov 5, 2026
| navigation.layout = getLayoutData(headerHeight) | ||
| }) | ||
| return () => dimensionListener?.remove() | ||
| const insetsListener = __mpx_mode__ === 'ios' && ReactNative.DeviceEventEmitter.addListener('mpxSafeAreaInsetsChange', metrics => { |
hiyuki
reviewed
Nov 5, 2026
| ) | ||
| ) | ||
| if (__mpx_mode__ === 'ios') { | ||
| return createElement('RNCSafeAreaProvider', { |
hiyuki
reviewed
Nov 5, 2026
| function getLayoutData (headerHeight) { | ||
| const screenDimensions = ReactNative.Dimensions.get('screen') | ||
| const windowDimensions = ReactNative.Dimensions.get('window') | ||
| const layoutDimensions = ReactNative.Platform.OS === 'ios' ? windowDimensions : screenDimensions |
added 5 commits
November 17, 2026 20:56
This branch has not been deployed
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.
iphone duo下 api-proxy的组件和getWindowInfo适配