From 4ef103f8ae4742d69f55769f0ce863f42aeabcf3 Mon Sep 17 00:00:00 2001 From: dhf <1511447814@qq.com> Date: Mon, 31 Mar 2025 08:59:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E6=B8=85=E9=9B=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/src/main/ets/utils/DisplayUtil.ets | 14 +++-- .../base/src/main/ets/utils/WindowUtil.ets | 40 ++++++++------ .../src/main/ets/view/VideoDetail.ets | 55 ++++++++++++------- .../src/main/ets/view/VideoDetailView.ets | 12 +++- .../src/main/ets/view/VideoPlayer.ets | 36 +++++++----- 5 files changed, 94 insertions(+), 63 deletions(-) diff --git a/commons/base/src/main/ets/utils/DisplayUtil.ets b/commons/base/src/main/ets/utils/DisplayUtil.ets index 19a6d6c..b0fd762 100644 --- a/commons/base/src/main/ets/utils/DisplayUtil.ets +++ b/commons/base/src/main/ets/utils/DisplayUtil.ets @@ -17,12 +17,14 @@ import { display } from '@kit.ArkUI'; export class DisplayUtil { static getFoldCreaseRegion(): void { - if (display.isFoldable()) { - let foldRegion: display.FoldCreaseRegion = display.getCurrentFoldCreaseRegion(); - let rect: display.Rect = foldRegion.creaseRects[0]; - // Height of the avoidance area in the upper half screen and height of the avoidance area. - let creaseRegion: number[] = [px2vp(rect.top), px2vp(rect.height)]; - AppStorage.setOrCreate('creaseRegion', creaseRegion); + if(canIUse('SystemCapability.Window.SessionManager')) { + if (display.isFoldable()) { + let foldRegion: display.FoldCreaseRegion = display.getCurrentFoldCreaseRegion(); + let rect: display.Rect = foldRegion.creaseRects[0]; + // Height of the avoidance area in the upper half screen and height of the avoidance area. + let creaseRegion: number[] = [px2vp(rect.top), px2vp(rect.height)]; + AppStorage.setOrCreate('creaseRegion', creaseRegion); + } } } } \ No newline at end of file diff --git a/commons/base/src/main/ets/utils/WindowUtil.ets b/commons/base/src/main/ets/utils/WindowUtil.ets index 2547b96..a659c24 100644 --- a/commons/base/src/main/ets/utils/WindowUtil.ets +++ b/commons/base/src/main/ets/utils/WindowUtil.ets @@ -94,28 +94,32 @@ export class WindowUtil { } maximize(): void { - if (this.mainWindowClass!.getWindowStatus() === window.WindowStatusType.FLOATING) { - this.mainWindowClass!.maximize() - .then(() => { - hilog.info(0x0000, 'testTag', '%{public}s', `Succeed in maximizing the window.`); - }) - .catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag', `Failed to maximize the window. Code: ${err.code}, message: ${err.message}`, - JSON.stringify(err) ?? ''); - }); + if(canIUse('SystemCapability.Window.SessionManager')){ + if (this.mainWindowClass!.getWindowStatus() === window.WindowStatusType.FLOATING) { + this.mainWindowClass!.maximize() + .then(() => { + hilog.info(0x0000, 'testTag', '%{public}s', `Succeed in maximizing the window.`); + }) + .catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `Failed to maximize the window. Code: ${err.code}, message: ${err.message}`, + JSON.stringify(err) ?? ''); + }); + } } } recover(): void { - if (this.mainWindowClass!.getWindowStatus() === window.WindowStatusType.FULL_SCREEN) { - this.mainWindowClass!.recover() - .then(() => { - hilog.info(0x0000, 'testTag', '%{public}s', `Succeed in rovering the window.`); - }) - .catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag', `Failed to rover the window. Code: ${err.code}, message: ${err.message}`, - JSON.stringify(err) ?? ''); - }); + if(canIUse('SystemCapability.Window.SessionManager')){ + if (this.mainWindowClass!.getWindowStatus() === window.WindowStatusType.FULL_SCREEN) { + this.mainWindowClass!.recover() + .then(() => { + hilog.info(0x0000, 'testTag', '%{public}s', `Succeed in rovering the window.`); + }) + .catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `Failed to rover the window. Code: ${err.code}, message: ${err.message}`, + JSON.stringify(err) ?? ''); + }); + } } } diff --git a/features/videoDetail/src/main/ets/view/VideoDetail.ets b/features/videoDetail/src/main/ets/view/VideoDetail.ets index 3ad89e5..4f755f2 100644 --- a/features/videoDetail/src/main/ets/view/VideoDetail.ets +++ b/features/videoDetail/src/main/ets/view/VideoDetail.ets @@ -16,8 +16,16 @@ import { KeyCode } from '@kit.InputKit'; import { deviceInfo } from '@kit.BasicServicesKit'; import { display, window } from '@kit.ArkUI'; -import { AvPlayerUtil, DeviceScreen, Logger, WindowUtil, BreakpointConstants, CommonConstants, DisplayUtil, - VideoNavPathStack } from '@ohos/commons'; +import { + AvPlayerUtil, + DeviceScreen, + Logger, + WindowUtil, + BreakpointConstants, + CommonConstants, + DisplayUtil, + VideoNavPathStack +} from '@ohos/commons'; import { SelfComment } from './SelfComment'; import { AllComments } from './AllComments'; import { VideoDetailView } from './VideoDetailView'; @@ -45,20 +53,18 @@ export struct VideoDetail { return; } if (((this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_MD && this.currentHeightBreakpoint !== - BreakpointConstants.BREAKPOINT_SM) || this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG) && + BreakpointConstants.BREAKPOINT_SM) || this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG) && !this.isHalfFolded) { this.windowUtil?.setMainWindowOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); - } - else if (this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_MD && this.currentHeightBreakpoint === - BreakpointConstants.BREAKPOINT_SM) { + } else if (this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_MD && this.currentHeightBreakpoint === + BreakpointConstants.BREAKPOINT_SM) { if (this.isFullScreen) { this.windowUtil?.setMainWindowOrientation(window.Orientation.AUTO_ROTATION_LANDSCAPE_RESTRICTED); } else { this.windowUtil?.setMainWindowOrientation(window.Orientation.PORTRAIT); } - } - else if (this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM && this.currentHeightBreakpoint === - BreakpointConstants.BREAKPOINT_LG) { + } else if (this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM && this.currentHeightBreakpoint === + BreakpointConstants.BREAKPOINT_LG) { if (this.isFullScreen) { this.windowUtil?.setMainWindowOrientation(window.Orientation.AUTO_ROTATION_LANDSCAPE_RESTRICTED); } else { @@ -66,30 +72,32 @@ export struct VideoDetail { } } }; + private onHalfFoldedChange(): void { if (this.isHalfFolded) { this.windowUtil?.setMainWindowOrientation(window.Orientation.AUTO_ROTATION_LANDSCAPE_RESTRICTED); } else { if (this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_MD && this.currentHeightBreakpoint === - BreakpointConstants.BREAKPOINT_MD) { + BreakpointConstants.BREAKPOINT_MD) { this.windowUtil?.setMainWindowOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); } } } + private onFullScreenChange(): void { if (((this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_MD && this.currentHeightBreakpoint !== - BreakpointConstants.BREAKPOINT_SM) || this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG) && + BreakpointConstants.BREAKPOINT_SM) || this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG) && !this.isHalfFolded) { this.windowUtil?.setMainWindowOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); } else if (this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM && this.currentHeightBreakpoint === - BreakpointConstants.BREAKPOINT_LG) { + BreakpointConstants.BREAKPOINT_LG) { if (this.isFullScreen) { this.windowUtil?.setMainWindowOrientation(window.Orientation.AUTO_ROTATION_LANDSCAPE_RESTRICTED); } else { this.windowUtil?.setMainWindowOrientation(window.Orientation.PORTRAIT); } } else if (this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_MD && this.currentHeightBreakpoint === - BreakpointConstants.BREAKPOINT_SM && !this.isFullScreen) { + BreakpointConstants.BREAKPOINT_SM && !this.isFullScreen) { this.windowUtil?.setMainWindowOrientation(window.Orientation.PORTRAIT); } if (deviceInfo.deviceType !== CommonConstants.DEVICE_TYPE) { @@ -163,12 +171,14 @@ export struct VideoDetail { .onAreaChange((newValue: Area) => { if (newValue.width !== 0) { let height: number = DetailConstants.COMMENT_IMAGE_MIN_HEIGHT_NUMBER + (Number(newValue.width) - - DetailConstants.SIDE_BAR_MIN_WIDTH_NUMBER) / (px2vp(this.windowWidth) * DetailConstants.COMMENTS_AREA_PERCENT - - DetailConstants.SIDE_BAR_MIN_WIDTH_NUMBER) * (DetailConstants.COMMENT_IMAGE_MAX_HEIGHT_NUMBER - + DetailConstants.SIDE_BAR_MIN_WIDTH_NUMBER) / + (px2vp(this.windowWidth) * DetailConstants.COMMENTS_AREA_PERCENT - + DetailConstants.SIDE_BAR_MIN_WIDTH_NUMBER) * (DetailConstants.COMMENT_IMAGE_MAX_HEIGHT_NUMBER - DetailConstants.COMMENT_IMAGE_MIN_HEIGHT_NUMBER); let width: number = DetailConstants.COMMENT_IMAGE_MIN_WIDTH_NUMBER + (Number(newValue.width) - - DetailConstants.SIDE_BAR_MIN_WIDTH_NUMBER) / (px2vp(this.windowWidth) * DetailConstants.COMMENTS_AREA_PERCENT - - DetailConstants.SIDE_BAR_MIN_WIDTH_NUMBER) * (DetailConstants.COMMENT_IMAGE_MAX_WIDTH_NUMBER - + DetailConstants.SIDE_BAR_MIN_WIDTH_NUMBER) / + (px2vp(this.windowWidth) * DetailConstants.COMMENTS_AREA_PERCENT - + DetailConstants.SIDE_BAR_MIN_WIDTH_NUMBER) * (DetailConstants.COMMENT_IMAGE_MAX_WIDTH_NUMBER - DetailConstants.COMMENT_IMAGE_MIN_WIDTH_NUMBER); this.commentImgHeight = JSON.stringify(height); this.commentImgWidth = JSON.stringify(width); @@ -184,12 +194,13 @@ export struct VideoDetail { .layoutWeight(1) SelfComment() .visibility(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG || this.isFullScreen ? - Visibility.None : Visibility.Visible) + Visibility.None : Visibility.Visible) } .height(CommonConstants.FULL_PERCENT) .width(CommonConstants.FULL_PERCENT) } - .showSideBar(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG && !this.isFullScreen ? true : false) + .showSideBar(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG && !this.isFullScreen ? true : + false) .showControlButton(false) .autoHide(false) .sideBarPosition(SideBarPosition.End) @@ -217,8 +228,10 @@ export struct VideoDetail { if (this.avplayerState !== CommonConstants.AV_PLAYER_PLAYING_STATE) { this.avPlayerUtil!.playerStateControl(); } - if (this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_MD && display.isFoldable()) { - this.isHalfFolded = false; + if (canIUse('SystemCapability.Window.SessionManager')) { + if (this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_MD && display.isFoldable()) { + this.isHalfFolded = false; + } } }) .onKeyEvent((event?: KeyEvent) => { diff --git a/features/videoDetail/src/main/ets/view/VideoDetailView.ets b/features/videoDetail/src/main/ets/view/VideoDetailView.ets index 4115eca..816244b 100644 --- a/features/videoDetail/src/main/ets/view/VideoDetailView.ets +++ b/features/videoDetail/src/main/ets/view/VideoDetailView.ets @@ -32,10 +32,16 @@ export struct VideoDetailView { @Link relatedVideoHeight: number; @Link videoHeight: number; @State isShowingSideBar: boolean = false; - @State foldStatus: display.FoldStatus = display.getFoldStatus(); + @State foldStatus: display.FoldStatus | undefined = undefined private screenHeight: number = 0; private scroller: Scroller = new Scroller(); + aboutToAppear(): void { + if(canIUse('SystemCapability.Window.SessionManager')){ + this.foldStatus = display.getFoldStatus(); + } + } + build() { Scroll(this.scroller) { Column() { @@ -51,7 +57,7 @@ export struct VideoDetailView { .height(this.creaseRegion[1]) .width(CommonConstants.FULL_PERCENT) .visibility(this.isHalfFolded && this.isShowingSideBar && this.isFullScreen ? Visibility.Visible : - Visibility.None) + Visibility.None) FooterEpisodes({ isShowingSideBar: this.isShowingSideBar, @@ -134,7 +140,7 @@ export struct VideoDetailView { // Percentage of screen height by sliding. let offsetPercent = (Math.abs(offset) * DetailConstants.TEN) / this.screenHeight; this.relatedVideoHeight = (this.relatedVideoHeight + offsetPercent * DetailConstants.RELATED_LIST_HEIGHT) > - DetailConstants.RELATED_LIST_HEIGHT ? DetailConstants.RELATED_LIST_HEIGHT : (this.relatedVideoHeight + + DetailConstants.RELATED_LIST_HEIGHT ? DetailConstants.RELATED_LIST_HEIGHT : (this.relatedVideoHeight + offsetPercent * DetailConstants.RELATED_LIST_HEIGHT); } else { Logger.info(`No specific function`); diff --git a/features/videoDetail/src/main/ets/view/VideoPlayer.ets b/features/videoDetail/src/main/ets/view/VideoPlayer.ets index 0948b00..aa1004d 100644 --- a/features/videoDetail/src/main/ets/view/VideoPlayer.ets +++ b/features/videoDetail/src/main/ets/view/VideoPlayer.ets @@ -38,27 +38,33 @@ export struct VideoPlayer { private xComponentController: XComponentController = new XComponentController(); private onFoldStatusChange: Callback = (data: display.FoldStatus) => { this.foldStatus = data; - if (data === display.FoldStatus.FOLD_STATUS_HALF_FOLDED) { - let orientation: display.Orientation = display.getDefaultDisplaySync().orientation; - if (orientation === display.Orientation.LANDSCAPE || orientation === display.Orientation.LANDSCAPE_INVERTED) { - this.isHalfFolded = true; - // Full-screen playback. - if (!this.isFullScreen) { - this.isFullScreen = true; + if (canIUse('SystemCapability.Window.SessionManager')) { + if (data === display.FoldStatus.FOLD_STATUS_HALF_FOLDED) { + let orientation: display.Orientation = display.getDefaultDisplaySync().orientation; + if (orientation === display.Orientation.LANDSCAPE || orientation === display.Orientation.LANDSCAPE_INVERTED) { + this.isHalfFolded = true; + // Full-screen playback. + if (!this.isFullScreen) { + this.isFullScreen = true; + } } + } else { + this.isHalfFolded = false; } - } else { - this.isHalfFolded = false; } }; aboutToAppear(): void { this.avPlayerUtil = AvPlayerUtil.getInstance(); - display.on('foldStatusChange', this.onFoldStatusChange); + if (canIUse('SystemCapability.Window.SessionManager')) { + display.on('foldStatusChange', this.onFoldStatusChange); + } } aboutToDisappear(): void { - display.off('foldStatusChange'); + if (canIUse('SystemCapability.Window.SessionManager')) { + display.off('foldStatusChange'); + } } build() { @@ -150,7 +156,7 @@ export struct VideoPlayer { .margin({ top: this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? '0' : $r('app.float.icon_row_top'), bottom: this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? - $r('app.float.icon_row_bottom_sm') : $r('app.float.icon_row_bottom') + $r('app.float.icon_row_bottom_sm') : $r('app.float.icon_row_bottom') }) Blank() @@ -165,9 +171,9 @@ export struct VideoPlayer { } .margin({ top: this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? $r('app.float.button_row_top_sm') : - $r('app.float.button_row_top'), + $r('app.float.button_row_top'), bottom: this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? - $r('app.float.button_row_bottom_sm') : $r('app.float.button_row_bottom') + $r('app.float.button_row_bottom_sm') : $r('app.float.button_row_bottom') }) } .height($r('app.float.icon_button_row_height')) @@ -243,7 +249,7 @@ export struct VideoPlayer { .width($r('app.float.back_size')) .position({ x: this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG ? $r('app.float.back_position_x') : - $r('app.float.back_position_x_lg'), + $r('app.float.back_position_x_lg'), y: $r('app.float.back_position_y') }) .fillColor(Color.White) -- Gitee From 967c5bfe0ca89b5c2a2bcbad40349d16944d0224 Mon Sep 17 00:00:00 2001 From: dhf <1511447814@qq.com> Date: Wed, 2 Apr 2025 09:45:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E6=B8=85=E9=9B=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/home/src/main/ets/view/BannerView.ets | 6 +++--- features/home/src/main/ets/view/CommonView.ets | 12 ++++++------ .../videoDetail/src/main/ets/view/AllComments.ets | 2 +- .../videoDetail/src/main/ets/view/RelatedList.ets | 2 +- .../videoDetail/src/main/ets/view/SideEpisodes.ets | 2 +- .../videoDetail/src/main/ets/view/VideoDetail.ets | 2 +- .../videoDetail/src/main/ets/view/VideoPlayer.ets | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/features/home/src/main/ets/view/BannerView.ets b/features/home/src/main/ets/view/BannerView.ets index 9981a4a..9a27b63 100644 --- a/features/home/src/main/ets/view/BannerView.ets +++ b/features/home/src/main/ets/view/BannerView.ets @@ -298,9 +298,9 @@ export struct BannerView { @Component struct BannerText { - private banner: Banner = new BannerViewModel().getBannerList()[0]; - private currentWidthBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; - private index: number = 0; + public banner: Banner = new BannerViewModel().getBannerList()[0]; + public currentWidthBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; + public index: number = 0; build() { Stack() { diff --git a/features/home/src/main/ets/view/CommonView.ets b/features/home/src/main/ets/view/CommonView.ets index 1f922e8..1e490b6 100644 --- a/features/home/src/main/ets/view/CommonView.ets +++ b/features/home/src/main/ets/view/CommonView.ets @@ -18,7 +18,7 @@ import { HomeConstants } from '../constants/HomeConstants'; @Component export struct VideoImgRating { - private rating: string = ''; + public rating: string = ''; build() { Row() { @@ -46,7 +46,7 @@ export struct VideoImgRating { export struct VideoTitle { @StorageLink('currentWidthBreakpoint') currentWidthBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; @StorageLink('currentTopIndex') currentTopIndex: number = 0; - private title: ResourceStr = ''; + public title: ResourceStr = ''; build() { Text(this.title) @@ -64,7 +64,7 @@ export struct VideoTitle { export struct VideoContent { @StorageLink('currentWidthBreakpoint') currentWidthBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; @StorageLink('currentTopIndex') currentTopIndex: number = 0; - private content: ResourceStr = ''; + public content: ResourceStr = ''; build() { Text(this.content) @@ -83,7 +83,7 @@ export struct VideoContent { export struct SubtitleComponent { @StorageLink('currentWidthBreakpoint') currentWidthBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; @StorageLink('currentTopIndex') currentTopIndex: number = 0; - private title: ResourceStr = ''; + public title: ResourceStr = ''; build() { Text(this.title) @@ -102,8 +102,8 @@ export struct SubtitleComponent { @Component export struct VideoImgComponent { - private imgSrc?: Resource; - private index: number = 0; + public imgSrc?: Resource; + public index: number = 0; build() { Image(this.imgSrc ? this.imgSrc : '') diff --git a/features/videoDetail/src/main/ets/view/AllComments.ets b/features/videoDetail/src/main/ets/view/AllComments.ets index 762078e..d1f67b0 100644 --- a/features/videoDetail/src/main/ets/view/AllComments.ets +++ b/features/videoDetail/src/main/ets/view/AllComments.ets @@ -133,7 +133,7 @@ export struct AllComments { @Component struct IconImage { - private image: Resource | null = null; + public image: Resource | null = null; build() { Image(this.image) diff --git a/features/videoDetail/src/main/ets/view/RelatedList.ets b/features/videoDetail/src/main/ets/view/RelatedList.ets index 2988ad0..2414a72 100644 --- a/features/videoDetail/src/main/ets/view/RelatedList.ets +++ b/features/videoDetail/src/main/ets/view/RelatedList.ets @@ -27,7 +27,7 @@ export struct RelatedList { @State commentImgWidth: string = DetailConstants.INITIAL_COMMENT_IMAGE_WIDTH; @Link relatedVideoHeight: number; @Link videoHeight: number; - private screenHeight: number = 0; + public screenHeight: number = 0; private relatedVideoList: RelatedVideo[] = new RelatedVideoViewModel().getRelatedVideoList(); private peripheralVideoList: RelatedVideo[] = new RelatedVideoViewModel().getPeripheralVideoList(); private episodes: string[] = DetailConstants.EPISODES_LIST; diff --git a/features/videoDetail/src/main/ets/view/SideEpisodes.ets b/features/videoDetail/src/main/ets/view/SideEpisodes.ets index 7548065..96ea668 100644 --- a/features/videoDetail/src/main/ets/view/SideEpisodes.ets +++ b/features/videoDetail/src/main/ets/view/SideEpisodes.ets @@ -96,7 +96,7 @@ export struct SideEpisodes { @Component struct SideTitleText { - private content: ResourceStr = ''; + public content: ResourceStr = ''; build() { Text(this.content) diff --git a/features/videoDetail/src/main/ets/view/VideoDetail.ets b/features/videoDetail/src/main/ets/view/VideoDetail.ets index 4f755f2..4ad557a 100644 --- a/features/videoDetail/src/main/ets/view/VideoDetail.ets +++ b/features/videoDetail/src/main/ets/view/VideoDetail.ets @@ -45,7 +45,7 @@ export struct VideoDetail { @State relatedVideoHeight: number = DetailConstants.INITIAL_RELATED_VIDEO_HEIGHT; @State videoHeight: number = DetailConstants.INITIAL_VIDEO_HEIGHT; private avPlayerUtil?: AvPlayerUtil = AvPlayerUtil.getInstance(); - private screenHeight: number = 0; + public screenHeight: number = 0; private windowUtil?: WindowUtil = WindowUtil.getInstance(); private mainWindow?: window.Window; private onWindowSizeChange: (windowSize: window.Size) => void = (windowSize: window.Size) => { diff --git a/features/videoDetail/src/main/ets/view/VideoPlayer.ets b/features/videoDetail/src/main/ets/view/VideoPlayer.ets index aa1004d..6dc2d3c 100644 --- a/features/videoDetail/src/main/ets/view/VideoPlayer.ets +++ b/features/videoDetail/src/main/ets/view/VideoPlayer.ets @@ -275,7 +275,7 @@ export struct VideoPlayer { @Component struct ImgIcon { - private img?: Resource; + public img?: Resource; build() { Image(this.img ? this.img : '') @@ -287,7 +287,7 @@ struct ImgIcon { @Component struct TextButton { - private content: ResourceStr = ''; + public content: ResourceStr = ''; build() { Text(this.content) -- Gitee From d8ea171993923879026df4badd04e33261495835 Mon Sep 17 00:00:00 2001 From: dhf <1511447814@qq.com> Date: Wed, 2 Apr 2025 10:03:01 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E6=B8=85=E9=9B=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/videoDetail/src/main/ets/view/VideoDetailView.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/videoDetail/src/main/ets/view/VideoDetailView.ets b/features/videoDetail/src/main/ets/view/VideoDetailView.ets index 816244b..d71d4ad 100644 --- a/features/videoDetail/src/main/ets/view/VideoDetailView.ets +++ b/features/videoDetail/src/main/ets/view/VideoDetailView.ets @@ -33,7 +33,7 @@ export struct VideoDetailView { @Link videoHeight: number; @State isShowingSideBar: boolean = false; @State foldStatus: display.FoldStatus | undefined = undefined - private screenHeight: number = 0; + public screenHeight: number = 0; private scroller: Scroller = new Scroller(); aboutToAppear(): void { -- Gitee