修复主题背景覆盖不全的问题

This commit is contained in:
lyswhut 2023-10-04 15:18:02 +08:00
parent a53f7aa37f
commit fd7c86d687
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,7 @@
### 优化
- 添加是否忽略电池优化检查用于提醒用户添加白名单确保APP后台播放稳定性
### 修复
- 修复主题背景覆盖不全的问题

View File

@ -1,4 +1,4 @@
import { Dimensions } from 'react-native'
import { Dimensions, StatusBar } from 'react-native'
import { getWindowSize } from './nativeModules/utils'
export type SizeHandler = (size: { width: number, height: number }) => void
@ -24,7 +24,7 @@ export const windowSizeTools = {
if (!size.width) return
const scale = Dimensions.get('screen').scale
size.width = Math.trunc(size.width / scale)
size.height = Math.trunc(size.height / scale)
size.height = Math.trunc(size.height / scale) + (StatusBar.currentHeight ?? 0)
this.size = size
for (const handler of this.listeners) handler(size)
})
@ -33,7 +33,7 @@ export const windowSizeTools = {
if (size.width) {
const scale = Dimensions.get('screen').scale
size.width = Math.trunc(size.width / scale)
size.height = Math.trunc(size.height / scale)
size.height = Math.trunc(size.height / scale) + (StatusBar.currentHeight ?? 0)
this.size = size
} else {
const window = Dimensions.get('window')
@ -42,7 +42,7 @@ export const windowSizeTools = {
height: window.height,
}
}
console.log('init windowSizeTools')
// console.log('init windowSizeTools')
return size
},
}