Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: fix: CardMediaInfo删除业务代码 feat: 1、直播详情页面 状态栏处理 feat: 1、直播详情页面 状态栏处理 图集状态栏颜色修改 fix(图集):顶部底部适配 替换icon 意图框架拉起,需要网络库的初始化。这里调整下相关初始化位置。 fix(多图):顶部底部适配 添加状态栏隐藏接口
Showing
14 changed files
with
58 additions
and
66 deletions
| @@ -135,6 +135,13 @@ export class WindowModel { | @@ -135,6 +135,13 @@ export class WindowModel { | ||
| 135 | }) | 135 | }) |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | + /** | ||
| 139 | + * 状态栏显示设置 | ||
| 140 | + */ | ||
| 141 | + setSpecificSystemBarEnabled(visible: boolean) { | ||
| 142 | + this.windowClass?.setSpecificSystemBarEnabled('status', visible) | ||
| 143 | + } | ||
| 144 | + | ||
| 138 | setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) { | 145 | setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) { |
| 139 | this.windowClass?.setWindowSystemBarEnable(names) | 146 | this.windowClass?.setWindowSystemBarEnable(names) |
| 140 | } | 147 | } |
| @@ -93,7 +93,8 @@ export struct CardMediaInfo { | @@ -93,7 +93,8 @@ export struct CardMediaInfo { | ||
| 93 | .fontFamily('BebasNeue') | 93 | .fontFamily('BebasNeue') |
| 94 | 94 | ||
| 95 | } | 95 | } |
| 96 | - } .margin({ left: 68,top: 135}) | 96 | + } |
| 97 | + // .margin({ left: 68,top: 135}) | ||
| 97 | } else if (this.contentDTO.objectType === '2') { | 98 | } else if (this.contentDTO.objectType === '2') { |
| 98 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 99 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 99 | // 显示直播信息 | 100 | // 显示直播信息 |
| @@ -191,7 +192,7 @@ export struct CardMediaInfo { | @@ -191,7 +192,7 @@ export struct CardMediaInfo { | ||
| 191 | .mediaTextImgtype() | 192 | .mediaTextImgtype() |
| 192 | .fontFamily('BebasNeue') | 193 | .fontFamily('BebasNeue') |
| 193 | } | 194 | } |
| 194 | - .margin({ left: 80,top: 55}) | 195 | + // .margin({ left: 80,top: 55}) |
| 195 | 196 | ||
| 196 | } else if (this.contentDTO.objectType === '13') { | 197 | } else if (this.contentDTO.objectType === '13') { |
| 197 | // 显示音频信息 | 198 | // 显示音频信息 |
| @@ -3,7 +3,6 @@ import { display, router } from '@kit.ArkUI'; | @@ -3,7 +3,6 @@ import { display, router } from '@kit.ArkUI'; | ||
| 3 | import { ImageItemView } from '../components/view/ImageItemView'; | 3 | import { ImageItemView } from '../components/view/ImageItemView'; |
| 4 | import { ImageDownloadComponent } from '../components/ImageDownloadComponent'; | 4 | import { ImageDownloadComponent } from '../components/ImageDownloadComponent'; |
| 5 | import { Action } from 'wdBean'; | 5 | import { Action } from 'wdBean'; |
| 6 | -import { WindowModel } from 'wdKit/Index'; | ||
| 7 | 6 | ||
| 8 | const TAG = 'MultiPictureListPage'; | 7 | const TAG = 'MultiPictureListPage'; |
| 9 | 8 | ||
| @@ -20,11 +19,11 @@ export struct MultiPictureListPage { | @@ -20,11 +19,11 @@ export struct MultiPictureListPage { | ||
| 20 | @State picHeight: number = 0 | 19 | @State picHeight: number = 0 |
| 21 | @State isEnableSwipe: boolean = true; | 20 | @State isEnableSwipe: boolean = true; |
| 22 | @State currentUrl: string = '' | 21 | @State currentUrl: string = '' |
| 23 | - | 22 | + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 23 | + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 24 | // @Provide bgc: Color = Color.White; | 24 | // @Provide bgc: Color = Color.White; |
| 25 | 25 | ||
| 26 | aboutToAppear(): void { | 26 | aboutToAppear(): void { |
| 27 | - this.openFullScreen() | ||
| 28 | //获取宽高尺寸 | 27 | //获取宽高尺寸 |
| 29 | this.screenWidth = this.displayTool.width | 28 | this.screenWidth = this.displayTool.width |
| 30 | // this.picWidth = this.screenWidth - vp2px(52) | 29 | // this.picWidth = this.screenWidth - vp2px(52) |
| @@ -57,7 +56,6 @@ export struct MultiPictureListPage { | @@ -57,7 +56,6 @@ export struct MultiPictureListPage { | ||
| 57 | if (this.photoList && this.photoList?.length > 0) { | 56 | if (this.photoList && this.photoList?.length > 0) { |
| 58 | Swiper(this.swiperController) { | 57 | Swiper(this.swiperController) { |
| 59 | ForEach(this.photoList, (item: PhotoListBean) => { | 58 | ForEach(this.photoList, (item: PhotoListBean) => { |
| 60 | - // MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) | ||
| 61 | ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe }) | 59 | ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe }) |
| 62 | }) | 60 | }) |
| 63 | } | 61 | } |
| @@ -135,36 +133,13 @@ export struct MultiPictureListPage { | @@ -135,36 +133,13 @@ export struct MultiPictureListPage { | ||
| 135 | } | 133 | } |
| 136 | .width('100%') | 134 | .width('100%') |
| 137 | .height('100%') | 135 | .height('100%') |
| 138 | - // .padding({top:$r('app.float.margin_44')}) | 136 | + .padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`}) |
| 139 | .backgroundColor(Color.Black) | 137 | .backgroundColor(Color.Black) |
| 140 | .id('e_picture_container') | 138 | .id('e_picture_container') |
| 141 | - // 设置顶部绘制延伸到状态栏 | ||
| 142 | - // 设置底部绘制延伸到导航条 | ||
| 143 | - } | ||
| 144 | - | ||
| 145 | - /** | ||
| 146 | - * 开启沉浸式 | ||
| 147 | - * TODO:颜色待根据业务接口修改 | ||
| 148 | - */ | ||
| 149 | - openFullScreen() { | ||
| 150 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | ||
| 151 | - // WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 152 | - // WindowModel.shared.setWindowSystemBarEnable([]) | ||
| 153 | } | 139 | } |
| 154 | 140 | ||
| 155 | aboutToDisappear(): void { | 141 | aboutToDisappear(): void { |
| 156 | console.log(TAG, 'aboutToDisappear') | 142 | console.log(TAG, 'aboutToDisappear') |
| 157 | - this.closeFullScreen() | ||
| 158 | - } | ||
| 159 | - | ||
| 160 | - /** | ||
| 161 | - * 关闭沉浸式 | ||
| 162 | - * TODO:颜色待根据业务接口修改 | ||
| 163 | - */ | ||
| 164 | - closeFullScreen() { | ||
| 165 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 166 | - // WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 167 | - // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation']) | ||
| 168 | } | 143 | } |
| 169 | 144 | ||
| 170 | onBackPress(): boolean | void { | 145 | onBackPress(): boolean | void { |
| @@ -172,7 +147,5 @@ export struct MultiPictureListPage { | @@ -172,7 +147,5 @@ export struct MultiPictureListPage { | ||
| 172 | } | 147 | } |
| 173 | 148 | ||
| 174 | private onBack() { | 149 | private onBack() { |
| 175 | - // 提前设置,否则返回的页面展示有问题(有时延) | ||
| 176 | - this.closeFullScreen() | ||
| 177 | } | 150 | } |
| 178 | } | 151 | } |
| @@ -4,7 +4,7 @@ import router from '@ohos.router'; | @@ -4,7 +4,7 @@ import router from '@ohos.router'; | ||
| 4 | 4 | ||
| 5 | import { DetailPlayLivePage } from './DetailPlayLivePage'; | 5 | import { DetailPlayLivePage } from './DetailPlayLivePage'; |
| 6 | import { DetailPlayVLivePage } from './DetailPlayVLivePage'; | 6 | import { DetailPlayVLivePage } from './DetailPlayVLivePage'; |
| 7 | -import { DateTimeUtils, Logger, ToastUtils } from 'wdKit/Index'; | 7 | +import { DateTimeUtils, Logger, ToastUtils, WindowModel } from 'wdKit/Index'; |
| 8 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; | 8 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; |
| 9 | import { PictureLoading } from '../widgets/vertical/PictureLoading'; | 9 | import { PictureLoading } from '../widgets/vertical/PictureLoading'; |
| 10 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; | 10 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; |
| @@ -26,6 +26,8 @@ export struct DetailPlayLiveCommon { | @@ -26,6 +26,8 @@ export struct DetailPlayLiveCommon { | ||
| 26 | private liveViewModel: LiveViewModel = new LiveViewModel() | 26 | private liveViewModel: LiveViewModel = new LiveViewModel() |
| 27 | pageShowTime: number = 0; | 27 | pageShowTime: number = 0; |
| 28 | 28 | ||
| 29 | + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 30 | + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 29 | @Provide relId: string = '' | 31 | @Provide relId: string = '' |
| 30 | @Provide contentId: string = '' | 32 | @Provide contentId: string = '' |
| 31 | @Provide relType: string = '' | 33 | @Provide relType: string = '' |
| @@ -83,7 +85,7 @@ export struct DetailPlayLiveCommon { | @@ -83,7 +85,7 @@ export struct DetailPlayLiveCommon { | ||
| 83 | .height('100%') | 85 | .height('100%') |
| 84 | .width('100%') | 86 | .width('100%') |
| 85 | .backgroundColor(Color.Black) | 87 | .backgroundColor(Color.Black) |
| 86 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | 88 | + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) |
| 87 | } | 89 | } |
| 88 | 90 | ||
| 89 | /** | 91 | /** |
| @@ -153,9 +155,11 @@ export struct DetailPlayLiveCommon { | @@ -153,9 +155,11 @@ export struct DetailPlayLiveCommon { | ||
| 153 | this.pageShow = Math.random() | 155 | this.pageShow = Math.random() |
| 154 | Logger.info(TAG, 'onPageShow') | 156 | Logger.info(TAG, 'onPageShow') |
| 155 | this.pageShowTime = DateTimeUtils.getTimeStamp() | 157 | this.pageShowTime = DateTimeUtils.getTimeStamp() |
| 158 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) | ||
| 156 | } | 159 | } |
| 157 | 160 | ||
| 158 | onPageHide() { | 161 | onPageHide() { |
| 162 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'}) | ||
| 159 | this.pageHide = Math.random() | 163 | this.pageHide = Math.random() |
| 160 | Logger.info(TAG, 'onPageHide') | 164 | Logger.info(TAG, 'onPageHide') |
| 161 | //页面浏览 | 165 | //页面浏览 |
| @@ -166,6 +170,7 @@ export struct DetailPlayLiveCommon { | @@ -166,6 +170,7 @@ export struct DetailPlayLiveCommon { | ||
| 166 | } | 170 | } |
| 167 | 171 | ||
| 168 | onBackPress(): boolean | void { | 172 | onBackPress(): boolean | void { |
| 173 | + | ||
| 169 | this.pageBackPress = Math.random() | 174 | this.pageBackPress = Math.random() |
| 170 | Logger.info(TAG, 'onBackPress') | 175 | Logger.info(TAG, 'onBackPress') |
| 171 | return true | 176 | return true |
| @@ -39,6 +39,8 @@ export struct DetailPlayLivePage { | @@ -39,6 +39,8 @@ export struct DetailPlayLivePage { | ||
| 39 | // 尽量不要动属性。用来作为输入了评论之后,值传递 | 39 | // 尽量不要动属性。用来作为输入了评论之后,值传递 |
| 40 | @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 | 40 | @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 |
| 41 | @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 | 41 | @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 |
| 42 | + // 顶部状态栏高度 | ||
| 43 | + @Consume topSafeHeight: number | ||
| 42 | 44 | ||
| 43 | aboutToAppear(): void { | 45 | aboutToAppear(): void { |
| 44 | Logger.info(TAG, `wyj-aboutToAppear`) | 46 | Logger.info(TAG, `wyj-aboutToAppear`) |
| @@ -50,7 +52,7 @@ export struct DetailPlayLivePage { | @@ -50,7 +52,7 @@ export struct DetailPlayLivePage { | ||
| 50 | } else { | 52 | } else { |
| 51 | this.displayDirection = DisplayDirection.VERTICAL | 53 | this.displayDirection = DisplayDirection.VERTICAL |
| 52 | } | 54 | } |
| 53 | - WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) | 55 | + // WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) |
| 54 | }) | 56 | }) |
| 55 | this.getLiveDetails() | 57 | this.getLiveDetails() |
| 56 | this.getLiveRoomData() | 58 | this.getLiveRoomData() |
| @@ -66,9 +68,11 @@ export struct DetailPlayLivePage { | @@ -66,9 +68,11 @@ export struct DetailPlayLivePage { | ||
| 66 | 68 | ||
| 67 | build() { | 69 | build() { |
| 68 | Column() { | 70 | Column() { |
| 69 | - | ||
| 70 | TopPlayComponent({ playerController: this.playerController }) | 71 | TopPlayComponent({ playerController: this.playerController }) |
| 71 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') | 72 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') |
| 73 | + .margin({ | ||
| 74 | + top: this.displayDirection == DisplayDirection.VERTICAL ? px2vp(this.topSafeHeight) : 0 | ||
| 75 | + }) | ||
| 72 | 76 | ||
| 73 | TabComponent({ | 77 | TabComponent({ |
| 74 | tabs: this.tabs, | 78 | tabs: this.tabs, |
| @@ -114,7 +118,6 @@ export struct DetailPlayLivePage { | @@ -114,7 +118,6 @@ export struct DetailPlayLivePage { | ||
| 114 | .height('100%') | 118 | .height('100%') |
| 115 | .width('100%') | 119 | .width('100%') |
| 116 | 120 | ||
| 117 | - // 设置底部绘制延伸到导航条 | ||
| 118 | } | 121 | } |
| 119 | 122 | ||
| 120 | onPageShowCus(): void { | 123 | onPageShowCus(): void { |
| @@ -23,8 +23,8 @@ export struct DetailPlayVLivePage { | @@ -23,8 +23,8 @@ export struct DetailPlayVLivePage { | ||
| 23 | private playerController: WDAliPlayerController = new WDAliPlayerController(); | 23 | private playerController: WDAliPlayerController = new WDAliPlayerController(); |
| 24 | private swiperController: SwiperController = new SwiperController() | 24 | private swiperController: SwiperController = new SwiperController() |
| 25 | @Consume contentDetailData: ContentDetailDTO | 25 | @Consume contentDetailData: ContentDetailDTO |
| 26 | - @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 27 | - @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 26 | + @Consume bottomSafeHeight: number |
| 27 | + @Consume topSafeHeight: number | ||
| 28 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean | 28 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean |
| 29 | @Provide isShowControl: boolean = false | 29 | @Provide isShowControl: boolean = false |
| 30 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏 | 30 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏 |
| @@ -53,14 +53,16 @@ export struct DetailPlayVLivePage { | @@ -53,14 +53,16 @@ export struct DetailPlayVLivePage { | ||
| 53 | 53 | ||
| 54 | openFullScreen() { | 54 | openFullScreen() { |
| 55 | console.log(TAG, 'openFullScreen') | 55 | console.log(TAG, 'openFullScreen') |
| 56 | - WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 57 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 56 | + // WindowModel.shared.setWindowLayoutFullScreen(true) |
| 57 | + // WindowModel.shared.setSpecificSystemBarEnabled() | ||
| 58 | + // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | ||
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | closeFullScreen() { | 61 | closeFullScreen() { |
| 61 | console.log(TAG, 'closeFullScreen') | 62 | console.log(TAG, 'closeFullScreen') |
| 62 | - WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 63 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 63 | + // WindowModel.shared.setWindowLayoutFullScreen(false) |
| 64 | + // WindowModel.shared.setSpecificSystemBarEnabled(true) | ||
| 65 | + // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 64 | } | 66 | } |
| 65 | 67 | ||
| 66 | build() { | 68 | build() { |
| @@ -72,7 +74,6 @@ export struct DetailPlayVLivePage { | @@ -72,7 +74,6 @@ export struct DetailPlayVLivePage { | ||
| 72 | .width('100%') | 74 | .width('100%') |
| 73 | .blur(100) | 75 | .blur(100) |
| 74 | .renderFit(RenderFit.RESIZE_COVER) | 76 | .renderFit(RenderFit.RESIZE_COVER) |
| 75 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 76 | // 直播结束且无回看 | 77 | // 直播结束且无回看 |
| 77 | if (this.liveState === 'end' && !this.playUrl) { | 78 | if (this.liveState === 'end' && !this.playUrl) { |
| 78 | PlayerEndView() | 79 | PlayerEndView() |
| @@ -101,9 +101,8 @@ export struct PlayUIComponent { | @@ -101,9 +101,8 @@ export struct PlayUIComponent { | ||
| 101 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 101 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 102 | window.Orientation.PORTRAIT : | 102 | window.Orientation.PORTRAIT : |
| 103 | window.Orientation.LANDSCAPE_INVERTED) | 103 | window.Orientation.LANDSCAPE_INVERTED) |
| 104 | - // devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 105 | - // window.Orientation.PORTRAIT : | ||
| 106 | - // window.Orientation.LANDSCAPE); | 104 | + WindowModel.shared.setSpecificSystemBarEnabled(true) |
| 105 | + | ||
| 107 | }) | 106 | }) |
| 108 | if (this.contentDetailData.liveInfo?.liveState != 'wait') { | 107 | if (this.contentDetailData.liveInfo?.liveState != 'wait') { |
| 109 | Text(this.contentDetailData.newsTitle) | 108 | Text(this.contentDetailData.newsTitle) |
| @@ -310,12 +309,14 @@ export struct PlayUIComponent { | @@ -310,12 +309,14 @@ export struct PlayUIComponent { | ||
| 310 | this.displayDirection = | 309 | this.displayDirection = |
| 311 | this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : | 310 | this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : |
| 312 | DisplayDirection.VERTICAL | 311 | DisplayDirection.VERTICAL |
| 312 | + | ||
| 313 | + WindowModel.shared.setSpecificSystemBarEnabled(false) | ||
| 314 | + | ||
| 313 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 315 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 314 | window.Orientation.PORTRAIT : | 316 | window.Orientation.PORTRAIT : |
| 315 | window.Orientation.LANDSCAPE_INVERTED) | 317 | window.Orientation.LANDSCAPE_INVERTED) |
| 316 | - // devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 317 | - // window.Orientation.PORTRAIT : | ||
| 318 | - // window.Orientation.LANDSCAPE); | 318 | + |
| 319 | + | ||
| 319 | }) | 320 | }) |
| 320 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 321 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 321 | } | 322 | } |
| @@ -178,7 +178,6 @@ export struct TopPlayComponent { | @@ -178,7 +178,6 @@ export struct TopPlayComponent { | ||
| 178 | 178 | ||
| 179 | if (this.liveDetailPageLogic.showPad) { | 179 | if (this.liveDetailPageLogic.showPad) { |
| 180 | 180 | ||
| 181 | - | ||
| 182 | } else { | 181 | } else { |
| 183 | // 视频资源播放 | 182 | // 视频资源播放 |
| 184 | WDPlayerRenderLiveView({ | 183 | WDPlayerRenderLiveView({ |
| @@ -128,7 +128,7 @@ export struct PlayerCommentComponent { | @@ -128,7 +128,7 @@ export struct PlayerCommentComponent { | ||
| 128 | } | 128 | } |
| 129 | }, | 129 | }, |
| 130 | onBack: () => { | 130 | onBack: () => { |
| 131 | - WindowModel.shared.setWindowLayoutFullScreen(false) | 131 | + // WindowModel.shared.setWindowLayoutFullScreen(false) |
| 132 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 132 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 133 | } | 133 | } |
| 134 | }) | 134 | }) |
| @@ -4,7 +4,7 @@ import UIAbility from '@ohos.app.ability.UIAbility'; | @@ -4,7 +4,7 @@ import UIAbility from '@ohos.app.ability.UIAbility'; | ||
| 4 | import Want from '@ohos.app.ability.Want'; | 4 | import Want from '@ohos.app.ability.Want'; |
| 5 | import window from '@ohos.window'; | 5 | import window from '@ohos.window'; |
| 6 | import { BusinessError } from '@ohos.base'; | 6 | import { BusinessError } from '@ohos.base'; |
| 7 | -import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit'; | 7 | +import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit'; |
| 8 | import { ConfigurationConstant } from '@kit.AbilityKit'; | 8 | import { ConfigurationConstant } from '@kit.AbilityKit'; |
| 9 | import { StartupManager } from '../startupmanager/StartupManager'; | 9 | import { StartupManager } from '../startupmanager/StartupManager'; |
| 10 | 10 | ||
| @@ -14,6 +14,10 @@ const TAG = 'EntryAbility' | @@ -14,6 +14,10 @@ const TAG = 'EntryAbility' | ||
| 14 | export default class EntryAbility extends UIAbility { | 14 | export default class EntryAbility extends UIAbility { |
| 15 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { | 15 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { |
| 16 | StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context) | 16 | StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context) |
| 17 | + if (SPHelper.default.getSync('isPrivacy', true)) { | ||
| 18 | + // 同意隐私协议,这里直接初始化。TODO 耗时梳理 | ||
| 19 | + StartupManager.sharedInstance().appAgreedProtocol() | ||
| 20 | + } | ||
| 17 | Logger.info(TAG, 'Ability onCreate'); | 21 | Logger.info(TAG, 'Ability onCreate'); |
| 18 | 22 | ||
| 19 | // 还没深色模式需求,暂直接不跟随系统。 | 23 | // 还没深色模式需求,暂直接不跟随系统。 |
| @@ -21,7 +21,8 @@ struct MultiPictureDetailPage { | @@ -21,7 +21,8 @@ struct MultiPictureDetailPage { | ||
| 21 | pageHideTime:number = 0; | 21 | pageHideTime:number = 0; |
| 22 | @Provide pageId: string = TrackConstants.PageName.Atlas_Detail | 22 | @Provide pageId: string = TrackConstants.PageName.Atlas_Detail |
| 23 | @Provide pageName: string = TrackConstants.PageName.Atlas_Detail | 23 | @Provide pageName: string = TrackConstants.PageName.Atlas_Detail |
| 24 | - | 24 | + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 25 | + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 25 | build() { | 26 | build() { |
| 26 | Row() { | 27 | Row() { |
| 27 | Column() { | 28 | Column() { |
| @@ -31,6 +32,8 @@ struct MultiPictureDetailPage { | @@ -31,6 +32,8 @@ struct MultiPictureDetailPage { | ||
| 31 | relType: this.relType | 32 | relType: this.relType |
| 32 | }) | 33 | }) |
| 33 | } | 34 | } |
| 35 | + .padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`}) | ||
| 36 | + | ||
| 34 | } | 37 | } |
| 35 | .backgroundColor(Color.Black) | 38 | .backgroundColor(Color.Black) |
| 36 | } | 39 | } |
| @@ -72,18 +75,12 @@ struct MultiPictureDetailPage { | @@ -72,18 +75,12 @@ struct MultiPictureDetailPage { | ||
| 72 | onPageShow(): void { | 75 | onPageShow(): void { |
| 73 | console.log(TAG, 'onPageShow') | 76 | console.log(TAG, 'onPageShow') |
| 74 | this.pageShowTime = DateTimeUtils.getTimeStamp() | 77 | this.pageShowTime = DateTimeUtils.getTimeStamp() |
| 75 | - /*// 获取当前应用窗口 | ||
| 76 | - let windowClass: window.Window = window.getLastWindow(this.context) | ||
| 77 | - // 将状态栏和导航栏的背景色设置为跟应用窗口相同的颜色 | ||
| 78 | - windowClass.setWindowSystemBarProperties({ | ||
| 79 | - navigationBarColor: color, | ||
| 80 | - statusBarColor: barColor, | ||
| 81 | - statusBarContentColor: barContentColor, | ||
| 82 | - })*/ | 78 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) |
| 83 | } | 79 | } |
| 84 | 80 | ||
| 85 | onPageHide(): void { | 81 | onPageHide(): void { |
| 86 | console.log(TAG, 'onPageHide') | 82 | console.log(TAG, 'onPageHide') |
| 83 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'}) | ||
| 87 | this.pageHideTime = DateTimeUtils.getTimeStamp() | 84 | this.pageHideTime = DateTimeUtils.getTimeStamp() |
| 88 | let duration = 0 | 85 | let duration = 0 |
| 89 | duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | 86 | duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) |
| @@ -97,8 +97,8 @@ struct LaunchPage { | @@ -97,8 +97,8 @@ struct LaunchPage { | ||
| 97 | this.dialogController.open(); | 97 | this.dialogController.open(); |
| 98 | // } | 98 | // } |
| 99 | } else { | 99 | } else { |
| 100 | - | ||
| 101 | - StartupManager.sharedInstance().appAgreedProtocol() | 100 | + // 挪到ability里处理了。 |
| 101 | + // StartupManager.sharedInstance().appAgreedProtocol() | ||
| 102 | 102 | ||
| 103 | //需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页 | 103 | //需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页 |
| 104 | //获取本地存储的启动页数据 | 104 | //获取本地存储的启动页数据 |
| @@ -90,13 +90,14 @@ export class StartupManager { | @@ -90,13 +90,14 @@ export class StartupManager { | ||
| 90 | Logger.debug(TAG, "App 已同意隐私等协议,开始必要初始化") | 90 | Logger.debug(TAG, "App 已同意隐私等协议,开始必要初始化") |
| 91 | this.initCheckDeviceId() | 91 | this.initCheckDeviceId() |
| 92 | 92 | ||
| 93 | + this.initNetwork() | ||
| 94 | + | ||
| 93 | this.initMpaas() | 95 | this.initMpaas() |
| 96 | + | ||
| 94 | this.initSensorData() | 97 | this.initSensorData() |
| 95 | 98 | ||
| 96 | this.initTingyun() | 99 | this.initTingyun() |
| 97 | 100 | ||
| 98 | - this.initNetwork() | ||
| 99 | - | ||
| 100 | this.initGeTuiPush() | 101 | this.initGeTuiPush() |
| 101 | 102 | ||
| 102 | this.initUmengStat() | 103 | this.initUmengStat() |
-
Please register or login to post a comment