Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhenghy
2024-04-22 16:28:41 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a3b68acae5680e8ed4399fe4bf62872eda839fd1
a3b68aca
1 parent
44c17fe3
视频频道修改
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
27 deletions
sight_harmony/commons/wdKit/src/main/ets/utils/WindowModel.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
sight_harmony/commons/wdKit/src/main/ets/utils/WindowModel.ets
View file @
a3b68ac
...
...
@@ -132,6 +132,10 @@ export class WindowModel {
})
}
setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) {
this.windowClass?.setWindowSystemBarEnable(names)
}
setWindowLayoutFullScreen(isFullScreen: boolean) {
this.isFullScreen = isFullScreen
this.windowClass?.setWindowLayoutFullScreen(isFullScreen)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
View file @
a3b68ac
...
...
@@ -157,20 +157,20 @@ export struct TopNavigationComponent {
if (this._currentNavIndex === 2 && this.currentTopNavSelectedIndex == 0) {
this.barBackgroundColor = Color.Black
this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
WindowModel.shared.setWindowLayoutFullScreen(true)
this.isLayoutFullScreen = true
this.bottomRectHeight = this.bottomSafeHeight
this.topRectHeight = this.topSafeHeight
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
// WindowModel.shared.setWindowLayoutFullScreen(true)
// this.isLayoutFullScreen = true
// this.bottomRectHeight = this.bottomSafeHeight
// this.topRectHeight = this.topSafeHeight
} else {
this.barBackgroundColor = Color.Transparent
this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
WindowModel.shared.setWindowLayoutFullScreen(false)
this.isLayoutFullScreen = false
this.bottomRectHeight = 0
this.topRectHeight = 0
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
// WindowModel.shared.setWindowLayoutFullScreen(false)
// this.isLayoutFullScreen = false
// this.bottomRectHeight = 0
// this.topRectHeight = 0
}
}
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
View file @
a3b68ac
...
...
@@ -2,7 +2,7 @@ import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { ResponseDTO } from 'wdNetwork/Index';
import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
import { Test } from './Test'
//
import { Test } from './Test'
import router from '@ohos.router';
import window from '@ohos.window';
import {
...
...
@@ -12,7 +12,7 @@ import {
contentsItem,
getRecCompInfoParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { WindowModel } from 'wdKit/Index';
import {
Logger,
WindowModel } from 'wdKit/Index';
import { BusinessError } from '@kit.BasicServicesKit';
interface loadMoreData {
...
...
@@ -21,6 +21,9 @@ interface loadMoreData {
loadStrategy: string;
}
const TAG = 'VideoChannelDetail'
let timer: number = -1
@Entry
@Component
export struct VideoChannelDetail {
...
...
@@ -48,33 +51,49 @@ export struct VideoChannelDetail {
* 监听视频频道激活或失活
*/
navIndexChange() {
if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
// 如果视频在暂停则播放视频
this.switchVideoStatus = true
} else {
// 如果视频在播放则暂停视频
this.switchVideoStatus = false
}
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
// 如果视频在暂停则播放视频
this.switchVideoStatus = true
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', statusBarColor: '#000000' })
} else {
// 如果视频在播放则暂停视频
this.switchVideoStatus = false
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', statusBarColor: '#ffffff' })
// WindowModel.shared.setWindowLayoutFullScreen(false)
}
timer = -1
}, 100)
}
async aboutToAppear(): Promise<void> {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
aboutToAppear() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', statusBarColor: '#000000' })
// WindowModel.shared.setWindowLayoutFullScreen(true)
// 根据视频频道传参查询视频楼层信息
this.getRecCompInfo()
Logger.info(TAG, 'aboutToAppear');
}
aboutToDisappear(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
console.error('aboutToDisappear videoChanel')
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', statusBarColor: '#ffffff' })
// WindowModel.shared.setWindowLayoutFullScreen(false)
Logger.info(TAG, 'aboutToDisappear');
}
onPageHide(): void {
console.error('onPageHide videoChanel')
onPageShow(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', statusBarColor: '#000000' })
// WindowModel.shared.setWindowLayoutFullScreen(true)
Logger.info(TAG, 'onPageShow');
}
onPageShow(): void {
console.error('onPageShow videoChanel')
onPageHide(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', statusBarColor: '#ffffff' })
// WindowModel.shared.setWindowLayoutFullScreen(false)
Logger.info(TAG, 'onPageHide');
}
/**
...
...
Please
register
or
login
to post a comment