@mpxjs/core 2.10.4-beta.19 → 2.10.4-beta.20
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.
package/package.json
CHANGED
|
@@ -2,12 +2,14 @@ import { isObject, isArray, dash2hump, cached, isEmptyObject } from '@mpxjs/util
|
|
|
2
2
|
import { Dimensions, StyleSheet } from 'react-native'
|
|
3
3
|
|
|
4
4
|
let { width, height } = Dimensions.get('screen')
|
|
5
|
+
// TODO 临时适配折叠屏场景适配
|
|
6
|
+
const isLargeFoldableLike = (__mpx_mode__ === 'android') && (height / width < 1.5) && (width > 600)
|
|
7
|
+
if (isLargeFoldableLike) width = width / 2
|
|
5
8
|
|
|
6
9
|
Dimensions.addEventListener('change', ({ screen }) => {
|
|
7
10
|
width = screen.width
|
|
8
11
|
height = screen.height
|
|
9
12
|
})
|
|
10
|
-
|
|
11
13
|
function rpx (value) {
|
|
12
14
|
// rn 单位 dp = 1(css)px = 1 物理像素 * pixelRatio(像素比)
|
|
13
15
|
// px = rpx * (750 / 屏幕宽度)
|