liyubing

feat:换肤

1)修改手机顶部状态栏颜色
... ... @@ -482,12 +482,12 @@ export struct TopNavigationComponentNew {
this.backgroundImageH = px2vp(this.topRectHeight) + 44
}
this.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor)
}
pageShowChange() {
this.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor)
}
... ... @@ -499,28 +499,14 @@ export struct TopNavigationComponentNew {
if(this._currentNavIndex == this.bottomNavIndex){
this.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtils.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}`);
... ...
... ... @@ -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
... ...
... ... @@ -57,31 +57,15 @@ export struct VideoChannelPage {
if (this.isImmerseChannel() && CompUtils.isVideo(this.currentBottomNavInfo)) {
this.barBackgroundColor = Color.Black
this.isImmersive = true
this.changeTopStatusBarColor(0)// 沉浸页面顶部导航栏颜色固定黑色
ColorUtils.changeTopStatusBarColor(0)// 沉浸页面顶部导航栏颜色固定黑色
} else {
this.isImmersive = false
this.barBackgroundColor = Color.White
this.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor)
}
}
/**
* 修改手机顶部状态栏颜色
* @param statusValue
*/
changeTopStatusBarColor(statusValue: number) {
if (statusValue === 1) { // 黑色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
})
} else { //白色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
})
}
}
/**
* 得到顶导文字颜色
... ...