|
|
@@ -4,10 +4,10 @@ import { StreamContent } from '../view/StreamContent'
|
|
|
import { window } from '@kit.ArkUI'
|
|
|
import { common } from '@kit.AbilityKit'
|
|
|
import { AvSessionController } from '../controller/AvSessionController'
|
|
|
-import { ToastUtil } from '@pura/harmony-utils'
|
|
|
+import { PreferencesUtil, ToastUtil } from '@pura/harmony-utils'
|
|
|
import { Utility } from '../common/util/Utility'
|
|
|
import { IjkMediaPlayer } from '@ohos/ijkplayer'
|
|
|
-
|
|
|
+import { hilog } from '@kit.PerformanceAnalysisKit'
|
|
|
@Entry
|
|
|
@Component
|
|
|
struct MainIndex{
|
|
|
@@ -19,6 +19,7 @@ struct MainIndex{
|
|
|
|
|
|
@State rootPath:string = getContext(this).filesDir
|
|
|
|
|
|
+ @StorageProp('themeColor') themeColor: string = PreferencesUtil.getStringSync('THEME_COLOR', '#FF4081');
|
|
|
|
|
|
@Builder TabBarBuilder(index:number,selIcon:ResourceStr,normalIcon:ResourceStr,text:string){
|
|
|
Column(){
|
|
|
@@ -27,7 +28,7 @@ struct MainIndex{
|
|
|
Text(text)
|
|
|
.fontSize(11)
|
|
|
.margin({top:4})
|
|
|
- .fontColor(this.selectIndex == index ? $r('app.color.title_bar_bg'):$r('app.color.tab_bar_normal') )
|
|
|
+ .fontColor(this.selectIndex == index ? this.themeColor : $r('app.color.tab_bar_normal') )
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -53,6 +54,10 @@ struct MainIndex{
|
|
|
|
|
|
IjkMediaPlayer.getInstance().stop();
|
|
|
IjkMediaPlayer.getInstance().release();
|
|
|
+ let themeColor = PreferencesUtil.getStringSync('THEME_COLOR', '#FF4081');
|
|
|
+ hilog.info(0x0000, 'Heanup', '当前 themeColor:'+themeColor);
|
|
|
+ AppStorage.setOrCreate('themeColor', themeColor);
|
|
|
+ this.themeColor = themeColor;
|
|
|
}
|
|
|
|
|
|
onPageShow() {
|
|
|
@@ -68,7 +73,7 @@ struct MainIndex{
|
|
|
.width('100%')
|
|
|
.height(2)
|
|
|
}
|
|
|
- .backgroundColor($r('app.color.title_bar_bg'))
|
|
|
+ .backgroundColor(this.themeColor)
|
|
|
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
|
|
|
Tabs({
|
|
|
barPosition:BarPosition.End,
|