diff --git a/features/batterycomponent/src/main/ets/default/pages/batteryIcon.ets b/features/batterycomponent/src/main/ets/default/pages/batteryIcon.ets index 84a12e5..3cd0d18 100644 --- a/features/batterycomponent/src/main/ets/default/pages/batteryIcon.ets +++ b/features/batterycomponent/src/main/ets/default/pages/batteryIcon.ets @@ -32,8 +32,8 @@ export default struct BatteryIcon { @StorageLink('StatusCoefficient') StatusCoefficient: number = 1.0 private mGroupId: string = '' @State mStatusBarGroupComponentData: StatusBarGroupComponentData = new StatusBarGroupComponentData() - @State style: any = StyleConfiguration.getBatteryComponentStyle() - @State styleCommon: any = StyleConfigurationCommon.getCommonStyle() + @State componentGap: Resource = $r('app.float.battery_component_gap') + @State statusBarMarginLeftRight: Resource = $r("app.float.signal_status_margin_Left_right") aboutToAppear() { this.mStatusBarGroupComponentData = StatusBarVM.getStatusBarGroupComponentData(this.mGroupId) @@ -47,11 +47,11 @@ export default struct BatteryIcon { build() { Row() { - Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%') + Row().width(this.statusBarMarginLeftRight).height('100%') BatterySoc({ mContentColor: this.mStatusBarGroupComponentData.contentColor }) - Row().width(this.style.componentGap).height('100%') + Row().width(this.componentGap).height('100%') BatteryPic({ mContentColor: this.mStatusBarGroupComponentData.contentColor }) - Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%') + Row().width(this.statusBarMarginLeftRight).height('100%') } .height('100%') } diff --git a/features/batterycomponent/src/main/ets/default/pages/batteryPic.ets b/features/batterycomponent/src/main/ets/default/pages/batteryPic.ets index 16e5d5e..6b2969b 100644 --- a/features/batterycomponent/src/main/ets/default/pages/batteryPic.ets +++ b/features/batterycomponent/src/main/ets/default/pages/batteryPic.ets @@ -25,7 +25,17 @@ struct BatteryPic { @StorageLink('batterySoc') batterySoc: number = 100 @StorageLink('batteryCharging') batteryCharging : boolean = false @State mContentColor: string = "#FFFFFFFF" - @State style: any = StyleConfiguration.getBatteryPicStyle() + @State picBodyWidth: Resource = $r('app.float.battery_component_pic_body_width') + @State picBodyHeight: Resource = $r('app.float.battery_component_pic_body_height') + @State picBodyBorderWidth: Resource = $r('app.float.battery_component_pic_body_border_width') + @State picBorderRadius: Resource = $r('app.float.battery_component_pic_border_radius') + @State picBodyPadding: Resource = $r('app.float.battery_component_pic_body_padding') + @State picGap: Resource = $r('app.float.battery_component_pic_gap') + @State picHeadWidth: Resource = $r('app.float.battery_component_pic_head_width') + @State picHeadHeight: Resource = $r('app.float.battery_component_pic_head_height') + @State picHeadBorderRadius: Resource = $r('app.float.battery_component_pic_head_radius') + @State picChargingColor: Resource = $r('app.color.battery_component_pic_charging_color') + @State picLevelLowColor: Resource = $r('app.color.battery_component_pic_level_low_color') aboutToAppear(){ Log.showInfo(TAG,'aboutToAppear Start'); @@ -46,37 +56,37 @@ struct BatteryPic { .width((this.batterySoc < 100 ? this.batterySoc: 100) + '%') .backgroundColor(this.getBatteryColor(this.batterySoc, this.batteryCharging)) } - .width(this.style.picBodyWidth) - .height(this.style.picBodyHeight) + .width(this.picBodyWidth) + .height(this.picBodyHeight) .backgroundColor($r('app.color.battery_background')) - .border({ width: this.style.picBodyBorderWidth, + .border({ width: this.picBodyBorderWidth, color: this.mContentColor, - radius: this.style.picBorderRadius, + radius: this.picBorderRadius, style: BorderStyle.Solid }) - .padding(this.style.picBodyPadding) + .padding(this.picBodyPadding) Row() { } - .width(this.style.picGap) + .width(this.picGap) .height(1) Row() { } - .width(this.style.picHeadWidth) - .height(this.style.picHeadHeight) + .width(this.picHeadWidth) + .height(this.picHeadHeight) .backgroundColor(this.mContentColor) - .borderRadius(this.style.picHeadBorderRadius) + .borderRadius(this.picHeadBorderRadius) } } private getBatteryColor(val, charging) { Log.showDebug(TAG, `getBatteryColor, val: ${ val } charging: ${ charging } `); if (charging) { - return this.style.picChargingColor; + return this.picChargingColor; } else if (val <= Constants.BATTERY_LEVEL_LOW) { - return this.style.picLevelLowColor; + return this.picLevelLowColor; } else { return this.mContentColor; } diff --git a/features/batterycomponent/src/main/ets/default/pages/batterySoc.ets b/features/batterycomponent/src/main/ets/default/pages/batterySoc.ets index 9bcfec2..33c1272 100644 --- a/features/batterycomponent/src/main/ets/default/pages/batterySoc.ets +++ b/features/batterycomponent/src/main/ets/default/pages/batterySoc.ets @@ -22,7 +22,7 @@ const TAG = 'BatteryComponent-batterySoc' export default struct BatterySoc { @StorageLink('batterySoc') batterySoc: number = 100 @State mContentColor: string = "#FFFFFFFF" - @State styleCommon: any = StyleConfigurationCommon.getCommonStyle() + @State statusBarFontSize: Resource = $r("app.float.signal_fontSize") aboutToAppear() { Log.showInfo(TAG, 'aboutToAppear Start'); @@ -35,7 +35,7 @@ export default struct BatterySoc { build() { Text(this.batterySoc + '%') .fontColor(this.mContentColor) - .fontSize(this.styleCommon.statusBarFontSize) + .fontSize(this.statusBarFontSize) .fontWeight(FontWeight.Medium) } } diff --git a/features/clockcomponent/src/main/ets/default/pages/clockIcon.ets b/features/clockcomponent/src/main/ets/default/pages/clockIcon.ets index be5fdd5..ab67866 100644 --- a/features/clockcomponent/src/main/ets/default/pages/clockIcon.ets +++ b/features/clockcomponent/src/main/ets/default/pages/clockIcon.ets @@ -31,8 +31,9 @@ export default struct ClockIcon { @State mTime: string = '16:01' private mGroupId: string = '' @State mStatusBarGroupComponentData: StatusBarGroupComponentData = new StatusBarGroupComponentData() - @State style: any = StyleConfiguration.getClockComponentStyle() - @State styleCommon: any = StyleConfigurationCommon.getCommonStyle() + @State statusBarClockMaxWidth: Resource = $r('app.float.status_bar_clock_width') + @State statusBarMarginLeftRight: Resource = $r("app.float.signal_status_margin_Left_right") + @State statusBarFontSize: Resource = $r("app.float.signal_fontSize") unSubscriber?: unsubscribe; aboutToAppear() { @@ -52,14 +53,14 @@ export default struct ClockIcon { build() { Row() { - Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%') + Row().width(this.statusBarMarginLeftRight).height('100%') Text(this.mTime) .fontColor(this.mStatusBarGroupComponentData.contentColor) - .fontSize(this.styleCommon.statusBarFontSize) - .width(this.style.statusBarClockMaxWidth) + .fontSize(this.statusBarFontSize) + .width(this.statusBarClockMaxWidth) .fontWeight(FontWeight.Medium) .margin({ left: $r("app.float.status_bar_clock_margin") }) - Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%') + Row().width(this.statusBarMarginLeftRight).height('100%') } } } \ No newline at end of file diff --git a/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/actionComponent.ets b/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/actionComponent.ets index e0b3b67..5d10a8f 100644 --- a/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/actionComponent.ets +++ b/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/actionComponent.ets @@ -24,7 +24,7 @@ const TAG = 'NoticeItem-ActionComponent'; export default struct ActionComponent { @State showInputText: boolean = false; @State placeholder: string = ''; - @State inputData: any = undefined; + @State inputData: { inputKey: null, wantAgent: null } = undefined; @State inputActionData: InputActionButtonData = new InputActionButtonData(); private itemData: any = undefined; diff --git a/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/titleItem.ets b/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/titleItem.ets index 2c3fe03..e592776 100644 --- a/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/titleItem.ets +++ b/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/titleItem.ets @@ -26,7 +26,7 @@ export default struct TitleItem { private notificationTime: string @Link isExpand: boolean @Prop needExpand: boolean - @State rowSpace: any = $r('app.float.titleitem_row_space') + @State rowSpace: Resource = $r('app.float.titleitem_row_space') @Prop distributedDeviceName: string private isSubItem: boolean= false; private clickTitleAction: () => void diff --git a/features/screenlock/src/main/ets/com/ohos/view/component/accounts.ets b/features/screenlock/src/main/ets/com/ohos/view/component/accounts.ets index 0459169..36e83a5 100644 --- a/features/screenlock/src/main/ets/com/ohos/view/component/accounts.ets +++ b/features/screenlock/src/main/ets/com/ohos/view/component/accounts.ets @@ -60,7 +60,7 @@ export default struct Accounts { @Component struct UserItem { - @State userItem: any = {}; + @State userItem: UserData = null; private viewModel: ViewModel; build() { diff --git a/features/screenlock/src/main/ets/com/ohos/view/component/batterySoc.ets b/features/screenlock/src/main/ets/com/ohos/view/component/batterySoc.ets index d2c4e7d..fcd432f 100644 --- a/features/screenlock/src/main/ets/com/ohos/view/component/batterySoc.ets +++ b/features/screenlock/src/main/ets/com/ohos/view/component/batterySoc.ets @@ -22,7 +22,7 @@ const TAG = 'ScreenLock-BatterySoc' export default struct BatterySoc { @StorageLink('batterySoc') @Watch('onBatterySocChanged') batterySoc: number = 100 @StorageLink('batteryCharging') @Watch('onBatterySocChanged') batteryCharging: boolean = false - @State batterySocText: any = '' + @State batterySocText: Resource = null aboutToAppear() { Log.showInfo(TAG, `aboutToAppear`) diff --git a/features/signalcomponent/src/main/ets/default/pages/signalIcon.ets b/features/signalcomponent/src/main/ets/default/pages/signalIcon.ets index d5dae58..cd983f6 100644 --- a/features/signalcomponent/src/main/ets/default/pages/signalIcon.ets +++ b/features/signalcomponent/src/main/ets/default/pages/signalIcon.ets @@ -32,8 +32,14 @@ export default struct SignalIcon { @StorageLink('signalObserved') signalObserved: boolean = false private mGroupId: string = '' @State mStatusBarGroupComponentData: StatusBarGroupComponentData = new StatusBarGroupComponentData() - @State styleCommon: any = StyleConfigurationCommon.getCommonStyle() - @State style: any = StyleConfiguration.getSignalComponentStyle() + @State statusBarMarginLeftRight: Resource = $r("app.float.signal_status_margin_Left_right") + @State statusBarFontSize: Resource = $r("app.float.signal_fontSize") + @State signalTextMaxWeight: Resource = $r('app.float.signal_text_max_width') + @State statusBarSignalUnknownFontSize: Resource = $r('app.float.status_bar_signal_unknown_font_size') + @State statusBarSignalTypeFontSize: Resource = $r('app.float.status_bar_signal_type_font_size') + @State netSignalTextMaxWidth: Resource = $r('app.float.status_bar_signal_net_signal_text_max_width') + @State cellularImageWidth: Resource = $r('app.float.signal_component_icon_width') + @State cellularImageHeight: Resource = $r('app.float.signal_component_icon_height') aboutToAppear() { Log.showInfo(TAG, 'aboutToAppear'); @@ -50,34 +56,34 @@ export default struct SignalIcon { build() { Row() { - Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%') + Row().width(this.statusBarMarginLeftRight).height('100%') Text(this.updateNetworkState(this.networkState)) - .fontSize(this.styleCommon.statusBarFontSize) + .fontSize(this.statusBarFontSize) .fontWeight(FontWeight.Medium) .fontColor(this.mStatusBarGroupComponentData.contentColor) .textOverflow({ overflow: TextOverflow.Ellipsis }) - .constraintSize({ maxWidth: this.style.signalTextMaxWeight }) + .constraintSize({ maxWidth: this.signalTextMaxWeight }) .flexShrink(0) .maxLines(1) .textAlign(TextAlign.Center) - Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%') + Row().width(this.statusBarMarginLeftRight).height('100%') Stack({ alignContent: Alignment.TopStart }) { Text(this.updateCellularType(this.cellularType)) - .fontSize(this.cellularType == Constants.RADIO_TECHNOLOGY_UNKNOWN ? this.style.statusBarSignalUnknownFontSize : this.style.statusBarSignalTypeFontSize) + .fontSize(this.cellularType == Constants.RADIO_TECHNOLOGY_UNKNOWN ? this.statusBarSignalUnknownFontSize : this.statusBarSignalTypeFontSize) .fontColor(this.mStatusBarGroupComponentData.contentColor) - .width(this.style.netSignalTextMaxWidth) + .width(this.netSignalTextMaxWidth) .fontWeight(FontWeight.Bold) .textAlign(TextAlign.Start) .margin({ left: $r("app.float.signal_margin") }) Image(this.updateCellularImage(this.cellularLevel)) .objectFit(ImageFit.Contain) - .width(this.style.cellularImageWidth) - .height(this.style.cellularImageHeight) + .width(this.cellularImageWidth) + .height(this.cellularImageHeight) .fillColor(this.mStatusBarGroupComponentData.contentColor) }.flexShrink(1) - Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%') + Row().width(this.statusBarMarginLeftRight).height('100%') } .height('100%') } diff --git a/features/wificomponent/src/main/ets/default/pages/wifiIcon.ets b/features/wificomponent/src/main/ets/default/pages/wifiIcon.ets index f7e6e8e..4513b63 100644 --- a/features/wificomponent/src/main/ets/default/pages/wifiIcon.ets +++ b/features/wificomponent/src/main/ets/default/pages/wifiIcon.ets @@ -30,8 +30,9 @@ export default struct WifiIcon { @StorageLink('wifiStatus') wifiStatus: boolean = Constants.DEFAULT_WIFI_STATUS private mGroupId: string = '' @State mStatusBarGroupComponentData: StatusBarGroupComponentData = new StatusBarGroupComponentData() - @State styleCommon: any = StyleConfigurationCommon.getCommonStyle() - @State style: any = StyleConfiguration.getStartsBarWifiComponentStyle() + @State statusBarMarginLeftRight: Resource = $r("app.float.signal_status_margin_Left_right") + @State statusBarWifiWidth: Resource = $r('app.float.status_bar_wifi_width') + @State statusBarWifiHeight: Resource = $r('app.float.status_bar_wifi_height') aboutToAppear() { Log.showInfo(TAG, `aboutToAppear`) @@ -46,13 +47,13 @@ export default struct WifiIcon { build() { Row() { if (this.wifiStatus) { - Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%') + Row().width(this.statusBarMarginLeftRight).height('100%') Image(this.getImage(this.wifiInfo)) .objectFit(ImageFit.Contain) - .width(this.style.statusBarWifiWidth) - .height(this.style.statusBarWifiHeight) + .width(this.statusBarWifiWidth) + .height(this.statusBarWifiHeight) .fillColor(this.mStatusBarGroupComponentData.contentColor) - Row().width(this.styleCommon.statusBarMarginLeftRight).height('100%') + Row().width(this.statusBarMarginLeftRight).height('100%') } } .height('100%')