From b81711445730c0eae6b065e0a92ccd9bb13b0914 Mon Sep 17 00:00:00 2001 From: "size.peng" Date: Wed, 10 Nov 2021 16:21:39 +0800 Subject: [PATCH 1/2] [System-UI]Add system notification. Signed-off-by: size.peng --- .../ohos/noticeItem/item/notificationItem.ets | 13 +++- .../NotificationService.ets | 33 ++++++++- .../ets/default/pages/ConfigurableLayout.ets | 73 ++++++++++++++----- 3 files changed, 97 insertions(+), 22 deletions(-) diff --git a/features/noticeitem/src/main/ets/com/ohos/noticeItem/item/notificationItem.ets b/features/noticeitem/src/main/ets/com/ohos/noticeItem/item/notificationItem.ets index 3b07e1fc..9c36b28c 100644 --- a/features/noticeitem/src/main/ets/com/ohos/noticeItem/item/notificationItem.ets +++ b/features/noticeitem/src/main/ets/com/ohos/noticeItem/item/notificationItem.ets @@ -28,6 +28,15 @@ import {NotificationItemData} from '../../../../../../../../notificationService/ const TAG = 'NoticeItem-NotificationItem'; let mWindowManager; +export function calcNotificationItemHeight(itemData:NotificationItemData){ + //title height+default content height+margin top+padding bottom+margin bottom + let defaultHeight=50+(10+20+10+20)+(10+20)+10 + if(itemData.actionButtons?.length>0){ + defaultHeight=defaultHeight+40 + } + return defaultHeight +} + @Component export default struct NotificationItem { @Link showStatusBar: boolean @@ -42,6 +51,8 @@ export default struct NotificationItem { @State moveX: number = 0 @State moveY: number = 0 + @State isSystemNotification:boolean=false + aboutToAppear() { Log.showInfo(TAG, `aboutToDisAppear Start`) mWindowManager = new WindowManager(); @@ -54,7 +65,7 @@ export default struct NotificationItem { } checkItemNeedExpand(){ - if(this.itemData.contentType===Constants.NOTIFICATION_TYPE_BASIC&&(!(this.itemData.actionButtons?.length>0))){ + if(this.isSystemNotification||(this.itemData.contentType===Constants.NOTIFICATION_TYPE_BASIC&&(!(this.itemData.actionButtons?.length>0)))){ return false; }else{ return true; diff --git a/features/notificationservice/src/main/ets/com/ohos/notificationservice/NotificationService.ets b/features/notificationservice/src/main/ets/com/ohos/notificationservice/NotificationService.ets index 191eacff..7953c30a 100644 --- a/features/notificationservice/src/main/ets/com/ohos/notificationservice/NotificationService.ets +++ b/features/notificationservice/src/main/ets/com/ohos/notificationservice/NotificationService.ets @@ -22,12 +22,14 @@ import {SlotLevel} from '@ohos.notification' import Media from '@ohos.multimedia.media' const TAG = 'NotificationService'; +const debug = false let mNotificationList; let mSubscriber; let mDate; let mAppName; let mEmptyArray; +let trigger = false; /** * Responsible for notification binding and interaction between View and Model. @@ -36,6 +38,7 @@ export class NotificationService { media:any constructor() { let tempLink = AppStorage.SetAndLink('notificationList', []) + AppStorage.SetOrCreate('systemNotificationList', []) mNotificationList = tempLink.get() Log.showInfo(TAG, `NotificationService constructor ${JSON.stringify(mNotificationList)}`) this.media=Media.createAudioPlayer() @@ -62,6 +65,25 @@ export class NotificationService { Log.showInfo(TAG, `updateNotification list: ${JSON.stringify(listLink.get())}`); } + updateSystemNotificationList(item) { + if (debug) { + if (trigger === true) { + Log.showInfo(TAG, `updateSystemNotification not trigger: ${JSON.stringify(item)}`); + return + } else { + Log.showInfo(TAG, `updateSystemNotification trigger: ${JSON.stringify(item)}`); + trigger = true + let tempList = AppStorage.Link('systemNotificationList') + tempList.set([item]) + setTimeout(() => { + trigger = false + Log.showInfo(TAG, `updateSystemNotification trigger clear: ${JSON.stringify(item)}`); + tempList.set([]) + }, 3000) + } + } + } + /** * Call the method to receive notification events. */ @@ -179,10 +201,15 @@ export class NotificationService { Log.showInfo(TAG, `notificationItem AppName = ${JSON.stringify(AppName)}`); let notificationItem:NotificationItemData = this.parseRequest(request,AppName.appName,AppName.icon) Log.showInfo(TAG, `notificationItem = ${JSON.stringify(notificationItem)}`); - if(slotLevel===SlotLevel.LEVEL_HIGH){ - try{ + if(slotLevel===SlotLevel.LEVEL_HIGH) { + try { + this.updateSystemNotificationList(notificationItem) + } catch (e) { + Log.showInfo(TAG, `notificationItem id:${notificationItem.id} system set error: ${e.toString()}`); + } + try { this.media.play() - }catch(e){ + } catch (e) { Log.showInfo(TAG, `notificationItem id:${notificationItem.id} alert error: ${e.toString()}`); } } diff --git a/product/statusbar/src/main/ets/default/pages/ConfigurableLayout.ets b/product/statusbar/src/main/ets/default/pages/ConfigurableLayout.ets index 5151fad2..10c717e9 100644 --- a/product/statusbar/src/main/ets/default/pages/ConfigurableLayout.ets +++ b/product/statusbar/src/main/ets/default/pages/ConfigurableLayout.ets @@ -20,15 +20,18 @@ import ClockIcon from '../../../../../../../features/clockcomponent/src/main/ets import WifiIcon from '../../../../../../../features/wificomponent/src/main/ets/default/pages/wifiIcon.ets' import SignalIcon from '../../../../../../../features/signalcomponent/src/main/ets/default/pages/signalIcon.ets' import ConfigReader from '../common/util/configReader.ets' +import notificationItem, {calcNotificationItemHeight +} from '../../../../../../../features/noticeitem/src/main/ets/com/ohos/noticeItem/item/notificationItem.ets' const TAG = 'StatusBar-TwoGroupLayout' +const Notification_TAG = 'StatusBar-SystemNotification' let mConfigReader; - @Component export default struct Index { @StorageLink('notificationList') notificationList: any = [] + @StorageLink('systemNotificationList') systemNotificationList: any = [] @StorageLink('layoutConfig') layoutConfig: any = {} @StorageLink('wifiStatus') wifiStatus: boolean = false @StorageLink('StatusCoefficient') StatusCoefficient:number = 1.0 @@ -64,31 +67,23 @@ struct Index { } if (item == Constants.NOTIFICATION) { Row() { + ForEach(this.notificationList.slice(0, 3), (item: any) => { + Image(item.smallIcon) + .objectFit(ImageFit.ScaleDown) + .height(Constants.STATIC_BAR_ICON_HEIGHT * this.StatusCoefficient) + .width(Constants.STATIC_BAR_ICON_WIDTH * this.StatusCoefficient) + .margin({ right: Constants.STATIC_BAR_ICON_MARGIN }) + }) if (this.notificationList.length > 3) { - ForEach(this.notificationList.slice(0, 3), (item: any) => { - Image(item.smallIcon) - .objectFit(ImageFit.ScaleDown) - .height(Constants.STATIC_BAR_ICON_HEIGHT*this.StatusCoefficient) - .width(Constants.STATIC_BAR_ICON_WIDTH*this.StatusCoefficient) - .margin({right:Constants.STATIC_BAR_ICON_MARGIN}) - }) Row() { Text('...') .fontSize(20) } - } else { - ForEach(this.notificationList, (item: any) => { - Image(item.smallIcon) - .objectFit(ImageFit.ScaleDown) - .height(Constants.STATIC_BAR_ICON_HEIGHT*this.StatusCoefficient) - .width(Constants.STATIC_BAR_ICON_WIDTH*this.StatusCoefficient) - .margin({right:Constants.STATIC_BAR_ICON_MARGIN}) - }) } } .width(this.notificationList.length > 3 ? - (Constants.STATIC_BAR_ICON_WIDTH+Constants.STATIC_BAR_ICON_MARGIN) * 4 : - (Constants.STATIC_BAR_ICON_WIDTH+Constants.STATIC_BAR_ICON_MARGIN) * this.notificationList.length) + (Constants.STATIC_BAR_ICON_WIDTH + Constants.STATIC_BAR_ICON_MARGIN) * 4 : + (Constants.STATIC_BAR_ICON_WIDTH + Constants.STATIC_BAR_ICON_MARGIN) * this.notificationList.length) } }) }.constraintSize({ maxWidth: 200 }) @@ -98,8 +93,50 @@ struct Index { .layoutWeight(1) } }) + + if (this.systemNotificationList.length > 0) { + SystemNotification() + } } .width('100%') .height('100%') } +} + +@Component +struct SystemNotification { + @StorageLink('systemNotificationList') systemNotificationList: any = [] + dialog: CustomDialogController= new CustomDialogController({ + builder: CustomDialogExample({ itemData: this.systemNotificationList[0] }), + autoCancel: true + }) + + aboutToAppear() { + this.dialog.open() + Log.showInfo(Notification_TAG, `aboutToAppear Start`) + } + + aboutToDisappear() { + this.dialog.close() + Log.showInfo(Notification_TAG, `aboutToDisAppear`) + } + + build() { + } +} + +@CustomDialog +struct CustomDialogExample { + @State showStatusBar: boolean= false + controller: CustomDialogController + itemData: any + + build() { + Row() { + notificationItem({ itemData: this.itemData, showStatusBar: $showStatusBar, isSystemNotification: true }) + }.margin({ bottom: 10 }) + .width('100%') + } +} + } \ No newline at end of file -- Gitee From e003874f61dfcd96379e75a351948a85dbaa8645 Mon Sep 17 00:00:00 2001 From: "size.peng" Date: Mon, 22 Nov 2021 16:04:29 +0800 Subject: [PATCH 2/2] [System-UI]Fix code check issue. Signed-off-by: size.peng --- .../main/resources/base/element/string.json | 7 +--- .../src/main/ets/default/common/constants.ets | 15 ------- .../main/resources/base/element/string.json | 11 +----- .../main/resources/base/element/string.json | 11 +----- .../ohos/navigationservice/ConfigManager.ets | 1 - .../ohos/navigationservice/KeyCodeEvent.ets | 2 +- .../navigationservice/common/constants.ets | 2 - .../main/resources/base/element/string.json | 7 +--- .../com/ohos/noticeItem/common/constants.ets | 2 - .../ohos/noticeItem/item/notificationItem.ets | 4 +- .../main/resources/base/element/color.json | 4 -- .../main/resources/base/element/float.json | 16 -------- .../main/resources/base/element/string.json | 7 +--- .../main/resources/base/element/string.json | 7 +--- .../src/main/ets/default/signalModel.ets | 1 - .../main/resources/base/element/float.json | 20 ---------- .../main/resources/base/element/string.json | 20 ---------- .../src/main/ets/default/common/constants.ets | 3 -- .../main/resources/base/element/float.json | 13 +------ .../main/resources/base/element/string.json | 11 +----- .../src/main/ets/default/common/constants.ets | 2 - .../src/main/ets/default/pages/index.ets | 4 -- .../src/main/ets/default/pages/keyButton.ets | 1 + .../main/resources/base/element/float.json | 24 ------------ .../src/main/ets/default/pages/UpTitle.ets | 2 + .../src/main/ets/default/pages/control.ets | 4 +- .../src/main/ets/default/pages/index.ets | 1 - .../main/ets/default/pages/notification.ets | 1 + .../main/resources/base/element/color.json | 7 ---- .../main/resources/base/element/float.json | 39 ++++++++----------- .../main/resources/base/element/color.json | 4 -- 31 files changed, 33 insertions(+), 220 deletions(-) diff --git a/common/src/main/resources/base/element/string.json b/common/src/main/resources/base/element/string.json index 146f1466..0a1676c2 100644 --- a/common/src/main/resources/base/element/string.json +++ b/common/src/main/resources/base/element/string.json @@ -1,8 +1,3 @@ { - "string": [ - { - "name": "commonutil_library", - "value": "commonutil_library" - } - ] + "string": [] } diff --git a/features/batterycomponent/src/main/ets/default/common/constants.ets b/features/batterycomponent/src/main/ets/default/common/constants.ets index d40572fc..ca484d75 100644 --- a/features/batterycomponent/src/main/ets/default/common/constants.ets +++ b/features/batterycomponent/src/main/ets/default/common/constants.ets @@ -19,21 +19,6 @@ export default class Constants { static WHOLE_CONTAINER_MARGIN = 2 static WHOLE_CONTAINER_WIDTH = 100 static WHOLE_CONTAINER_HEIGHT = 24 - static PIC_CONTAINER_WIDTH = '70%' - static PIC_CONTAINER_HEIGHT = '85%' - //layout params - Pic - static FULL_CONTAINER_WIDTH = '100%' - static FULL_CONTAINER_HEIGHT = '100%' - static BATTERY_BORDER_WIDTH = '88%' - static BATTERY_BORDER_HEIGHT = '80%' - static BATTERY_BORDER_RADIUS = 2 - static BATTERY_BORDER_MARGIN = 2 - static BATTERY_CONTENT_PADDING = 2 - static BATTERY_DECORATOR_WIDTH = '10%' - static BATTERY_DECORATOR_HEIGHT = '50%' - static BATTERY_DECORATOR_MARGIN = 2 - //layout params - Soc - static SOC_FONT_SIZE = 16 //value static BATTERY_LEVEL_LOW = 20 diff --git a/features/batterycomponent/src/main/resources/base/element/string.json b/features/batterycomponent/src/main/resources/base/element/string.json index af63c7dc..5c08d9c6 100644 --- a/features/batterycomponent/src/main/resources/base/element/string.json +++ b/features/batterycomponent/src/main/resources/base/element/string.json @@ -1,12 +1,3 @@ { - "string": [ - { - "name": "batterycomponent_MainAbility", - "value": "batterycomponent_MainAbility" - }, - { - "name": "mainability_description", - "value": "ETS_Empty Feature Ability" - } - ] + "string": [] } \ No newline at end of file diff --git a/features/clockcomponent/src/main/resources/base/element/string.json b/features/clockcomponent/src/main/resources/base/element/string.json index 2c0dec28..5c08d9c6 100644 --- a/features/clockcomponent/src/main/resources/base/element/string.json +++ b/features/clockcomponent/src/main/resources/base/element/string.json @@ -1,12 +1,3 @@ { - "string": [ - { - "name": "clockcomponent_MainAbility", - "value": "clockcomponent_MainAbility" - }, - { - "name": "mainability_description", - "value": "ETS_Empty Feature Ability" - } - ] + "string": [] } \ No newline at end of file diff --git a/features/navigationservice/src/main/ets/com/ohos/navigationservice/ConfigManager.ets b/features/navigationservice/src/main/ets/com/ohos/navigationservice/ConfigManager.ets index 271a77df..f36f34b0 100644 --- a/features/navigationservice/src/main/ets/com/ohos/navigationservice/ConfigManager.ets +++ b/features/navigationservice/src/main/ets/com/ohos/navigationservice/ConfigManager.ets @@ -22,7 +22,6 @@ export class ConfigManager{ initConfig() { var mLayoutConfig = AppStorage.SetAndLink("navigationType", 0); -// mAppStorage.setOrCreate(STORAGE_NAVIGATION_TYPE,TYPE_THREE); mLayoutConfig.set(3); } diff --git a/features/navigationservice/src/main/ets/com/ohos/navigationservice/KeyCodeEvent.ets b/features/navigationservice/src/main/ets/com/ohos/navigationservice/KeyCodeEvent.ets index f776fa12..7eb3abc4 100644 --- a/features/navigationservice/src/main/ets/com/ohos/navigationservice/KeyCodeEvent.ets +++ b/features/navigationservice/src/main/ets/com/ohos/navigationservice/KeyCodeEvent.ets @@ -20,7 +20,7 @@ import Input from '@ohos.multimodalInput.inputEventClient'; const TAG = 'KeyCodeEvent' -let res; +let res={}; let mFeatureAbilityManager = new FeatureAbilityManager(); export class KeyCodeEvent{ diff --git a/features/navigationservice/src/main/ets/com/ohos/navigationservice/common/constants.ets b/features/navigationservice/src/main/ets/com/ohos/navigationservice/common/constants.ets index c154329d..204413cd 100644 --- a/features/navigationservice/src/main/ets/com/ohos/navigationservice/common/constants.ets +++ b/features/navigationservice/src/main/ets/com/ohos/navigationservice/common/constants.ets @@ -14,8 +14,6 @@ */ export default class Constants { - static TYPE_THREE: number = 3; - static TYPE_ONE: number = 1; static KEY_DOWN: number = 0; static KEY_UP: number = 1; static LAUNCHER_BUNDLE_NAME:string = 'com.ohos.launcher'; diff --git a/features/navigationservice/src/main/resources/base/element/string.json b/features/navigationservice/src/main/resources/base/element/string.json index cd0b3a5d..0a1676c2 100644 --- a/features/navigationservice/src/main/resources/base/element/string.json +++ b/features/navigationservice/src/main/resources/base/element/string.json @@ -1,8 +1,3 @@ { - "string": [ - { - "name": "navigationservice_library", - "value": "navigationservice_library" - } - ] + "string": [] } diff --git a/features/noticeitem/src/main/ets/com/ohos/noticeItem/common/constants.ets b/features/noticeitem/src/main/ets/com/ohos/noticeItem/common/constants.ets index 3b894b26..ea0ba481 100644 --- a/features/noticeitem/src/main/ets/com/ohos/noticeItem/common/constants.ets +++ b/features/noticeitem/src/main/ets/com/ohos/noticeItem/common/constants.ets @@ -20,8 +20,6 @@ export default class Constants { static NOTIFICATION_TYPE_MULTILINE: string = '4'; static NOTIFICATION_TYPE_SOCIAL: string = '3'; static NOTIFICATION_TYPE_MEDIA: string = '5'; - static TEXT_MAX_LENGTH: number = 21; - static TEXT_EXPANDED_MAX_LENGTH: number = 13; static TOUCH_TYPE_DOWN: number = 0; static TOUCH_TYPE_UP: number = 1; static TOUCH_TYPE_MOVE: number = 2; diff --git a/features/noticeitem/src/main/ets/com/ohos/noticeItem/item/notificationItem.ets b/features/noticeitem/src/main/ets/com/ohos/noticeItem/item/notificationItem.ets index 9c36b28c..d73b7da7 100644 --- a/features/noticeitem/src/main/ets/com/ohos/noticeItem/item/notificationItem.ets +++ b/features/noticeitem/src/main/ets/com/ohos/noticeItem/item/notificationItem.ets @@ -46,8 +46,8 @@ export default struct NotificationItem { @State needExpand: boolean = true @State deleteIconDisplay: boolean = false; @State itemWidth: string = '100%' - startX: number = 0 - startY: number = 0 + private startX: number = 0 + private startY: number = 0 @State moveX: number = 0 @State moveY: number = 0 diff --git a/features/noticeitem/src/main/resources/base/element/color.json b/features/noticeitem/src/main/resources/base/element/color.json index c78aa2ca..2258d11a 100644 --- a/features/noticeitem/src/main/resources/base/element/color.json +++ b/features/noticeitem/src/main/resources/base/element/color.json @@ -11,10 +11,6 @@ { "name":"content_text_color", "value":"#FF435563" - }, - { - "name":"name_text_color", - "value":"#435563" } ] } \ No newline at end of file diff --git a/features/noticeitem/src/main/resources/base/element/float.json b/features/noticeitem/src/main/resources/base/element/float.json index 9c529219..abbed941 100644 --- a/features/noticeitem/src/main/resources/base/element/float.json +++ b/features/noticeitem/src/main/resources/base/element/float.json @@ -12,14 +12,6 @@ "name": "notification_content_fontsize", "value": "20" }, - { - "name": "notification_content_lineheight", - "value": "20" - }, - { - "name": "notification_content_maxlines", - "value": "1" - }, { "name": "content_margin_top", "value": "10" @@ -60,14 +52,6 @@ "name": "item_paddingbottom", "value": "20" }, - { - "name": "item_setting_image_width", - "value": "30" - }, - { - "name": "item_setting_image_height", - "value": "30" - }, { "name": "item_delete_image_width", "value": "30" diff --git a/features/noticeitem/src/main/resources/base/element/string.json b/features/noticeitem/src/main/resources/base/element/string.json index e21e833c..0a1676c2 100644 --- a/features/noticeitem/src/main/resources/base/element/string.json +++ b/features/noticeitem/src/main/resources/base/element/string.json @@ -1,8 +1,3 @@ { - "string": [ - { - "name": "noticeitem", - "value": "noticeitem" - } - ] + "string": [] } diff --git a/features/notificationservice/src/main/resources/base/element/string.json b/features/notificationservice/src/main/resources/base/element/string.json index 04635cab..0a1676c2 100644 --- a/features/notificationservice/src/main/resources/base/element/string.json +++ b/features/notificationservice/src/main/resources/base/element/string.json @@ -1,8 +1,3 @@ { - "string": [ - { - "name": "quicklysetting_library", - "value": "quicklysetting_library" - } - ] + "string": [] } diff --git a/features/signalcomponent/src/main/ets/default/signalModel.ets b/features/signalcomponent/src/main/ets/default/signalModel.ets index 597e4a72..5a782d68 100644 --- a/features/signalcomponent/src/main/ets/default/signalModel.ets +++ b/features/signalcomponent/src/main/ets/default/signalModel.ets @@ -36,7 +36,6 @@ var mTypeLink; var mStateLink; export class SignalModel - { initSignalModel() { diff --git a/features/signalcomponent/src/main/resources/base/element/float.json b/features/signalcomponent/src/main/resources/base/element/float.json index 27e7b6c0..80eedbd5 100644 --- a/features/signalcomponent/src/main/resources/base/element/float.json +++ b/features/signalcomponent/src/main/resources/base/element/float.json @@ -8,30 +8,10 @@ "name":"fontSize_cellular_type", "value":"8" }, - { - "name":"shrink_network_state", - "value":"0" - }, - { - "name":"shrink_cellular_type", - "value":"1" - }, - { - "name":"maxLine_network_state", - "value":"1" - }, { "name":"margin_cellular_type", "value":"1" }, - { - "name":"signalicon_width", - "value":"120" - }, - { - "name":"signalicon_height", - "value":"50%" - }, { "name":"signalicon_netstatus_width", "value":"113" diff --git a/features/signalcomponent/src/main/resources/base/element/string.json b/features/signalcomponent/src/main/resources/base/element/string.json index 721daed1..b8bf20da 100644 --- a/features/signalcomponent/src/main/resources/base/element/string.json +++ b/features/signalcomponent/src/main/resources/base/element/string.json @@ -1,25 +1,5 @@ { "string": [ - { - "name": "signalcomponent", - "value": "signalcomponent" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "china_mobile", - "value": "中国移动" - }, - { - "name": "china_telecom", - "value": "中国电信" - }, - { - "name": "china_unicom", - "value": "中国联通" - }, { "name": "net_null", "value": "没有 SIM 卡" diff --git a/features/wificomponent/src/main/ets/default/common/constants.ets b/features/wificomponent/src/main/ets/default/common/constants.ets index f2bd3003..5945ea97 100644 --- a/features/wificomponent/src/main/ets/default/common/constants.ets +++ b/features/wificomponent/src/main/ets/default/common/constants.ets @@ -16,9 +16,6 @@ export default class constants { static DEFAULT_WIFI_INFO: number = 0; static DEFAULT_WIFI_STATUS: boolean = false; - static WIFI_STATUS_DISPLAY_HEIGHT: string = '50%'; - static WIFI_STATUS_HIDDEN_HEIGHT: number = 0; - static WIFI_STATUS_MAX_WIDTH: string = '50'; static EVENT_CONN_STATE: string = 'usual.event.wifi.CONN_STATE'; static EVENT_POWER_STATE: string = 'usual.event.wifi.POWER_STATE'; static Event_CONN_NAME: string = 'WIFI_CONNECT_NAME'; diff --git a/features/wificomponent/src/main/resources/base/element/float.json b/features/wificomponent/src/main/resources/base/element/float.json index e8bf0df9..dc7b479c 100644 --- a/features/wificomponent/src/main/resources/base/element/float.json +++ b/features/wificomponent/src/main/resources/base/element/float.json @@ -1,14 +1,3 @@ { - "float": [ - { - "name": "WIFISTATUS_DISPLAY_HEIGHT", - "value": "50%" - },{ - "name": "WIFISTATUS_HIDDEN_HEIGHT", - "value": "0" - },{ - "name": "WIFISTATUS_MAXWIDTH", - "value": "42" - } - ] + "float": [] } diff --git a/features/wificomponent/src/main/resources/base/element/string.json b/features/wificomponent/src/main/resources/base/element/string.json index 1a61a38a..5c08d9c6 100644 --- a/features/wificomponent/src/main/resources/base/element/string.json +++ b/features/wificomponent/src/main/resources/base/element/string.json @@ -1,12 +1,3 @@ { - "string": [ - { - "name": "wificomponent_MainAbility", - "value": "wificomponent_MainAbility" - }, - { - "name": "mainability_description", - "value": "ETS_Empty Feature Ability" - } - ] + "string": [] } \ No newline at end of file diff --git a/product/navigationBar/src/main/ets/default/common/constants.ets b/product/navigationBar/src/main/ets/default/common/constants.ets index 8bb0f4e0..e541724a 100644 --- a/product/navigationBar/src/main/ets/default/common/constants.ets +++ b/product/navigationBar/src/main/ets/default/common/constants.ets @@ -22,8 +22,6 @@ class Constants{ static KEYCODE_RECENT: number = 3; static ONE_TEMPLATE: string = '1fr'; static THREE_TEMPLATE: string = '1fr 1fr 1fr'; - static ONE_ICON_LAYOUT: number = 1; - static THREE_ICON_LAYOUT: number = 3; static IMAGE_WIDTH: number = 32; static IMAGE_HEIGHT: number = 32; static BUTTON_WIDTH: number = 100; diff --git a/product/navigationBar/src/main/ets/default/pages/index.ets b/product/navigationBar/src/main/ets/default/pages/index.ets index 2bc90176..eec9d2ac 100644 --- a/product/navigationBar/src/main/ets/default/pages/index.ets +++ b/product/navigationBar/src/main/ets/default/pages/index.ets @@ -16,11 +16,7 @@ import Three from './threeLayout.ets' import Log from '../../../../../../../common/src/main/ets/default/Log.ets'; import HeightConfigUtils from '../../../../../../../common/src/main/ets/default/heightcofigUtils/HeightConfigUtils.ets'; -import Constants from '../common/constants.ets' -const STORAGE_NAVIGATION_TYPE = 'navigationType' - -let mConfigReader; let mHeightConfigUtils; const TAG = 'NavigationBar-Index'; @Entry diff --git a/product/navigationBar/src/main/ets/default/pages/keyButton.ets b/product/navigationBar/src/main/ets/default/pages/keyButton.ets index 8743e3f9..f391d8ce 100644 --- a/product/navigationBar/src/main/ets/default/pages/keyButton.ets +++ b/product/navigationBar/src/main/ets/default/pages/keyButton.ets @@ -55,6 +55,7 @@ export default struct keyButton { private onKeyTouch(event:TouchEvent) { Log.showInfo(TAG, `onKeyTouch event: ${ event }`) let eventType = event.type; + //switch color when press button switch(eventType) { case Constants.KEY_DOWN: this.backGroundColor =$r('app.color.button_click_background') diff --git a/product/navigationBar/src/main/resources/base/element/float.json b/product/navigationBar/src/main/resources/base/element/float.json index 63080848..77f3bc08 100644 --- a/product/navigationBar/src/main/resources/base/element/float.json +++ b/product/navigationBar/src/main/resources/base/element/float.json @@ -1,29 +1,5 @@ { "float": [ - { - "name": "index_padding_left", - "value": "90" - }, - { - "name": "index_padding_right", - "value": "90" - }, - { - "name": "type_three", - "value": "3" - }, - { - "name": "type_one", - "value": "1" - }, - { - "name": "button_width", - "value": "100" - }, - { - "name": "button_height", - "value": "60" - }, { "name": "button_radius", "value": "30" diff --git a/product/statusbar/src/main/ets/default/pages/UpTitle.ets b/product/statusbar/src/main/ets/default/pages/UpTitle.ets index 5d4f1b48..3c9fb18d 100644 --- a/product/statusbar/src/main/ets/default/pages/UpTitle.ets +++ b/product/statusbar/src/main/ets/default/pages/UpTitle.ets @@ -58,6 +58,8 @@ struct UpTitle { } settingClick() { + //before open setting,set layout status + //it control the whole statusBar layout this.showStatusBar = true; mWindowManager.setWindowMin((result)=>{ mFeatureAbilityManager.openAbility(TAG, { diff --git a/product/statusbar/src/main/ets/default/pages/control.ets b/product/statusbar/src/main/ets/default/pages/control.ets index 42619a57..412328e8 100644 --- a/product/statusbar/src/main/ets/default/pages/control.ets +++ b/product/statusbar/src/main/ets/default/pages/control.ets @@ -29,8 +29,8 @@ let mWindowManager; export default struct Control { @Link showStatusBar: boolean private minHeight: number - startX: number = 0 - startY: number = 0 + private startX: number = 0 + private startY: number = 0 @State moveX: number = 0 @State moveY: number = 0 aboutToAppear() { diff --git a/product/statusbar/src/main/ets/default/pages/index.ets b/product/statusbar/src/main/ets/default/pages/index.ets index 67768609..0aaf5b91 100644 --- a/product/statusbar/src/main/ets/default/pages/index.ets +++ b/product/statusbar/src/main/ets/default/pages/index.ets @@ -17,7 +17,6 @@ import Log from '../../../../../../../common/src/main/ets/default/Log.ets' import ConfigurableLayout from './ConfigurableLayout.ets' import Notification from './notification.ets' import WindowManager from '../../../../../../../common/src/main/ets/default/WindowManager.ets' -import ConfigReader from '../common/util/configReader.ets' import mNotificationService from '../../../../../../../features/notificationService/src/main/ets/com/ohos/notificationservice/NotificationService.ets' import ControlCenterComponent from './control.ets' import Constants from './common/constants.ets' diff --git a/product/statusbar/src/main/ets/default/pages/notification.ets b/product/statusbar/src/main/ets/default/pages/notification.ets index 1fa0a2e1..30d309d5 100644 --- a/product/statusbar/src/main/ets/default/pages/notification.ets +++ b/product/statusbar/src/main/ets/default/pages/notification.ets @@ -161,6 +161,7 @@ struct quicklySetting { } settingClick() { + //start setting feature Log.showInfo(TAG,` settingClick `) this.showStatusBar = true; mWindowManager.setWindowMin((result)=>{ diff --git a/product/statusbar/src/main/resources/base/element/color.json b/product/statusbar/src/main/resources/base/element/color.json index 8c9f6a80..372f4cd3 100644 --- a/product/statusbar/src/main/resources/base/element/color.json +++ b/product/statusbar/src/main/resources/base/element/color.json @@ -20,16 +20,9 @@ "name": "quicklysetting_date_fontcolor", "value": "#ffffffff" }, - { - "name": "quicklysetting_background", - "value": "#292830" - }, { "name": "nonotification_text_color", "value": "#ffffffff" - },{ - "name": "twogroup_layout_background", - "value": "#66000000" },{ "name": "title_font_color", "value": "#FFF" diff --git a/product/statusbar/src/main/resources/base/element/float.json b/product/statusbar/src/main/resources/base/element/float.json index bdd031b6..685d29b4 100644 --- a/product/statusbar/src/main/resources/base/element/float.json +++ b/product/statusbar/src/main/resources/base/element/float.json @@ -1,9 +1,5 @@ { "float": [ - { - "name": "statusbar_height", - "value": "67" - }, { "name": "quicklysetting_time_fontsize", "value": "30" @@ -28,10 +24,6 @@ "name": "quicklysetting_image_marginright", "value": "10" }, - { - "name": "quicklysetting_height", - "value": "120" - }, { "name": "quicklysetting_borderradius", "value": "20" @@ -61,37 +53,38 @@ "value": "0.9" }, { - "name": "default_left_width_small", - "value": "230" - }, - { - "name": "default_left_width_large", - "value": "300" - },{ "name": "up_title_height", "value": "83" - },{ + }, + { "name": "center_item_margin_top", "value": "20" - },{ + }, + { "name": "center_item_margin_left", "value": "10" - },{ + }, + { "name": "center_item_margin_right", "value": "10" - },{ + }, + { "name": "wifi_and_air_height", "value": "120" - },{ + }, + { "name": "vol_height", "value": "66" - },{ + }, + { "name": "title_font_size", "value": "35" - },{ + }, + { "name": "notification_settings_width", "value": "60" - },{ + }, + { "name": "notification_settings_height", "value": "60" } diff --git a/product/systemDialog/src/main/resources/base/element/color.json b/product/systemDialog/src/main/resources/base/element/color.json index 287a554a..c4ac5b59 100644 --- a/product/systemDialog/src/main/resources/base/element/color.json +++ b/product/systemDialog/src/main/resources/base/element/color.json @@ -1,9 +1,5 @@ { "color": [ - { - "name": "dialog_bg", - "value": "#AAFFFF" - }, { "name": "divider_line", "value": "#BEBEBE" -- Gitee