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
liyubing
2024-06-27 19:50:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
187533eeb6f0c69a66b32c9d8e648d116bc1e7cf
187533ee
1 parent
11b12098
feat:换肤
1)修改手机顶部状态栏颜色
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
36 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/utils/ColorUtils.ets
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
187533e
...
...
@@ -482,12 +482,12 @@ export struct TopNavigationComponentNew {
this.backgroundImageH = px2vp(this.topRectHeight) + 44
}
thi
s.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtil
s.changeTopStatusBarColor(this.navItem.statusBarColor)
}
pageShowChange() {
thi
s.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtil
s.changeTopStatusBarColor(this.navItem.statusBarColor)
}
...
...
@@ -499,28 +499,14 @@ export struct TopNavigationComponentNew {
if(this._currentNavIndex == this.bottomNavIndex){
thi
s.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtil
s.changeTopStatusBarColor(this.navItem.statusBarColor)
this.isImmersive = false
this.barBackgroundColor = Color.White
}
}
/**
* 修改手机顶部状态栏颜色
* @param statusValue
*/
changeTopStatusBarColor(statusValue: number) {
if (statusValue === 1) { // 黑色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
})
} else { //白色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
})
}
}
onTopNavigationDataUpdated() {
Logger.info(TAG,
`onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`);
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/ColorUtils.ets
View file @
187533e
...
...
@@ -13,6 +13,7 @@
* limitations under the License.
*/
import { common2D, drawing } from '@kit.ArkGraphics2D';
import { WindowModel } from 'wdKit/Index';
/**
* RGB颜色类型
...
...
@@ -265,4 +266,22 @@ export class ColorUtils {
return drawColorFilter
}
/**
* 修改手机顶部状态栏颜色
* @param statusValue
*/
public static changeTopStatusBarColor(statusValue: number) {
if (statusValue === 1) { // 黑色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
})
} else { //白色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
})
}
}
}
\ No newline at end of file
...
...
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
View file @
187533e
...
...
@@ -57,31 +57,15 @@ export struct VideoChannelPage {
if (this.isImmerseChannel() && CompUtils.isVideo(this.currentBottomNavInfo)) {
this.barBackgroundColor = Color.Black
this.isImmersive = true
thi
s.changeTopStatusBarColor(0)// 沉浸页面顶部导航栏颜色固定黑色
ColorUtil
s.changeTopStatusBarColor(0)// 沉浸页面顶部导航栏颜色固定黑色
} else {
this.isImmersive = false
this.barBackgroundColor = Color.White
thi
s.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtil
s.changeTopStatusBarColor(this.navItem.statusBarColor)
}
}
/**
* 修改手机顶部状态栏颜色
* @param statusValue
*/
changeTopStatusBarColor(statusValue: number) {
if (statusValue === 1) { // 黑色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
})
} else { //白色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
})
}
}
/**
* 得到顶导文字颜色
...
...
Please
register
or
login
to post a comment