这个提交包含在:
徐勤民 2024-10-15 18:47:21 +08:00
父节点 d60fdcc816
当前提交 348174c4c8
共有 2 个文件被更改,包括 36 次插入3 次删除

查看文件

@ -78,9 +78,12 @@ export class WindowHelper {
WindowHelper._windowClass = value; WindowHelper._windowClass = value;
if (WindowHelper._windowClass) { if (WindowHelper._windowClass) {
let avoidArea = WindowHelper._windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR); let avoidArea = WindowHelper._windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR);
WindowHelper._bottomRectHeight = avoidArea.bottomRect.height WindowHelper._bottomRectHeight = px2vp(avoidArea.bottomRect.height)
let avoidArea2 = WindowHelper._windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_CUTOUT); let avoidArea2 = WindowHelper._windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_CUTOUT);
WindowHelper._topRectHeight = avoidArea2.topRect.height WindowHelper._topRectHeight = px2vp(avoidArea2.topRect.height)
let avoidArea3 = WindowHelper._windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM);
const a = px2vp(avoidArea3.topRect.height)
WindowHelper._topRectHeight = a > WindowHelper._topRectHeight ? a : WindowHelper._topRectHeight
// console.log('=====>', WindowHelper._topRectHeight) // console.log('=====>', WindowHelper._topRectHeight)
} }
} }
@ -106,7 +109,7 @@ export class WindowHelper {
* @returns * @returns
*/ */
public static get topRectHeight(): number { public static get topRectHeight(): number {
return WindowHelper._isFullScreen?WindowHelper._topRectHeight:0 return WindowHelper._isFullScreen ? WindowHelper._topRectHeight : 0
} }

查看文件

@ -0,0 +1,30 @@
@Preview
@Component
export struct SafeView {
@Link isLoading: boolean
@Builder
doNothingBuilder() {
}
@BuilderParam customBuilderParam: () => void = this.doNothingBuilder
build() {
Stack() {
this.customBuilderParam()
Column() {
LoadingProgress()
.color(Color.White)
.width(80).height(80)
Text('努力加载中..')
.fontSize(16)
.fontColor(Color.White)
}
.visibility(this.isLoading ? Visibility.Visible : Visibility.None)
.width('100%')
.height('100%')
.backgroundColor('#40000000')
.justifyContent(FlexAlign.Center)
}
}
}