监听屏幕变化
2025-04-21 本文已影响0人
wl520mxj
this.windowClass.on('windowStatusChange',data=> {
if(data=== window.WindowStatusType.FLOATING) {
this.topSafeHeight =
px2vp(this.windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height);
}else{
this.topSafeHeight =0;
}
})
windowClass.on('avoidAreaChange',(data) =>{
if(data.type==window.AvoidAreaType.TYPE_SYSTEM) {
this.topSafeHeight=px2vp(data.area.topRect.height)
}
})
console.info('Succeeded in obtaining the top window. Data: '+JSON.stringify(data));
});