diff --git a/VideoProcessBaseWeb/entry/src/main/ets/pages/Index.ets b/VideoProcessBaseWeb/entry/src/main/ets/pages/Index.ets index 01ebfb4269ae428f2f75853f12e57c0f1e44de9b..ac55991ca2fb4a8012fde24b4262f52791a9bc42 100644 --- a/VideoProcessBaseWeb/entry/src/main/ets/pages/Index.ets +++ b/VideoProcessBaseWeb/entry/src/main/ets/pages/Index.ets @@ -22,46 +22,38 @@ import { Constants } from '../common/Constants'; import { WebDownloadManager } from '../utils/WebDownloadManager'; import { downloadControlBuilder } from '../view/DownloadControlView'; import { customPopupMenuBuilder, getOffset } from '../view/CustomPopupMenu'; - +// [Start bind_pop] const uiContext: UIContext | undefined = AppStorage.get('uiContext'); let context = uiContext!.getHostContext() - // [Start index] // [Start is_full] -// [Start bind_pop] -// [Start is_show1] -// [Start component] +// [Start is_show] @Entry @Component struct Index { - // [End is_full] - // [End index] - - // [ index] + // [StartExclude index] + // [StartExclude is_full] @State isShow: boolean = false; - // [End bind_pop] // [StartExclude bind_pop] - // [StartExclude is_show1] - // [StartExclude component] + // [StartExclude is_show] @State pressPosY: number = 0; @State pressPosX: number = 0; @StorageProp(Constants.SYSTEM_LANGUAGE_KEY) language: string = ''; private result: WebContextMenuResult | null = null; private webController: webview.WebviewController = new webview.WebviewController(); - // [Start is_full] + // [EndExclude is_full] private isFullScreen: boolean = false; private handler: FullScreenExitHandler | null = null; - // [End is_full] // [StartExclude is_full] private linkUrl: string = ''; private webWidth: number = 0; private webHeight: number = 0; + // [EndExclude index] - // [Start index] private windowClass: window.Window | null = null; private context: common.UIAbilityContext = context as common.UIAbilityContext; - // [End index] + // [StartExclude index] private manager: WebDownloadManager = WebDownloadManager.getInstance(); private ctx: UIContext = this.getUIContext(); @@ -111,7 +103,7 @@ struct Index { this.isShow = !this.isShow; }; - // [Start index] + // [EndExclude index] aboutToAppear(): void { window.getLastWindow(this.context).then((windowClass) => this.windowClass = windowClass); // [StartExclude index] @@ -131,7 +123,7 @@ struct Index { this.windowClass?.setPreferredOrientation(orientation); } - // [End index] + // [StartExclude index] // [Start on_back_press] onBackPress(): boolean | void { if (this.isFullScreen && this.handler) { @@ -140,55 +132,52 @@ struct Index { } return false; } - // [End on_back_press] - // [Start index] + // [EndExclude index] // [EndExclude is_full] - // [Start is_full] // [EndExclude bind_pop] - // [EndExclude is_show1] - // [EndExclude component] + // [EndExclude is_show] + build() { // [StartExclude index] Column() { // [Start raw_file] + // [Start full_exit] Web({ src: $rawfile(/zh/.test(this.language) ? 'index_cn.html' : 'index_en.html'), controller: this.webController }) + // [StartExclude full_exit] // [StartExclude is_full] // [StartExclude raw_file] // [StartExclude bind_pop] - // [StartExclude is_show1] - // [StartExclude component] + // [StartExclude is_show] .zoomAccess(false) .width('100%') .height('100%') + // [EndExclude raw_file] + .expandSafeArea([SafeAreaType.SYSTEM]) + // [End raw_file] .onAreaChange((oldArea, newArea) => { this.webWidth = newArea.width as number; this.webHeight = newArea.height as number; }) - // [EndExclude is_show1] - // [EndExclude component] + // [EndExclude is_show] .onContextMenuShow((event) => { if (!event) { return false; } - // [StartExclude is_show1] - // [StartExclude component] + // [StartExclude is_show] this.result = event.result; this.pressPosX = this.getUIContext().px2vp(event.param.x()); this.pressPosY = this.getUIContext().px2vp(event.param.y()); - // [EndExclude is_show1] - // [EndExclude component] + // [EndExclude is_show] this.linkUrl = event.param.getSourceUrl(); this.isShow = true; return true; }) + // [StartExclude is_show] // [EndExclude bind_pop] - // [Start bind_pop] - // [StartExclude is_show1] - // [StartExclude component] .bindPopup(this.isShow, { builder: customPopupMenuBuilder( this.linkUrl, @@ -208,7 +197,6 @@ struct Index { } } }) - // [End bind_pop] // [StartExclude bind_pop] // [EndExclude is_full] .onFullScreenEnter((event) => { @@ -216,20 +204,22 @@ struct Index { this.changeOrientation(window.Orientation.LANDSCAPE); this.isFullScreen = true; }) - // [EndExclude raw_file] + // [StartExclude is_full] + // [EndExclude full_exit] .onFullScreenExit(() => { this.changeOrientation(window.Orientation.PORTRAIT); this.isFullScreen = false; }) - // [End raw_file] + // [EndExclude is_full] + // [End full_exit] // [EndExclude bind_pop] - // [EndExclude is_show1] - // [EndExclude component] + // [EndExclude is_show] + } - // [EndExclude index] } - // [End is_full] - // [End index] + // [EndExclude index] } -// [End is_show1] -// [End component] \ No newline at end of file +// [End is_full] +// [End index] +// [End bind_pop] +// [End is_show]