PlayError.ets
1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import router from '@ohos.router';
import window from '@ohos.window';
import { WindowModel } from 'wdKit';
import { devicePLSensorManager } from '../utils/devicePortLandSensor';
@Component
export struct PlayError {
@Consume message: string;
@Consume isFullScreen: boolean;
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Image($r('app.media.ic_back'))
.width($r("app.float.back_image_width"))
.height($r("app.float.back_image_width"))
.position({ x: $r("app.float.back_image_width"), y: $r("app.float.back_image_width") })
.aspectRatio(1)
.onClick(() => {
if (this.isFullScreen) {
this.isFullScreen = false;
WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);
devicePLSensorManager.devicePLSensorOn(window.Orientation.PORTRAIT);
} else {
router.back();
}
})
Text(this.message)
.width('100%')
.textAlign(TextAlign.Center)
.fontColor(Color.White)
.fontSize($r("app.float.font_size_14"))
.visibility(this.message ? Visibility.Visible : Visibility.None)
}
.width('100%')
.height('100%')
}
}