diff --git a/entry/src/main/ets/pages/Question1Correct.ets b/entry/src/main/ets/pages/Question1Correct.ets index dd8a97a638fcede6ecc3c20e58d65dc51bd32330..5f305af6d83b5de6dc018eb87e493080c8a652d0 100644 --- a/entry/src/main/ets/pages/Question1Correct.ets +++ b/entry/src/main/ets/pages/Question1Correct.ets @@ -17,7 +17,7 @@ export function Question1CorrectBuilder() { Question1Correct() } -// [Start Question1_correct ] +// [Start Question1_correct] @Component export struct Question1Correct { build() { @@ -39,20 +39,20 @@ export struct Question1Correct { .backgroundColor(Color.Orange) } } - // [StartExclude Question1_correct ] + // [StartExclude Question1_correct] .padding({ left: 16, right: 16 }) - // [EndExclude Question1_correct ] + // [EndExclude Question1_correct] } - // [StartExclude Question1_correct ] + // [StartExclude Question1_correct] .hideTitleBar(true) .padding({ top: AppStorage.get('statusBarHeight') ?? 0, bottom: (AppStorage.get('naviIndicatorHeight') ?? 0) + 16 }) - // [EndExclude Question1_correct ] + // [EndExclude Question1_correct] } } -// [End Question1_correct ] \ No newline at end of file +// [End Question1_correct] \ No newline at end of file diff --git a/entry/src/main/ets/pages/Question2Incorrect.ets b/entry/src/main/ets/pages/Question2Incorrect.ets index a31ad73110a90912e1e9087fc94b8f619c1d61da..5dd37c6020a45d7d059b0179f696423fac2b5e0d 100644 --- a/entry/src/main/ets/pages/Question2Incorrect.ets +++ b/entry/src/main/ets/pages/Question2Incorrect.ets @@ -20,35 +20,36 @@ import { AVPlayerUtil } from '../common/AVPlayerUtil'; export function Question2IncorrectBuilder() { Question2Incorrect() } -// [Start Question2_incorrect] +// [Start Question2Incorrect] @Component export struct Question2Incorrect { @State aspect: number = 9 / 16; // default video height/width ratio value - @State xComponentWidth: number = this.getUIContext().px2vp(display.getDefaultDisplaySync().width); - @State xComponentHeight: number = this.getUIContext().px2vp(display.getDefaultDisplaySync().width * this.aspect); + @State xComponentWidth: number = px2vp(display.getDefaultDisplaySync().width); + @State xComponentHeight: number = px2vp(display.getDefaultDisplaySync().width * this.aspect); + // [StartExclude Question2Incorrect] private xComponentController: XComponentController = new XComponentController(); private player?: AVPlayerUtil; aboutToDisappear(): void { this.player?.stopPlay(); } - // [EndExclude Question2_incorrect] + // [EndExclude Question2Incorrect] build() { NavDestination() { Stack() { XComponent({ id: 'video_player_id', type: XComponentType.SURFACE, controller: this.xComponentController }) - // [StartExclude Question2_incorrect] + // [StartExclude Question2Incorrect] .onLoad(() => { this.player = new AVPlayerUtil(); this.player.setSurfaceId(this.xComponentController.getXComponentSurfaceId()); this.player.initPlayer('testVideo2.mp4', (aspect: number) => { this.aspect = aspect; - this.xComponentHeight = this.getUIContext().px2vp(display.getDefaultDisplaySync().height); - this.xComponentWidth = this.getUIContext().px2vp(display.getDefaultDisplaySync().height * aspect); + this.xComponentHeight = px2vp(display.getDefaultDisplaySync().height); + this.xComponentWidth = px2vp(display.getDefaultDisplaySync().height * aspect); }); }) - // [EndExclude Question2_incorrect] + // [EndExclude Question2Incorrect] .width(this.xComponentWidth) .height(this.xComponentHeight) } @@ -59,4 +60,4 @@ export struct Question2Incorrect { .hideTitleBar(true) } } -// [End Question2_incorrect] \ No newline at end of file +// [End Question2Incorrect] \ No newline at end of file diff --git a/entry/src/main/ets/pages/Question6Incorrect.ets b/entry/src/main/ets/pages/Question6Incorrect.ets index 5a92ba1dfb11cc04ceb3bb147b6426b63b92d69b..97c1e675e6042a9dd05df93d146870b46d77bfee 100644 --- a/entry/src/main/ets/pages/Question6Incorrect.ets +++ b/entry/src/main/ets/pages/Question6Incorrect.ets @@ -67,7 +67,7 @@ struct CustomDialogComp1 { }) } .constraintSize({ - maxHeight: '90%' + maxHeight: '80%' }) // [StartExclude Custom_dialog_comp1] .height(400) @@ -81,6 +81,7 @@ struct CustomDialogComp1 { // [EndExclude Custom_dialog_comp1] } } +// [End Custom_dialog_comp1] @Component export struct Question6Incorrect { @@ -113,4 +114,3 @@ export struct Question6Incorrect { }) } } -// [End Custom_dialog_comp1] \ No newline at end of file diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index 6f79f46e8c81ff6252d45ca62afbe85a9b1b6c00..13112d49de49b535adb0c067f8d2c4feb662c271 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -1,5 +1,7 @@ +// [Start module_json_one] { "module": { + // [StartExclude module_json_one] "name": "entry", "type": "entry", "description": "$string:module_desc", @@ -11,9 +13,11 @@ "installationFree": false, "pages": "$profile:main_pages", "routerMap": "$profile:route_map", + // [EndExclude module_json_one] "abilities": [ { "name": "EntryAbility", + // [StartExclude module_json_one] "srcEntry": "./ets/entryability/EntryAbility.ets", "description": "$string:EntryAbility_desc", "icon": "$media:layered_image", @@ -31,9 +35,11 @@ ] } ], + // [EndExclude module_json_one] "preferMultiWindowOrientation": "landscape_auto" } ], + // [StartExclude module_json_one] "extensionAbilities": [ { "name": "EntryBackupAbility", @@ -47,6 +53,8 @@ } ] } - ] + ], + // [EndExclude module_json_one] } -} \ No newline at end of file +} +// [End module_json_one] \ No newline at end of file