diff --git a/common/src/main/resources/base/element/string.json b/common/src/main/resources/base/element/string.json index 146f1466fb40cd4d8fbd0123088f55e8241d6c2b..0a1676c2a3fdb8a8888f0d4b72540a63c23147a2 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 d40572fc26454f8c4a3ba1b334bda56910a57cb3..ca484d75ec554c9168d00f9d132423ac9c0a50ba 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 af63c7dc4d442eeaaf94ba7b5eebf736390ca1cb..5c08d9c69871bf2389c120b271bb61ac65b0f905 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 2c0dec28ae1c3c1c2c93826154db14b5e91a945a..5c08d9c69871bf2389c120b271bb61ac65b0f905 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 271a77df1cd42c70ff06c0b125d2a93f96976330..f36f34b0d98b8a79abdcfac343dc506b06290ebe 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 f776fa12736ad288ee7d21931cc33449ce2ffa97..7eb3abc43a2b6365cd3dc9eceecd7a329a716795 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 c154329dca6fadcdca2a4948134c6be88c5a7ba4..204413cdef3d0987f3db4bef67eea271b347637d 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 cd0b3a5dbcc008fab39b4e9f577347da97507503..0a1676c2a3fdb8a8888f0d4b72540a63c23147a2 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 3b894b26df58aedbf7f07c41b63cdbaee04d0edc..ea0ba48102abd3402f90e08ba8ef01fb9299669e 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 3b07e1fcea4a9624ec1bfa01caddf9d2c0a19973..d73b7da7e71fb4cccf730db96625bf267c0a20ff 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 @@ -37,11 +46,13 @@ 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 + @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/noticeitem/src/main/resources/base/element/color.json b/features/noticeitem/src/main/resources/base/element/color.json index c78aa2ca8a1bcc7dd0cb0729f45ee212a5e4b259..2258d11a5210bcf57dea7a0523f0740b42ef9b6c 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 9c5292197168935f7520e7f3bbbe41526732343f..abbed94173e898f8e6edbd21c010d6090e3d240d 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 e21e833cfea733c03702f5d431b22c5cc06a01f8..0a1676c2a3fdb8a8888f0d4b72540a63c23147a2 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/ets/com/ohos/notificationservice/NotificationService.ets b/features/notificationservice/src/main/ets/com/ohos/notificationservice/NotificationService.ets index 191eacff55c1daf748f5bfc305996cfdf62b5b3e..7953c30a8ca2e81b1b2e9f229f024b5b3e045845 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/features/notificationservice/src/main/resources/base/element/string.json b/features/notificationservice/src/main/resources/base/element/string.json index 04635caba6f4b96d2400b27eeb9a09321f04941f..0a1676c2a3fdb8a8888f0d4b72540a63c23147a2 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 597e4a721557c42bfb3c8793c85bd27cf3a7330f..5a782d6834d4562d672c8d962c37f0c1b5f4b221 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 27e7b6c08930a5b0cd3869f7a5e131099fe42780..80eedbd55de8a7fa2694707ffc90eb6e20652c58 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 721daed1a110df9cf6112b9e5694a07cc14d823d..b8bf20dabe12a25c046d0de01d6be1154e5f90ea 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 f2bd30039699461da82909fb240d094c4b27335a..5945ea97e09a27631e5e50b65e61a375b5db36ec 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 e8bf0df93b9fc1c44b12194e2b25fe6081c7e7bc..dc7b479cda0a74c2b07c25538e07fb3d5e3554cc 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 1a61a38a13e57c812d4fa9dede55e726c1226fa8..5c08d9c69871bf2389c120b271bb61ac65b0f905 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 8bb0f4e0b133d4a91072b7d8997eeeff4f719cbd..e541724a9f4a287319620de1e1261f6204720043 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 2bc9017685ffa7f79da15675ccc0b298095bbd48..eec9d2acf587c6c059769a38ee80c617e1e8c594 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 8743e3f9bc7f4ccc3dd18b8eb68011587c64d6d6..f391d8ceb1c7f3a96fd74464d8f83376fb873376 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 630808483494fef2b3d36932c1cfd5236ffe569e..77f3bc08b5a1628c512416ad6bfc52bc8647eecf 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/ConfigurableLayout.ets b/product/statusbar/src/main/ets/default/pages/ConfigurableLayout.ets index 5151fad27f85678f7295ad6dfd969b6d790466c2..10c717e9abf3b755f443c44a9a4183f577f3bc03 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 diff --git a/product/statusbar/src/main/ets/default/pages/UpTitle.ets b/product/statusbar/src/main/ets/default/pages/UpTitle.ets index 5d4f1b481450d4aa9af1c5c6759da28683afba83..3c9fb18d504c642c25fe2d6c18ba872c73bc2162 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 42619a577ee19029b8cea1652b1307859d21f223..412328e851f4cbdba3185dd8b1cc664c0a729962 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 67768609176c729c73525525c2c1b2059803d724..0aaf5b91734d3f31b236c2c2681d600508f744dd 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 1fa0a2e166289068e845be34ec11d422affd82b6..30d309d582742af3d279671bd0e09b482fdbda1d 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 8c9f6a803743f93aca6917f777095b379d213c85..372f4cd34b64b263895dd5e42acff17797674f46 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 bdd031b64321b41d8f2267cb79bfe8be650f160c..685d29b498ec98d3093f2d1239d6fd1df4f13756 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 287a554a094fea50436a368846a580df39610770..c4ac5b596ff07f5c38b5bb22bbf96df2deb74473 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"