@ray-js/ipc-player-integration 0.0.41-beta.1 → 0.0.42-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import React, { useContext, useEffect } from 'react';
|
|
3
|
-
import { View, setPageOrientation, Text, hideMenuButton, showMenuButton, showStatusBar, hideStatusBar, setNavigationBarBack } from '@ray-js/ray';
|
|
2
|
+
import React, { useContext, useEffect, useMemo } from 'react';
|
|
3
|
+
import { View, setPageOrientation, Text, hideMenuButton, showMenuButton, showStatusBar, hideStatusBar, setNavigationBarBack, getSystemInfoSync } from '@ray-js/ray';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { unstable_batchedUpdates as batchedUpdates } from '@ray-core/ray';
|
|
6
6
|
import { UIEventContext } from '../../ui/context';
|
|
@@ -34,6 +34,15 @@ export function FullScreen(props) {
|
|
|
34
34
|
event
|
|
35
35
|
} = useContext(UIEventContext);
|
|
36
36
|
|
|
37
|
+
// pad 设备不接管系统状态栏显隐:showStatusBar 会导致 iPad 面板布局异常;
|
|
38
|
+
// 且 pad 不支持横屏(见 ui.tsx,初始化即强制 vertical),本就不应进入全屏切换流程。
|
|
39
|
+
// 同时守住 hideStatusBar 以保持这对操作对称,避免异常路径下状态栏被隐藏后无法恢复。
|
|
40
|
+
// deviceType 在一次会话内恒定,useMemo 缓存避免每次 render 重复触发同步桥接调用
|
|
41
|
+
const isPad = useMemo(() => {
|
|
42
|
+
var _getSystemInfoSync;
|
|
43
|
+
return ((_getSystemInfoSync = getSystemInfoSync()) === null || _getSystemInfoSync === void 0 ? void 0 : _getSystemInfoSync.deviceType) === 'pad';
|
|
44
|
+
}, []);
|
|
45
|
+
|
|
37
46
|
/**
|
|
38
47
|
* 竖屏统一操作
|
|
39
48
|
*/
|
|
@@ -43,9 +52,10 @@ export function FullScreen(props) {
|
|
|
43
52
|
*/
|
|
44
53
|
const handleFull = () => {
|
|
45
54
|
hasDpCode(devId, DIRECTION_CONTROL_DP_CODE).then(hasDirectionControlDpCode => {
|
|
46
|
-
console.log('res===fullScreen handleFull');
|
|
47
55
|
hideMenuButton();
|
|
48
|
-
|
|
56
|
+
if (!isPad) {
|
|
57
|
+
hideStatusBar();
|
|
58
|
+
}
|
|
49
59
|
setNavigationBarBack({
|
|
50
60
|
type: 'custom'
|
|
51
61
|
});
|
|
@@ -108,9 +118,10 @@ export function FullScreen(props) {
|
|
|
108
118
|
setNavigationBarBack({
|
|
109
119
|
type: 'system'
|
|
110
120
|
});
|
|
111
|
-
console.log('res===fullScreen handleVertical');
|
|
112
121
|
showMenuButton();
|
|
113
|
-
|
|
122
|
+
if (!isPad) {
|
|
123
|
+
showStatusBar();
|
|
124
|
+
}
|
|
114
125
|
deleteContent('topLeft', verticalScreenId);
|
|
115
126
|
hideContent('bottomLeft', fullSmallIntercomId);
|
|
116
127
|
deleteContent('absolute', voiceIntercomId);
|
|
@@ -121,7 +132,6 @@ export function FullScreen(props) {
|
|
|
121
132
|
};
|
|
122
133
|
useEffect(() => {
|
|
123
134
|
var _handlers$screenType;
|
|
124
|
-
console.log('res===fullScreen screenType', screenType, handlers[screenType]);
|
|
125
135
|
(_handlers$screenType = handlers[screenType]) === null || _handlers$screenType === void 0 || _handlers$screenType.call(handlers);
|
|
126
136
|
}, [screenType]);
|
|
127
137
|
|