From a1f90065afcdbb720f8282a02877e9ff5777fd0d Mon Sep 17 00:00:00 2001 From: match Date: Fri, 20 May 2022 17:21:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?systemui=20=E6=89=8B=E6=9C=BAux=E9=80=82?= =?UTF-8?q?=E9=85=8D-=E9=80=9A=E7=9F=A5=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: match --- .../main/ets/default/StyleConfiguration.ts | 4 +- .../ohos/view/component/appItemComponent.ets | 59 ++- .../com/ohos/view/component/headComponent.ets | 3 +- .../com/ohos/view/component/itemComponent.ets | 2 +- .../view/component/noDisturbComponent.ets | 16 +- .../ohos/view/component/slotLstComponent.ets | 2 +- .../ohos/view/component/switchComponent.ets | 8 +- .../main/resources/base/element/float.json | 4 + .../main/resources/phone/element/color.json | 36 ++ .../main/resources/phone/element/float.json | 364 ++++++++++++++++++ .../src/main/ets/pages/batchSetEnable.ets | 4 +- .../src/main/ets/pages/noDisturbPre.ets | 11 +- .../ets/pages/notificationManagenment.ets | 27 +- 13 files changed, 497 insertions(+), 43 deletions(-) create mode 100644 features/managementcomponent/src/main/resources/phone/element/color.json create mode 100644 features/managementcomponent/src/main/resources/phone/element/float.json diff --git a/common/src/main/ets/default/StyleConfiguration.ts b/common/src/main/ets/default/StyleConfiguration.ts index 1d8f3e26..dd853bb3 100644 --- a/common/src/main/ets/default/StyleConfiguration.ts +++ b/common/src/main/ets/default/StyleConfiguration.ts @@ -22,10 +22,10 @@ export default class StyleConfiguration { const key: string = TAG + "-Common"; return StyleManager.getStyle(key, () => { return { - statusBarFontSize: '16fp', + statusBarFontSize: '12fp', statusBarIconWidth: '24vp', statusBarIconHeight: '24vp', - statusBarMarginLeftRight: '5vp', + statusBarMarginLeftRight: '0vp', }; }); } diff --git a/features/managementcomponent/src/main/ets/com/ohos/view/component/appItemComponent.ets b/features/managementcomponent/src/main/ets/com/ohos/view/component/appItemComponent.ets index fb5cc8ca..e47412ec 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/view/component/appItemComponent.ets +++ b/features/managementcomponent/src/main/ets/com/ohos/view/component/appItemComponent.ets @@ -56,78 +56,104 @@ export default struct AppItemComponent { Text(this.appTitle) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body1')) + .fontWeight(FontWeight.Medium) .textAlign(TextAlign.Start) .maxLines(ConfigData.MAX_LINES_3) .textOverflow({ overflow: TextOverflow.Ellipsis }) - .margin({ top: $r('app.float.appitem_label_margin_t'), bottom: $r('app.float.appitem_label_margin_b'), left: $r('app.float.page_notice_info_label_margin') }); + .margin({ + top: $r('app.float.appitem_label_margin_t'), + bottom: $r('app.float.appitem_label_margin_b'), + left: $r('app.float.page_notice_info_label_margin') + }); Row() { if (this.appSwitch === 3) { if (parseInt(this.appValue) == 0) { Text($r('app.string.slot_unknown')) - .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) .textAlign(TextAlign.Start) .maxLines(ConfigData.MAX_LINES_1) .textOverflow({ overflow: TextOverflow.Ellipsis }) .visibility(Visibility.Visible) - .margin({ bottom: $r('app.float.appitem_version_margin_b'), left: $r('app.float.page_notice_info_label_margin') }); + .margin({ + bottom: $r('app.float.appitem_version_margin_b'), + left: $r('app.float.page_notice_info_label_margin') + }); } else if (parseInt(this.appValue) == 1) { Text($r('app.string.slot_social_communication')) - .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) .textAlign(TextAlign.Start) .maxLines(ConfigData.MAX_LINES_1) .textOverflow({ overflow: TextOverflow.Ellipsis }) .visibility(Visibility.Visible) - .margin({ bottom: $r('app.float.appitem_version_margin_b'), left: $r('app.float.page_notice_info_label_margin') }); + .margin({ + bottom: $r('app.float.appitem_version_margin_b'), + left: $r('app.float.page_notice_info_label_margin') + }); } else if (parseInt(this.appValue) == 2) { Text($r('app.string.slot_service_information')) - .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) .textAlign(TextAlign.Start) .maxLines(ConfigData.MAX_LINES_1) .textOverflow({ overflow: TextOverflow.Ellipsis }) .visibility(Visibility.Visible) - .margin({ bottom: $r('app.float.appitem_version_margin_b'), left: $r('app.float.page_notice_info_label_margin') }); + .margin({ + bottom: $r('app.float.appitem_version_margin_b'), + left: $r('app.float.page_notice_info_label_margin') + }); } else if (parseInt(this.appValue) == 3) { Text($r('app.string.slot_content_information')) - .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) .textAlign(TextAlign.Start) .maxLines(ConfigData.MAX_LINES_1) .textOverflow({ overflow: TextOverflow.Ellipsis }) .visibility(Visibility.Visible) - .margin({ bottom: $r('app.float.appitem_version_margin_b'), left: $r('app.float.page_notice_info_label_margin') }); + .margin({ + bottom: $r('app.float.appitem_version_margin_b'), + left: $r('app.float.page_notice_info_label_margin') + }); } else if (parseInt(this.appValue) == 0xFFFF) { Text($r('app.string.slot_other')) - .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) .textAlign(TextAlign.Start) .maxLines(ConfigData.MAX_LINES_1) .textOverflow({ overflow: TextOverflow.Ellipsis }) .visibility(Visibility.Visible) - .margin({ bottom: $r('app.float.appitem_version_margin_b'), left: $r('app.float.page_notice_info_label_margin') }); + .margin({ + bottom: $r('app.float.appitem_version_margin_b'), + left: $r('app.float.page_notice_info_label_margin') + }); } else { Text('') - .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) .textAlign(TextAlign.Start) .maxLines(ConfigData.MAX_LINES_1) .textOverflow({ overflow: TextOverflow.Ellipsis }) .visibility(Visibility.Visible) - .margin({ bottom: $r('app.float.appitem_version_margin_b'), left: $r('app.float.page_notice_info_label_margin') }); + .margin({ + bottom: $r('app.float.appitem_version_margin_b'), + left: $r('app.float.page_notice_info_label_margin') + }); } } else { Text($r('app.string.version')) - .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) .textAlign(TextAlign.Start) .maxLines(ConfigData.MAX_LINES_1) .textOverflow({ overflow: TextOverflow.Ellipsis }) .visibility(Visibility.Visible) - .margin({ bottom: $r('app.float.appitem_version_margin_b'), left: $r('app.float.page_notice_info_label_margin') }); + .margin({ + bottom: $r('app.float.appitem_version_margin_b'), + left: $r('app.float.page_notice_info_label_margin') + }); Text(this.appSummary) - .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) .textAlign(TextAlign.Start) .maxLines(ConfigData.MAX_LINES_1) @@ -180,6 +206,7 @@ export default struct AppItemComponent { } else { Toggle({ type: ToggleType.Switch, isOn: this.canNotice }) .align(Alignment.End) + .selectedColor($r("app.color.font_color_007DFF")) .width($r('app.float.toggle_comp_width')) .height($r('app.float.toggle_comp_height')) .enabled(this.isCanChange) diff --git a/features/managementcomponent/src/main/ets/com/ohos/view/component/headComponent.ets b/features/managementcomponent/src/main/ets/com/ohos/view/component/headComponent.ets index 57188627..6614740a 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/view/component/headComponent.ets +++ b/features/managementcomponent/src/main/ets/com/ohos/view/component/headComponent.ets @@ -43,7 +43,7 @@ struct HeadComponent { Text(this.headName) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('app.float.page_phrases_tittle_font')) - .fontWeight(FontWeight.Bold) + .fontWeight(FontWeight.Medium) .width(ConfigData.WH_100_100) .maxLines(ConfigData.MAX_LINES_1) .textOverflow({ overflow: TextOverflow.Ellipsis }) @@ -51,7 +51,6 @@ struct HeadComponent { } .width(ConfigData.WH_100_100) .height($r('app.float.page_title_height')) - .margin({top:$r('app.float.page_header_margin_t')}) .alignItems(VerticalAlign.Center) .align(Alignment.Start) } diff --git a/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets b/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets index 770643a6..48ddac44 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets +++ b/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets @@ -28,7 +28,7 @@ export default struct ItemComponent { .fontColor($r('app.color.itemComp_title_color')) .width(ConfigData.WH_45_100) .textAlign(TextAlign.Start) - .fontWeight(FontWeight.Bold) + .fontWeight(FontWeight.Medium) Blank() Text(this.value) .fontSize($r('app.float.itemComp_value_font')) diff --git a/features/managementcomponent/src/main/ets/com/ohos/view/component/noDisturbComponent.ets b/features/managementcomponent/src/main/ets/com/ohos/view/component/noDisturbComponent.ets index f8152088..712413b0 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/view/component/noDisturbComponent.ets +++ b/features/managementcomponent/src/main/ets/com/ohos/view/component/noDisturbComponent.ets @@ -13,7 +13,7 @@ * limitations under the License. */ import Log from '../../../../../../../../../common/src/main/ets/default/Log'; -import ConfigData, {DoNotDisturbType} from '../../common/constants'; +import ConfigData, { DoNotDisturbType } from '../../common/constants'; import ViewModel from '../../vm/noDisturbComponentViewModel' const TAG = 'ManagementComponent-NoDisturbComponent'; @@ -52,8 +52,9 @@ export default struct NoDisturbComponent { .fontSize($r('app.float.itemComp_titel_font')) .fontColor($r('app.color.itemComp_title_color')) .textAlign(TextAlign.Start) - .fontWeight(FontWeight.Bold) + .fontWeight(FontWeight.Medium) } + Row() { if (this.mRefreshCnt > 0) { if (this.mViewModel.repeatMode == DoNotDisturbType.TYPE_ONCE) { @@ -65,6 +66,7 @@ export default struct NoDisturbComponent { .fontSize($r('app.float.itemComp_value_font')) .fontColor($r('app.color.itemComp_font_color')) .textAlign(TextAlign.Start) + .margin({ top: $r("sys.float.ohos_id_text_margin_vertical") }) } else if (this.mViewModel.repeatMode == DoNotDisturbType.TYPE_DAILY) { Text($r('app.string.noDisturb_daily_label')) .fontSize($r('app.float.itemComp_value_font')) @@ -74,6 +76,7 @@ export default struct NoDisturbComponent { .fontSize($r('app.float.itemComp_value_font')) .fontColor($r('app.color.itemComp_font_color')) .textAlign(TextAlign.Start) + .margin({ top: $r("sys.float.ohos_id_text_margin_vertical") }) } else if (this.mViewModel.repeatMode == DoNotDisturbType.TYPE_CLEARLY) { Text($r('app.string.noDisturb_clearly_label')) .fontSize($r('app.float.itemComp_value_font')) @@ -83,11 +86,13 @@ export default struct NoDisturbComponent { .fontSize($r('app.float.itemComp_value_font')) .fontColor($r('app.color.itemComp_font_color')) .textAlign(TextAlign.Start) + .margin({ top: $r("sys.float.ohos_id_text_margin_vertical") }) } else { Text($r('app.string.noDisturb_closed')) .fontSize($r('app.float.itemComp_value_font')) .fontColor($r('app.color.itemComp_font_color')) .textAlign(TextAlign.Start) + .margin({ top: $r("sys.float.ohos_id_text_margin_vertical") }) } } else { Blank(); @@ -106,6 +111,7 @@ export default struct NoDisturbComponent { .align(Alignment.End) .width($r('app.float.toggle_comp_width')) .height($r('app.float.toggle_comp_height')) + .selectedColor($r("app.color.font_color_007DFF")) .onChange((data) => { Log.showInfo(TAG, `Toggle onChange param: data = ${data}`) if (this.mPrevGetCnt == 0) { @@ -124,8 +130,8 @@ export default struct NoDisturbComponent { this.mViewModel.repeatMode = this.mViewModel.isEffective ? this.mPrevReapMode : DoNotDisturbType.TYPE_NONE; if (this.mViewModel.repeatMode == DoNotDisturbType.TYPE_NONE) { this.mViewModel.refreshDate.bind(this.mViewModel)(this.mViewModel.repeatMode, - this.mViewModel.getDateByHHMI(ConfigData.TIME_EMPTY), - this.mViewModel.getDateByHHMI(ConfigData.TIME_EMPTY)); + this.mViewModel.getDateByHHMI(ConfigData.TIME_EMPTY), + this.mViewModel.getDateByHHMI(ConfigData.TIME_EMPTY)); } else { this.mViewModel.refreshDate.bind(this.mViewModel)(this.mViewModel.repeatMode, this.mPrevStartTime, @@ -140,7 +146,7 @@ export default struct NoDisturbComponent { .flexShrink(0) .align(Alignment.End) .alignItems(VerticalAlign.Center) - .padding({ right: $r('sys.float.ohos_id_max_padding_end') }) + .padding({ right: $r('sys.float.ohos_id_default_padding_end') }) } .width(ConfigData.WH_100_100) .height($r('app.float.itemComp_noDisturb_height')) diff --git a/features/managementcomponent/src/main/ets/com/ohos/view/component/slotLstComponent.ets b/features/managementcomponent/src/main/ets/com/ohos/view/component/slotLstComponent.ets index de2088b3..cf073136 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/view/component/slotLstComponent.ets +++ b/features/managementcomponent/src/main/ets/com/ohos/view/component/slotLstComponent.ets @@ -33,7 +33,7 @@ export default struct SlotLstComponent { Text($r('app.string.slotType')) .fontColor($r('sys.color.ohos_id_color_text_secondary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontWeight(FontWeight.Bold) + .fontWeight(FontWeight.Medium) .width(ConfigData.WH_100_100) .maxLines(ConfigData.MAX_LINES_1) .textOverflow({ overflow: TextOverflow.Ellipsis }) diff --git a/features/managementcomponent/src/main/ets/com/ohos/view/component/switchComponent.ets b/features/managementcomponent/src/main/ets/com/ohos/view/component/switchComponent.ets index 4c4f5a56..d39d889c 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/view/component/switchComponent.ets +++ b/features/managementcomponent/src/main/ets/com/ohos/view/component/switchComponent.ets @@ -34,11 +34,11 @@ export default struct SwitchComponent { Text(this.title) .fontColor($r('sys.color.ohos_id_color_text_primary')) .fontSize($r('sys.float.ohos_id_text_size_body1')) - .fontWeight(FontWeight.Bold) + .fontWeight(FontWeight.Medium) .align(Alignment.Start) Text(this.describe) .fontColor($r('sys.color.ohos_id_color_text_primary')) - .fontSize($r('sys.float.ohos_id_text_size_body1')) + .fontSize($r('sys.float.ohos_id_text_size_body2')) .align(Alignment.Start) .visibility((this.describe ? true : false) ? Visibility.Visible : Visibility.None) }.alignItems(HorizontalAlign.Start) @@ -53,6 +53,8 @@ export default struct SwitchComponent { Row() { Toggle({ type: ToggleType.Switch, isOn: this.initState }) .align(Alignment.End) + .offset({ x: $r("app.float.noDisturb_offset_x"), y: 0 }) + .selectedColor($r("app.color.font_color_007DFF")) .width($r('app.float.toggle_comp_width')) .height($r('app.float.toggle_comp_height')) .enabled(this.isCanChange) @@ -66,7 +68,7 @@ export default struct SwitchComponent { .align(Alignment.End) .padding({ right: $r('app.float.switchComp_padding_r') }) }.width(ConfigData.WH_100_100) - .height($r('app.float.switchComp_height') ) + .height($r('app.float.switchComp_height')) .border({ width: $r('app.float.border_width'), color: Color.White, radius: $r('app.float.border_radius') }) .backgroundColor(Color.White) diff --git a/features/managementcomponent/src/main/resources/base/element/float.json b/features/managementcomponent/src/main/resources/base/element/float.json index 95c96582..73fd5720 100644 --- a/features/managementcomponent/src/main/resources/base/element/float.json +++ b/features/managementcomponent/src/main/resources/base/element/float.json @@ -355,6 +355,10 @@ { "name": "noDisturb_margin_16", "value": "16vp" + }, + { + "name": "noDisturb_offset_x", + "value": "0" } ] } \ No newline at end of file diff --git a/features/managementcomponent/src/main/resources/phone/element/color.json b/features/managementcomponent/src/main/resources/phone/element/color.json new file mode 100644 index 00000000..bf9ed9c0 --- /dev/null +++ b/features/managementcomponent/src/main/resources/phone/element/color.json @@ -0,0 +1,36 @@ +{ + "color": [ + { + "name": "background_color", + "value": "#0xDCDCDC" + }, + { + "name": "background_transparent", + "value": "#00000000" + }, + { + "name": "appitem_label_fontcolor", + "value": "#333333" + }, + { + "name": "appitem_version_fontcolor", + "value": "#999999" + }, + { + "name": "divider_color", + "value": "#0C000000" + }, + { + "name": "itemComp_title_color", + "value": "#182431" + }, + { + "name": "itemComp_font_color", + "value": "#182431" + }, + { + "name": "font_color_007DFF", + "value": "#007DFF" + } + ] +} \ No newline at end of file diff --git a/features/managementcomponent/src/main/resources/phone/element/float.json b/features/managementcomponent/src/main/resources/phone/element/float.json new file mode 100644 index 00000000..fd2c343f --- /dev/null +++ b/features/managementcomponent/src/main/resources/phone/element/float.json @@ -0,0 +1,364 @@ +{ + "float": [ + { + "name": "page_margin_l", + "value": "12pv" + }, + { + "name": "page_margin_r", + "value": "12pv" + }, + { + "name": "page_margin_t", + "value": "5" + }, + { + "name": "page_margin_b", + "value": "5" + }, + { + "name": "page_title_font", + "value": "24vp" + }, + { + "name": "page_title_height", + "value": "56vp" + }, + { + "name": "page_phrases_font", + "value": "14fp" + }, + { + "name": "page_phrases_padding_t", + "value": "19vp" + }, + { + "name": "applist_hieght", + "value": "476vp" + }, + { + "name": "applist_hieght_phone", + "value": "800vp" + }, + { + "name": "applist_hieght_bat", + "value": "584vp" + }, + { + "name": "applist_hieght_bat_phone", + "value": "1022vp" + }, + { + "name": "page_header_margin_t", + "value": "24vp" + }, + { + "name": "applist_margin_t", + "value": "12vp" + }, + { + "name": "page_phrases_height", + "value": "48vp" + }, + { + "name": "page_phrases_tittle_font", + "value": "20fp" + }, + { + "name": "dialog_title_height", + "value": "60vp" + }, + { + "name": "dialog_title_font", + "value": "20fp" + }, + { + "name": "dialog_title_margin_l", + "value": "50" + }, + { + "name": "dialog_button_font", + "value": "20fp" + }, + { + "name": "timeDialog_height", + "value": "310vp" + }, + { + "name": "timeDialog_datePicker_height", + "value": "200vp" + }, + { + "name": "repeatDialog_cont_font", + "value": "16fp" + }, + { + "name": "repeatDialog_height", + "value": "320vp" + }, + { + "name": "border_width", + "value": "1" + }, + { + "name": "border_radius", + "value": "24vp" + }, + { + "name": "image_border_radius", + "value": "15" + }, + { + "name": "appitem_item_height", + "value": "72vp" + }, + { + "name": "appitem_header_icon_width", + "value": "24vp" + }, + { + "name": "appitem_header_icon_height", + "value": "24vp" + }, + { + "name": "appitem_icon_width", + "value": "48vp" + }, + { + "name": "appitem_icon_height", + "value": "48vp" + }, + { + "name": "appitem_icon_info_margin_r", + "value": "4vp" + }, + { + "name": "appitem_icon_info_list_margin_r", + "value": "4vp" + }, + { + "name": "appitem_icon_margin_r", + "value": "16vp" + }, + { + "name": "appitem_label_margin_t", + "value": "10" + }, + { + "name": "appitem_label_margin_b", + "value": "5" + }, + { + "name": "appitem_label_font", + "value": "20vp" + }, + { + "name": "appitem_version_font", + "value": "18vp" + }, + { + "name": "appitem_version_margin_b", + "value": "10" + }, + { + "name": "appitem_version_margin_r", + "value": "10" + }, + { + "name": "arrow_icon_width", + "value": "40" + }, + { + "name": "arrow_icon_height", + "value": "40" + }, + { + "name": "toggle_comp_width", + "value": "44vp" + }, + { + "name": "toggle_comp_height", + "value": "44vp" + }, + { + "name": "toggle_check_width", + "value": "25" + }, + { + "name": "divider_stroke_width", + "value": "1" + }, + { + "name": "divider_margin_l_info", + "value": "64vp" + }, + { + "name": "divider_margin_l", + "value": "12vp" + }, + { + "name": "divider_margin_r", + "value": "12vp" + }, + { + "name": "divider_height", + "value": "20" + }, + { + "name": "itemComp_height", + "value": "48vp" + }, + { + "name": "itemComp_noDisturb_height", + "value": "72vp" + }, + { + "name": "itemComp_titel_font", + "value": "16vp" + }, + { + "name": "itemComp_value_font", + "value": "14fp" + }, + { + "name": "itemComp_image_width", + "value": "12vp" + }, + { + "name": "itemComp_image_height", + "value": "24vp" + }, + { + "name": "itemComp_image_margin_left", + "value": "30" + }, + { + "name": "itemComp_padding_l", + "value": "12vp" + }, + { + "name": "itemComp_padding_r", + "value": "12vp" + }, + { + "name": "itemComp_margin_b", + "value": "8vp" + }, + { + "name": "slotComp_font", + "value": "20" + }, + { + "name": "page_header_icon_margin_l", + "value": "18vp" + }, + { + "name": "page_header_margin_l", + "value": "18vp" + }, + { + "name": "slotComp_image_width", + "value": "18vp" + }, + { + "name": "slotComp_image_height", + "value": "18vp" + }, + { + "name": "slotComp_margin_t", + "value": "20" + }, + { + "name": "switchComp_titel_font", + "value": "20" + }, + { + "name": "switchComp_height", + "value": "64vp" + }, + { + "name": "switchComp_padding_r", + "value": "12vp" + }, + { + "name": "slotComp_height", + "value": "56vp" + }, + { + "name": "distance_24", + "value": "15" + }, + { + "name": "page_notice_title_margin_t", + "value": "8vp" + }, + { + "name": "page_notice_part_margin_t", + "value": "8vp" + }, + { + "name": "page_notice_row_margin_t", + "value": "18vp" + }, + { + "name": "page_notice_app_item_row_height", + "value": "72vp" + }, + { + "name": "appitem_notice_info_icon_width_l", + "value": "64vp" + }, + { + "name": "appitem_notice_info_icon_height_l", + "value": "64vp" + }, + { + "name": "appitem_notice_info_icon_width", + "value": "48vp" + }, + { + "name": "appitem_notice_info_icon_height", + "value": "48vp" + }, + { + "name": "appitem_notice_infopop_icon_width", + "value": "22vp" + }, + { + "name": "appitem_notice_infopop_icon_height", + "value": "22vp" + }, + { + "name": "appitem_notice_infopop_icon_margin_r", + "value": "24vp" + }, + { + "name": "appitem_notice_info_icon_margin_r", + "value": "12vp" + }, + { + "name": "page_notice_info_label_margin", + "value": "12vp" + }, + { + "name": "notice_title_height", + "value": "48vp" + }, + { + "name": "notice_row_height", + "value": "56vp" + }, + { + "name": "noDisturb_margin_lf", + "value": "4vp" + }, + { + "name": "noDisturb_margin_16", + "value": "16vp" + }, + { + "name": "noDisturb_offset_x", + "value": "-18" + } + ] +} \ No newline at end of file diff --git a/product/default/notificationmanagement/src/main/ets/pages/batchSetEnable.ets b/product/default/notificationmanagement/src/main/ets/pages/batchSetEnable.ets index 80d2b369..4d24c308 100644 --- a/product/default/notificationmanagement/src/main/ets/pages/batchSetEnable.ets +++ b/product/default/notificationmanagement/src/main/ets/pages/batchSetEnable.ets @@ -28,7 +28,7 @@ const TAG = 'NotificationManagement-BatchSetEnable'; export default struct BatchSetEnable { @State mViewModel: ViewModel = new ViewModel(); @StorageLink('appManagementList') appList: any[]= []; - @State headName:Resource = $r('app.string.notificationManagement') + @State headName:Resource = $r('app.string.batch_Management') build() { Column() { @@ -58,7 +58,7 @@ export default struct BatchSetEnable { } .divider({ strokeWidth: 1, - color: $r('app.color.background_color'), + color: $r('app.color.divider_color'), startMargin: $r('app.float.divider_margin_l_info'), endMargin: $r('app.float.divider_margin_r') }) diff --git a/product/default/notificationmanagement/src/main/ets/pages/noDisturbPre.ets b/product/default/notificationmanagement/src/main/ets/pages/noDisturbPre.ets index de148a55..ee399db0 100644 --- a/product/default/notificationmanagement/src/main/ets/pages/noDisturbPre.ets +++ b/product/default/notificationmanagement/src/main/ets/pages/noDisturbPre.ets @@ -28,7 +28,7 @@ const TAG = 'NotificationManagement-NoDisturbPre'; @Component export default struct notificationManagenment { @State columnMargin: string = '24vp'; - @State headName: Resource = $r('app.string.notificationManagement') + @State headName: Resource = $r('app.string.noDisturb') @State refreshRequest: number= 0 build() { @@ -45,8 +45,12 @@ export default struct notificationManagenment { Row() { Text($r('app.string.timing_on')) .fontSize($r('app.float.page_phrases_font')) - .margin({top:$r('app.float.page_phrases_padding_t')}) + .fontColor($r('sys.color.ohos_id_color_text_secondary')) + .fontWeight(FontWeight.Medium) + .fontFamily('HarmonyHeiTi-Medium') + .margin({ top: $r('app.float.page_phrases_padding_t') }) } + .align(Alignment.Start) .width(ConfigData.WH_100_100) .height($r('app.float.page_phrases_height')) .padding({ left: $r('sys.float.ohos_id_default_padding_start') }) @@ -58,7 +62,8 @@ export default struct notificationManagenment { .onClick(() => { Log.showInfo(TAG, `NoDisturbComponent on click`) Router.push({ uri: 'pages/noDisturb' }); - }).width(ConfigData.WH_100_100) + }) + .width(ConfigData.WH_100_100) .backgroundColor(Color.White) .border({ width: $r('app.float.border_width'), color: Color.White, radius: $r('app.float.border_radius') }) diff --git a/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets b/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets index bd0cfeb3..af6fae5b 100644 --- a/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets +++ b/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets @@ -75,11 +75,15 @@ export default struct notificationManagenment { .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('app.color.itemComp_title_color')) .align(Alignment.End) + .margin({ right: $r("sys.float.ohos_id_dialog_margin_end") }) + .fontWeight(FontWeight.Medium) } else { Text($r('app.string.noDisturb_closed')) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('app.color.itemComp_title_color')) .align(Alignment.End) + .margin({ right: $r("sys.float.ohos_id_dialog_margin_end") }) + .fontWeight(FontWeight.Medium) } Image($r('app.media.ic_settings_arrow')) .align(Alignment.End) @@ -103,11 +107,18 @@ export default struct notificationManagenment { .onClick(() => { Log.showInfo(TAG, `NoDisturbComponent on click`) Router.push({ uri: 'pages/noDisturbPre' }); - }).width(ConfigData.WH_100_100) + }) + .width(ConfigData.WH_100_100) .flexShrink(0) + Column() { Divider().color($r('app.color.divider_color')).strokeWidth(1) - }.padding({ left: $r('sys.float.ohos_id_default_padding_start'),right:$r('sys.float.ohos_id_default_padding_end') }) + } + .padding({ + left: $r('sys.float.ohos_id_default_padding_start'), + right: $r('sys.float.ohos_id_default_padding_end') + }) + Row() { Row() { SwitchComponent({ @@ -123,19 +134,19 @@ export default struct notificationManagenment { .backgroundColor(Color.White) .border({ width: $r('app.float.border_width'), color: Color.White, radius: $r('app.float.border_radius') }) - .margin({top:$r('app.float.page_notice_title_margin_t')}); + .margin({ top: $r('app.float.page_notice_title_margin_t') }); Row() { Text($r('app.string.notificationManagement')) .fontColor($r('sys.color.ohos_id_color_text_secondary')) .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontWeight(FontWeight.Bold) + .fontWeight(FontWeight.Medium) .fontFamily('HarmonyHeiTi-Medium') - .margin({top:$r('app.float.page_phrases_padding_t')}) + .margin({ top: $r('app.float.page_phrases_padding_t') }) }.align(Alignment.Start) .width(ConfigData.WH_100_100) .height($r('app.float.page_phrases_height')) - .padding({ left: $r('sys.float.ohos_id_default_padding_start')}) + .padding({ left: $r('sys.float.ohos_id_default_padding_start') }) Row() { ItemComponent({ title: $title, value: '', arrow: $arrow }) @@ -148,8 +159,8 @@ export default struct notificationManagenment { Column() { AppLstComponent() }.width(ConfigData.WH_100_100) - .height(this.mViewModel.isPhone?$r('app.float.applist_hieght_phone'):$r('app.float.applist_hieght')) - .margin({top:$r('app.float.applist_margin_t')}); + .height(this.mViewModel.isPhone ? $r('app.float.applist_hieght_phone') : $r('app.float.applist_hieght')) + .margin({ top: $r('app.float.applist_margin_t') }); } .width(ConfigData.WH_100_100) From 84957cacebf88122e100788044b7ea7f104f48fe Mon Sep 17 00:00:00 2001 From: match Date: Mon, 23 May 2022 16:07:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=89=8B=E6=9C=BAux=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: match --- common/src/main/ets/default/StyleConfiguration.ts | 6 ++++-- .../ets/com/ohos/view/component/noDisturbComponent.ets | 8 ++++---- .../src/main/resources/base/element/float.json | 8 ++++++++ .../src/main/resources/phone/element/float.json | 8 ++++++++ .../src/main/ets/pages/notificationManagenment.ets | 4 ++-- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/common/src/main/ets/default/StyleConfiguration.ts b/common/src/main/ets/default/StyleConfiguration.ts index dd853bb3..4a23b516 100644 --- a/common/src/main/ets/default/StyleConfiguration.ts +++ b/common/src/main/ets/default/StyleConfiguration.ts @@ -14,18 +14,20 @@ */ import StyleManager from './StyleManager'; +import deviceInfo from '@ohos.deviceInfo'; const TAG = 'Common-StyleConfiguration'; +const deviceTypeInfo = deviceInfo.deviceType export default class StyleConfiguration { static getCommonStyle() { const key: string = TAG + "-Common"; return StyleManager.getStyle(key, () => { return { - statusBarFontSize: '12fp', + statusBarFontSize: deviceTypeInfo === 'phone' ? '12fp' : '16fp', statusBarIconWidth: '24vp', statusBarIconHeight: '24vp', - statusBarMarginLeftRight: '0vp', + statusBarMarginLeftRight: deviceTypeInfo === 'phone' ? '0vp' : '5vp', }; }); } diff --git a/features/managementcomponent/src/main/ets/com/ohos/view/component/noDisturbComponent.ets b/features/managementcomponent/src/main/ets/com/ohos/view/component/noDisturbComponent.ets index 712413b0..91b60594 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/view/component/noDisturbComponent.ets +++ b/features/managementcomponent/src/main/ets/com/ohos/view/component/noDisturbComponent.ets @@ -66,7 +66,7 @@ export default struct NoDisturbComponent { .fontSize($r('app.float.itemComp_value_font')) .fontColor($r('app.color.itemComp_font_color')) .textAlign(TextAlign.Start) - .margin({ top: $r("sys.float.ohos_id_text_margin_vertical") }) + .margin({ top: $r("app.float.noDisturb_text_margin_vertical") }) } else if (this.mViewModel.repeatMode == DoNotDisturbType.TYPE_DAILY) { Text($r('app.string.noDisturb_daily_label')) .fontSize($r('app.float.itemComp_value_font')) @@ -76,7 +76,7 @@ export default struct NoDisturbComponent { .fontSize($r('app.float.itemComp_value_font')) .fontColor($r('app.color.itemComp_font_color')) .textAlign(TextAlign.Start) - .margin({ top: $r("sys.float.ohos_id_text_margin_vertical") }) + .margin({ top: $r("app.float.noDisturb_text_margin_vertical") }) } else if (this.mViewModel.repeatMode == DoNotDisturbType.TYPE_CLEARLY) { Text($r('app.string.noDisturb_clearly_label')) .fontSize($r('app.float.itemComp_value_font')) @@ -86,13 +86,13 @@ export default struct NoDisturbComponent { .fontSize($r('app.float.itemComp_value_font')) .fontColor($r('app.color.itemComp_font_color')) .textAlign(TextAlign.Start) - .margin({ top: $r("sys.float.ohos_id_text_margin_vertical") }) + .margin({ top: $r("app.float.noDisturb_text_margin_vertical") }) } else { Text($r('app.string.noDisturb_closed')) .fontSize($r('app.float.itemComp_value_font')) .fontColor($r('app.color.itemComp_font_color')) .textAlign(TextAlign.Start) - .margin({ top: $r("sys.float.ohos_id_text_margin_vertical") }) + .margin({ top: $r("app.float.noDisturb_text_margin_vertical") }) } } else { Blank(); diff --git a/features/managementcomponent/src/main/resources/base/element/float.json b/features/managementcomponent/src/main/resources/base/element/float.json index 73fd5720..3be998b0 100644 --- a/features/managementcomponent/src/main/resources/base/element/float.json +++ b/features/managementcomponent/src/main/resources/base/element/float.json @@ -359,6 +359,14 @@ { "name": "noDisturb_offset_x", "value": "0" + }, + { + "name": "noDisturb_text_margin_vertical", + "value": "0vp" + }, + { + "name": "noDisturb_text_margin_right", + "value": "0vp" } ] } \ No newline at end of file diff --git a/features/managementcomponent/src/main/resources/phone/element/float.json b/features/managementcomponent/src/main/resources/phone/element/float.json index fd2c343f..24ea9b6e 100644 --- a/features/managementcomponent/src/main/resources/phone/element/float.json +++ b/features/managementcomponent/src/main/resources/phone/element/float.json @@ -359,6 +359,14 @@ { "name": "noDisturb_offset_x", "value": "-18" + }, + { + "name": "noDisturb_text_margin_vertical", + "value": "2vp" + }, + { + "name": "noDisturb_text_margin_right", + "value": "12vp" } ] } \ No newline at end of file diff --git a/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets b/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets index af6fae5b..d3c21a93 100644 --- a/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets +++ b/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets @@ -75,14 +75,14 @@ export default struct notificationManagenment { .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('app.color.itemComp_title_color')) .align(Alignment.End) - .margin({ right: $r("sys.float.ohos_id_dialog_margin_end") }) + .margin({ right: $r("app.float.noDisturb_text_margin_right") }) .fontWeight(FontWeight.Medium) } else { Text($r('app.string.noDisturb_closed')) .fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('app.color.itemComp_title_color')) .align(Alignment.End) - .margin({ right: $r("sys.float.ohos_id_dialog_margin_end") }) + .margin({ right: $r("app.float.noDisturb_text_margin_right") }) .fontWeight(FontWeight.Medium) } Image($r('app.media.ic_settings_arrow'))