wangliang_wd

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(多图):顶部底部适配
  添加状态栏隐藏接口
... ... @@ -135,6 +135,13 @@ export class WindowModel {
})
}
/**
* 状态栏显示设置
*/
setSpecificSystemBarEnabled(visible: boolean) {
this.windowClass?.setSpecificSystemBarEnabled('status', visible)
}
setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) {
this.windowClass?.setWindowSystemBarEnable(names)
}
... ...
... ... @@ -93,7 +93,8 @@ export struct CardMediaInfo {
.fontFamily('BebasNeue')
}
} .margin({ left: 68,top: 135})
}
// .margin({ left: 68,top: 135})
} else if (this.contentDTO.objectType === '2') {
// liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
// 显示直播信息
... ... @@ -191,7 +192,7 @@ export struct CardMediaInfo {
.mediaTextImgtype()
.fontFamily('BebasNeue')
}
.margin({ left: 80,top: 55})
// .margin({ left: 80,top: 55})
} else if (this.contentDTO.objectType === '13') {
// 显示音频信息
... ...
... ... @@ -3,7 +3,6 @@ import { display, router } from '@kit.ArkUI';
import { ImageItemView } from '../components/view/ImageItemView';
import { ImageDownloadComponent } from '../components/ImageDownloadComponent';
import { Action } from 'wdBean';
import { WindowModel } from 'wdKit/Index';
const TAG = 'MultiPictureListPage';
... ... @@ -20,11 +19,11 @@ export struct MultiPictureListPage {
@State picHeight: number = 0
@State isEnableSwipe: boolean = true;
@State currentUrl: string = ''
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
// @Provide bgc: Color = Color.White;
aboutToAppear(): void {
this.openFullScreen()
//获取宽高尺寸
this.screenWidth = this.displayTool.width
// this.picWidth = this.screenWidth - vp2px(52)
... ... @@ -57,7 +56,6 @@ export struct MultiPictureListPage {
if (this.photoList && this.photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.photoList, (item: PhotoListBean) => {
// MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe })
})
}
... ... @@ -135,36 +133,13 @@ export struct MultiPictureListPage {
}
.width('100%')
.height('100%')
// .padding({top:$r('app.float.margin_44')})
.padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`})
.backgroundColor(Color.Black)
.id('e_picture_container')
// 设置顶部绘制延伸到状态栏
// 设置底部绘制延伸到导航条
}
/**
* 开启沉浸式
* TODO:颜色待根据业务接口修改
*/
openFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
// WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowSystemBarEnable([])
}
aboutToDisappear(): void {
console.log(TAG, 'aboutToDisappear')
this.closeFullScreen()
}
/**
* 关闭沉浸式
* TODO:颜色待根据业务接口修改
*/
closeFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
// WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])
}
onBackPress(): boolean | void {
... ... @@ -172,7 +147,5 @@ export struct MultiPictureListPage {
}
private onBack() {
// 提前设置,否则返回的页面展示有问题(有时延)
this.closeFullScreen()
}
}
\ No newline at end of file
... ...
... ... @@ -4,7 +4,7 @@ import router from '@ohos.router';
import { DetailPlayLivePage } from './DetailPlayLivePage';
import { DetailPlayVLivePage } from './DetailPlayVLivePage';
import { DateTimeUtils, Logger, ToastUtils } from 'wdKit/Index';
import { DateTimeUtils, Logger, ToastUtils, WindowModel } from 'wdKit/Index';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { PictureLoading } from '../widgets/vertical/PictureLoading';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
... ... @@ -26,6 +26,8 @@ export struct DetailPlayLiveCommon {
private liveViewModel: LiveViewModel = new LiveViewModel()
pageShowTime: number = 0;
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide relId: string = ''
@Provide contentId: string = ''
@Provide relType: string = ''
... ... @@ -83,7 +85,7 @@ export struct DetailPlayLiveCommon {
.height('100%')
.width('100%')
.backgroundColor(Color.Black)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
/**
... ... @@ -153,9 +155,11 @@ export struct DetailPlayLiveCommon {
this.pageShow = Math.random()
Logger.info(TAG, 'onPageShow')
this.pageShowTime = DateTimeUtils.getTimeStamp()
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
}
onPageHide() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
this.pageHide = Math.random()
Logger.info(TAG, 'onPageHide')
//页面浏览
... ... @@ -166,6 +170,7 @@ export struct DetailPlayLiveCommon {
}
onBackPress(): boolean | void {
this.pageBackPress = Math.random()
Logger.info(TAG, 'onBackPress')
return true
... ...
... ... @@ -39,6 +39,8 @@ export struct DetailPlayLivePage {
// 尽量不要动属性。用来作为输入了评论之后,值传递
@State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息
@State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息
// 顶部状态栏高度
@Consume topSafeHeight: number
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
... ... @@ -50,7 +52,7 @@ export struct DetailPlayLivePage {
} else {
this.displayDirection = DisplayDirection.VERTICAL
}
WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
// WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
})
this.getLiveDetails()
this.getLiveRoomData()
... ... @@ -66,9 +68,11 @@ export struct DetailPlayLivePage {
build() {
Column() {
TopPlayComponent({ playerController: this.playerController })
.height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%')
.margin({
top: this.displayDirection == DisplayDirection.VERTICAL ? px2vp(this.topSafeHeight) : 0
})
TabComponent({
tabs: this.tabs,
... ... @@ -114,7 +118,6 @@ export struct DetailPlayLivePage {
.height('100%')
.width('100%')
// 设置底部绘制延伸到导航条
}
onPageShowCus(): void {
... ...
... ... @@ -23,8 +23,8 @@ export struct DetailPlayVLivePage {
private playerController: WDAliPlayerController = new WDAliPlayerController();
private swiperController: SwiperController = new SwiperController()
@Consume contentDetailData: ContentDetailDTO
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@Consume bottomSafeHeight: number
@Consume topSafeHeight: number
@Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean
@Provide isShowControl: boolean = false
@Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏
... ... @@ -53,14 +53,16 @@ export struct DetailPlayVLivePage {
openFullScreen() {
console.log(TAG, 'openFullScreen')
WindowModel.shared.setWindowLayoutFullScreen(true)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
// WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setSpecificSystemBarEnabled()
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
}
closeFullScreen() {
console.log(TAG, 'closeFullScreen')
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
// WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setSpecificSystemBarEnabled(true)
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
build() {
... ... @@ -72,7 +74,6 @@ export struct DetailPlayVLivePage {
.width('100%')
.blur(100)
.renderFit(RenderFit.RESIZE_COVER)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
// 直播结束且无回看
if (this.liveState === 'end' && !this.playUrl) {
PlayerEndView()
... ...
... ... @@ -101,9 +101,8 @@ export struct PlayUIComponent {
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
// devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE);
WindowModel.shared.setSpecificSystemBarEnabled(true)
})
if (this.contentDetailData.liveInfo?.liveState != 'wait') {
Text(this.contentDetailData.newsTitle)
... ... @@ -310,12 +309,14 @@ export struct PlayUIComponent {
this.displayDirection =
this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL :
DisplayDirection.VERTICAL
WindowModel.shared.setSpecificSystemBarEnabled(false)
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
// devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE);
})
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}
... ...
... ... @@ -178,7 +178,6 @@ export struct TopPlayComponent {
if (this.liveDetailPageLogic.showPad) {
} else {
// 视频资源播放
WDPlayerRenderLiveView({
... ...
... ... @@ -128,7 +128,7 @@ export struct PlayerCommentComponent {
}
},
onBack: () => {
WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
})
... ...
... ... @@ -4,7 +4,7 @@ import UIAbility from '@ohos.app.ability.UIAbility';
import Want from '@ohos.app.ability.Want';
import window from '@ohos.window';
import { BusinessError } from '@ohos.base';
import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit';
import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit';
import { ConfigurationConstant } from '@kit.AbilityKit';
import { StartupManager } from '../startupmanager/StartupManager';
... ... @@ -14,6 +14,10 @@ const TAG = 'EntryAbility'
export default class EntryAbility extends UIAbility {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context)
if (SPHelper.default.getSync('isPrivacy', true)) {
// 同意隐私协议,这里直接初始化。TODO 耗时梳理
StartupManager.sharedInstance().appAgreedProtocol()
}
Logger.info(TAG, 'Ability onCreate');
// 还没深色模式需求,暂直接不跟随系统。
... ...
... ... @@ -21,7 +21,8 @@ struct MultiPictureDetailPage {
pageHideTime:number = 0;
@Provide pageId: string = TrackConstants.PageName.Atlas_Detail
@Provide pageName: string = TrackConstants.PageName.Atlas_Detail
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
build() {
Row() {
Column() {
... ... @@ -31,6 +32,8 @@ struct MultiPictureDetailPage {
relType: this.relType
})
}
.padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`})
}
.backgroundColor(Color.Black)
}
... ... @@ -72,18 +75,12 @@ struct MultiPictureDetailPage {
onPageShow(): void {
console.log(TAG, 'onPageShow')
this.pageShowTime = DateTimeUtils.getTimeStamp()
/*// 获取当前应用窗口
let windowClass: window.Window = window.getLastWindow(this.context)
// 将状态栏和导航栏的背景色设置为跟应用窗口相同的颜色
windowClass.setWindowSystemBarProperties({
navigationBarColor: color,
statusBarColor: barColor,
statusBarContentColor: barContentColor,
})*/
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
}
onPageHide(): void {
console.log(TAG, 'onPageHide')
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
... ...
... ... @@ -97,8 +97,8 @@ struct LaunchPage {
this.dialogController.open();
// }
} else {
StartupManager.sharedInstance().appAgreedProtocol()
// 挪到ability里处理了。
// StartupManager.sharedInstance().appAgreedProtocol()
//需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页
//获取本地存储的启动页数据
... ...
... ... @@ -90,13 +90,14 @@ export class StartupManager {
Logger.debug(TAG, "App 已同意隐私等协议,开始必要初始化")
this.initCheckDeviceId()
this.initNetwork()
this.initMpaas()
this.initSensorData()
this.initTingyun()
this.initNetwork()
this.initGeTuiPush()
this.initUmengStat()
... ...